comparison th_string.h @ 14:e5e6370217ef

Various cleanups, additions and removals.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 30 Oct 2010 17:47:41 +0300
parents a25f5d22483e
children 1f7d8693fda8
comparison
equal deleted inserted replaced
13:adcbcac66125 14:e5e6370217ef
13 #endif 13 #endif
14 14
15 #include "th_util.h" 15 #include "th_util.h"
16 #include <stdlib.h> 16 #include <stdlib.h>
17 #include <ctype.h> 17 #include <ctype.h>
18 #include <stdarg.h>
18 19
19 /* Macros 20 /* Macros
20 */ 21 */
21 #define th_isalnum(c) isalnum((int)(unsigned char) c) 22 #define th_isalnum(c) isalnum((int)(unsigned char) c)
22 #define th_isalpha(c) isalpha((int)(unsigned char) c) 23 #define th_isalpha(c) isalpha((int)(unsigned char) c)
39 #define th_toupper(c) toupper((int)(unsigned char) c) 40 #define th_toupper(c) toupper((int)(unsigned char) c)
40 41
41 42
42 /* Normal NUL-terminated string functions 43 /* Normal NUL-terminated string functions
43 */ 44 */
44 char *th_stralloc(size_t);
45 char *th_strrealloc(char *, size_t);
46 char *th_strncpy(char *, const char *, size_t); 45 char *th_strncpy(char *, const char *, size_t);
47 int th_strcasecmp(char *, char *); 46 int th_strcasecmp(const char *, const char *);
48 int th_strncasecmp(char *, char *, size_t); 47 int th_strncasecmp(const char *, const char *, size_t);
49 void th_strip_ctrlchars(char *); 48 void th_strip_ctrlchars(char *);
50 49
50 char *th_strdup_vprintf(const char *, va_list);
51 char *th_strdup_printf(const char *, ...);
52
51 char *th_strdup(const char *); 53 char *th_strdup(const char *);
52 int th_pstrcpy(char **, char *); 54 int th_pstrcpy(char **, const char *);
53 int th_pstrcat(char **, char *); 55 int th_pstrcat(char **, const char *);
54 56
55 char *th_findnext(char *, size_t *); 57 const char *th_findnext(const char *, size_t *);
56 char *th_findsep(char *, size_t *, char); 58 const char *th_findsep(const char *, size_t *, char);
57 char *th_findseporspace(char *, size_t *, char); 59 const char *th_findseporspace(const char *, size_t *, char);
58 60
59 BOOL th_strmatch(char *, char *); 61 BOOL th_strmatch(const char *, const char *);
60 BOOL th_strcasematch(char *, char *); 62 BOOL th_strcasematch(const char *, const char *);
61 63
64 int th_get_hex_triplet(const char *);
62 65
63 #ifdef __cplusplus 66 #ifdef __cplusplus
64 } 67 }
65 #endif 68 #endif
66 #endif /* _TH_STRING_H */ 69 #endif /* _TH_STRING_H */