]> mj.ucw.cz Git - eval.git/blob - ucw/string.h
isolate: Switch to libcgroup-based directory hierarchy of /sys/fs/cgroup.
[eval.git] / ucw / string.h
1 /*
2  *      UCW Library -- String Routines
3  *
4  *      (c) 2006 Pavel Charvat <pchar@ucw.cz>
5  *      (c) 2007--2008 Martin Mares <mj@ucw.cz>
6  *
7  *      This software may be freely distributed and used according to the terms
8  *      of the GNU Lesser General Public License.
9  */
10
11 #ifndef _UCW_STRING_H
12 #define _UCW_STRING_H
13
14 /* string.c */
15
16 char *str_format_flags(char *dest, const char *fmt, uns flags);
17 uns str_count_char(const char *str, uns chr);
18
19 /* str-esc.c */
20
21 char *str_unesc(char *dest, const char *src);
22
23 /* str-split.c */
24
25 int str_sepsplit(char *str, uns sep, char **rec, uns max);
26 int str_wordsplit(char *str, char **rec, uns max);
27
28 /* str-(i)match.c: Matching of shell patterns */
29
30 int str_match_pattern(const char *patt, const char *str);
31 int str_match_pattern_nocase(const char *patt, const char *str);
32
33 /* str-hex.c */
34
35 void mem_to_hex(char *dest, const byte *src, uns bytes, uns flags);
36 const char *hex_to_mem(byte *dest, const char *src, uns max_bytes, uns flags);
37
38 // Bottom 8 bits of flags are an optional separator of bytes, the rest is:
39 #define MEM_TO_HEX_UPCASE 0x100
40
41 #endif