Mercurial > hg > nnchat
comparison th_string.h @ 124:fe4d5f3b486c
Sync.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 29 Oct 2010 16:41:08 +0300 |
parents | 69aed051f84d |
children | 9ae3d87a686f |
comparison
equal
deleted
inserted
replaced
123:0a07138e75bc | 124:fe4d5f3b486c |
---|---|
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 #ifdef STRDUP_PRINTF | |
51 char *th_strdup_vprintf(const char *, va_list); | |
52 char *th_strdup_printf(const char *, ...); | |
53 #endif | |
54 | |
51 char *th_strdup(const char *); | 55 char *th_strdup(const char *); |
52 int th_pstrcpy(char **, char *); | 56 int th_pstrcpy(char **, const char *); |
53 int th_pstrcat(char **, char *); | 57 int th_pstrcat(char **, const char *); |
54 | 58 |
55 char *th_findnext(char *, size_t *); | 59 const char *th_findnext(const char *, size_t *); |
56 char *th_findsep(char *, size_t *, char); | 60 const char *th_findsep(const char *, size_t *, char); |
57 char *th_findseporspace(char *, size_t *, char); | 61 const char *th_findseporspace(const char *, size_t *, char); |
58 | 62 |
59 BOOL th_strmatch(char *, char *); | 63 BOOL th_strmatch(const char *, const char *); |
60 BOOL th_strcasematch(char *, char *); | 64 BOOL th_strcasematch(const char *, const char *); |
61 | 65 |
62 | 66 |
63 #ifdef __cplusplus | 67 #ifdef __cplusplus |
64 } | 68 } |
65 #endif | 69 #endif |