]> arthur.barton.de Git - netdata.git/blob - src/url.h
Merge pull request #1998 from ktsaou/master
[netdata.git] / src / url.h
1 #ifndef NETDATA_URL_H
2 #define NETDATA_URL_H 1
3
4 // ----------------------------------------------------------------------------
5 // URL encode / decode
6 // code from: http://www.geekhideout.com/urlcode.shtml
7
8 /* Converts a hex character to its integer value */
9 extern char from_hex(char ch);
10
11 /* Converts an integer value to its hex character*/
12 extern char to_hex(char code);
13
14 /* Returns a url-encoded version of str */
15 /* IMPORTANT: be sure to free() the returned string after use */
16 extern char *url_encode(char *str);
17
18 /* Returns a url-decoded version of str */
19 /* IMPORTANT: be sure to free() the returned string after use */
20 extern char *url_decode(char *str);
21
22 extern char *url_decode_r(char *to, char *url, size_t size);
23
24 #endif /* NETDATA_URL_H */