2001-09-09 22:21:46 -04:00
|
|
|
#ifndef __UTIL_H__
|
|
|
|
#define __UTIL_H__
|
|
|
|
|
2002-08-09 02:52:07 -04:00
|
|
|
#define XSLT_CONTENT 1
|
|
|
|
#define HTML_CONTENT 2
|
|
|
|
|
2002-07-24 10:52:28 -04:00
|
|
|
int util_timed_wait_for_fd(int fd, int timeout);
|
2001-09-09 22:21:46 -04:00
|
|
|
int util_read_header(int sock, char *buff, unsigned long len);
|
2002-08-09 02:52:07 -04:00
|
|
|
int util_check_valid_extension(char *uri);
|
2002-08-10 04:01:56 -04:00
|
|
|
char *util_get_extension(char *path);
|
2002-08-11 10:00:56 -04:00
|
|
|
char *util_get_path_from_uri(char *uri);
|
2002-08-11 10:23:39 -04:00
|
|
|
char *util_get_path_from_normalised_uri(char *uri);
|
|
|
|
char *util_normalise_uri(char *uri);
|
2002-08-16 10:26:48 -04:00
|
|
|
char *util_base64_encode(char *data);
|
2002-08-18 04:49:25 -04:00
|
|
|
char *util_base64_decode(unsigned char *input);
|
2004-01-14 20:01:09 -05:00
|
|
|
char *util_bin_to_hex(unsigned char *data, int len);
|
2001-09-09 22:21:46 -04:00
|
|
|
|
2003-03-06 09:17:33 -05:00
|
|
|
char *util_url_unescape(char *src);
|
2002-12-31 01:28:39 -05:00
|
|
|
char *util_url_escape(char *src);
|
|
|
|
|
2003-02-26 18:52:23 -05:00
|
|
|
/* String dictionary type, without support for NULL keys, or multiple
|
|
|
|
* instances of the same key */
|
|
|
|
typedef struct _util_dict {
|
|
|
|
char *key;
|
|
|
|
char *val;
|
|
|
|
struct _util_dict *next;
|
|
|
|
} util_dict;
|
|
|
|
|
|
|
|
util_dict *util_dict_new(void);
|
|
|
|
void util_dict_free(util_dict *dict);
|
|
|
|
/* dict, key must not be NULL. */
|
|
|
|
int util_dict_set(util_dict *dict, const char *key, const char *val);
|
|
|
|
const char *util_dict_get(util_dict *dict, const char *key);
|
|
|
|
char *util_dict_urlencode(util_dict *dict, char delim);
|
2001-09-09 22:21:46 -04:00
|
|
|
#endif /* __UTIL_H__ */
|