summaryrefslogtreecommitdiff
path: root/src/include/util_String.h
blob: c294e0111ac768b5690348e4886d13c2dc1ff6fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
 /*@@
   @header    util_String.h
   @date      Tue May  2 11:00:39 2000
   @author    Tom Goodale
   @desc 
   String routines
   @enddesc 
   @version $Header$
 @@*/

#ifndef _UTIL_STRING_H_
#define _UTIL_STRING_H_ 1

#include <stdarg.h>
#include <stddef.h>

#ifdef __cplusplus
extern "C" 
{
#endif

const char *Util_StrSep(const char **stringp, 
                        const char *delim);

int Util_SplitString(char **before, 
                     char **after, 
                     const char *string, 
                     const char *sep);

int Util_SplitFilename(char **dir, 
                       char **file, 
                       const char *string);

char *Util_Strdup(const char *s);

size_t Util_Strlcpy(char* dst, const char* src, size_t dst_size);
size_t Util_Strlcat(char* dst, const char* src, size_t dst_size);

int Util_StrCmpi(const char *string1, 
                 const char *string2);
int Util_StrMemCmpi(const char *string1, 
                    const char *string2,
                    size_t len2);

int Util_vsnprintf (char *str, size_t count, const char *fmt, va_list args);
int Util_snprintf (char *str,size_t count,const char *fmt,...);

int Util_asprintf(char **buffer, const char *fmt, ...);
int Util_asnprintf(char **buffer, size_t size, const char *fmt, ...);

#ifdef __cplusplus
}
#endif

#endif /* _UTIL_STRING_H_ */