2 * UCW Library -- String Routines
4 * (c) 2006 Pavel Charvat <pchar@ucw.cz>
5 * (c) 2007--2012 Martin Mares <mj@ucw.cz>
7 * This software may be freely distributed and used according to the terms
8 * of the GNU Lesser General Public License.
17 uns strnlen(const char *str, uns n);
20 char *str_format_flags(char *dest, const char *fmt, uns flags);
21 uns str_count_char(const char *str, uns chr);
23 /** Returns a non-zero value if @haystack starts with @needle. **/
24 int str_starts_with(const char *haystack, const char *needle);
26 /** Returns a non-zero value if @haystack ends with @needle. **/
27 int str_ends_with(const char *haystack, const char *needle);
31 char *str_unesc(char *dest, const char *src);
35 int str_sepsplit(char *str, uns sep, char **rec, uns max);
36 int str_wordsplit(char *str, char **rec, uns max);
38 /* str-(i)match.c: Matching of shell patterns */
40 int str_match_pattern(const char *patt, const char *str);
41 int str_match_pattern_nocase(const char *patt, const char *str);
45 void mem_to_hex(char *dest, const byte *src, uns bytes, uns flags);
46 const char *hex_to_mem(byte *dest, const char *src, uns max_bytes, uns flags);
48 // Bottom 8 bits of flags are an optional separator of bytes, the rest is:
49 #define MEM_TO_HEX_UPCASE 0x100