X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ucw%2Fstring.h;h=0c64ace57dca303d8f3e6e447fc09cec03b931b0;hb=ff7f126077850f9a193b4e4369dbc35f0ce81b12;hp=2583a3574434ec7222c7caf0fc970f8bd7e1b04a;hpb=9f4d2aa894b1ccb7c82e1bd277f51ab1bce9f288;p=libucw.git diff --git a/ucw/string.h b/ucw/string.h index 2583a357..0c64ace5 100644 --- a/ucw/string.h +++ b/ucw/string.h @@ -2,7 +2,7 @@ * UCW Library -- String Routines * * (c) 2006 Pavel Charvat - * (c) 2007--2011 Martin Mares + * (c) 2007--2012 Martin Mares * * This software may be freely distributed and used according to the terms * of the GNU Lesser General Public License. @@ -11,10 +11,26 @@ #ifndef _UCW_STRING_H #define _UCW_STRING_H +#ifdef CONFIG_UCW_CLEAN_ABI +#define hex_to_mem ucw_hex_to_mem +#define mem_to_hex ucw_mem_to_hex +#define str_count_char ucw_str_count_char +#define str_format_flags ucw_str_format_flags +#define str_has_prefix ucw_str_has_prefix +#define str_has_suffix ucw_str_has_suffix +#define str_hier_prefix ucw_str_hier_prefix +#define str_hier_suffix ucw_str_hier_suffix +#define str_match_pattern ucw_str_match_pattern +#define str_match_pattern_nocase ucw_str_match_pattern_nocase +#define str_sepsplit ucw_str_sepsplit +#define str_unesc ucw_str_unesc +#define str_wordsplit ucw_str_wordsplit +#endif + /* string.c */ #ifdef CONFIG_DARWIN -uns strnlen(const char *str, uns n); +uns strnlen(const char *str, uns n); // NOAPI #endif /** @@ -92,8 +108,8 @@ const char *hex_to_mem(byte *dest, const char *src, uns max_bytes, uns flags); /* str-fix.c */ -int str_has_prefix(char *str, char *prefix); /** Tests if @str starts with @prefix. **/ -int str_has_suffix(char *str, char *suffix); /** Tests if @str ends with @suffix. **/ +int str_has_prefix(const char *str, const char *prefix); /** Tests if @str starts with @prefix. **/ +int str_has_suffix(const char *str, const char *suffix); /** Tests if @str ends with @suffix. **/ /** * Let @str and @prefix be hierarchical names with components separated by @@ -110,7 +126,7 @@ int str_has_suffix(char *str, char *suffix); /** Tests if @str ends with @suffi * - "/" is a prefix, * - "" is a prefix. **/ -int str_hier_prefix(char *str, char *prefix, uns sep); -int str_hier_suffix(char *str, char *suffix, uns sep); /** Like @str_hier_prefix(), but for suffixes. **/ +int str_hier_prefix(const char *str, const char *prefix, uns sep); +int str_hier_suffix(const char *str, const char *suffix, uns sep); /** Like @str_hier_prefix(), but for suffixes. **/ #endif