00001
00004 #ifndef _STRINGHELPER_H_
00005 #define _STRINGHELPER_H_
00006
00025 void substr_replace(char **strp, int *strp_len, int *strp_alloc_size,
00026 const int start, const int end,
00027 const char *replace, const int replace_len);
00028
00029 #define ESCAPE_LIKE_C 0x0001
00030 #define ESCAPE_UNICODE 0x0002
00031 #define ESCAPE_HEX 0x0004
00032 #define ESCAPE_NONPRINTABLE 0x0008
00033
00040 void string_escape(char **strp, int *strp_len, int *strp_alloc_size,
00041 const char *chars, int chars_len, int options);
00042 void string_unescape(char **strp, int *strp_len, int *strp_size);
00043
00044 int string_count(const char *src, const char *charlist);
00045 int string_ncount(const char *src, size_t srclen,
00046 const char *charlist, size_t listlen);
00047
00048
00049 char *string_ndup(const char *src, size_t size);
00050
00051 #endif