Mercurial > hg > nnchat
comparison th_string.h @ 81:69aed051f84d
Synced th-libs.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 20 Apr 2009 22:02:37 +0300 |
parents | e36df57c5b0f |
children | fe4d5f3b486c |
comparison
equal
deleted
inserted
replaced
80:335b5a74c22e | 81:69aed051f84d |
---|---|
16 #include <stdlib.h> | 16 #include <stdlib.h> |
17 #include <ctype.h> | 17 #include <ctype.h> |
18 | 18 |
19 /* Macros | 19 /* Macros |
20 */ | 20 */ |
21 #define th_isalnum(c) isalnum((int)(unsigned char) c) | 21 #define th_isalnum(c) isalnum((int)(unsigned char) c) |
22 #define th_isalpha(c) isalpha((int)(unsigned char) c) | 22 #define th_isalpha(c) isalpha((int)(unsigned char) c) |
23 #define th_isascii(c) isascii((int)(unsigned char) c) | 23 #define th_isascii(c) isascii((int)(unsigned char) c) |
24 #define th_isblank(c) isblank((int)(unsigned char) c) | 24 #define th_isblank(c) isblank((int)(unsigned char) c) |
25 #define th_iscntrl(c) iscntrl((int)(unsigned char) c) | 25 #define th_iscntrl(c) iscntrl((int)(unsigned char) c) |
26 #define th_isdigit(c) isdigit((int)(unsigned char) c) | 26 #define th_isdigit(c) isdigit((int)(unsigned char) c) |
27 #define th_isgraph(c) isgraph((int)(unsigned char) c) | 27 #define th_isgraph(c) isgraph((int)(unsigned char) c) |
28 #define th_islower(c) islower((int)(unsigned char) c) | 28 #define th_islower(c) islower((int)(unsigned char) c) |
29 #define th_isprint(c) isprint((int)(unsigned char) c) | 29 #define th_isprint(c) isprint((int)(unsigned char) c) |
30 #define th_ispunct(c) ispunct((int)(unsigned char) c) | 30 #define th_ispunct(c) ispunct((int)(unsigned char) c) |
31 #define th_isspace(c) isspace((int)(unsigned char) c) | 31 #define th_isspace(c) isspace((int)(unsigned char) c) |
32 #define th_isupper(c) isupper((int)(unsigned char) c) | 32 #define th_isupper(c) isupper((int)(unsigned char) c) |
33 #define th_isxdigit(c) isxdigit((int)(unsigned char) c) | 33 #define th_isxdigit(c) isxdigit((int)(unsigned char) c) |
34 #define th_iscrlf(c) ((c=='\r')||(c=='\n')) | 34 #define th_iscrlf(c) ((c=='\r')||(c=='\n')) |
35 | 35 |
36 #define th_isspecial(q) (((q >= 0x5b) && (q <= 0x60)) || ((q >= 0x7b) && (q <= 0x7d))) | 36 #define th_isspecial(q) (((q >= 0x5b) && (q <= 0x60)) || ((q >= 0x7b) && (q <= 0x7d))) |
37 | 37 |
38 #define th_tolower(c) tolower((int)(unsigned char) c) | 38 #define th_tolower(c) tolower((int)(unsigned char) c) |
39 #define th_toupper(c) toupper((int)(unsigned char) c) | 39 #define th_toupper(c) toupper((int)(unsigned char) c) |
40 | 40 |
41 | 41 |
42 /* Normal NUL-terminated string functions | 42 /* Normal NUL-terminated string functions |
43 */ | 43 */ |
44 char *th_stralloc(size_t); | 44 char *th_stralloc(size_t); |
45 char *th_strrealloc(char *, size_t); | 45 char *th_strrealloc(char *, size_t); |
46 char *th_strncpy(char *, const char *, size_t); | 46 char *th_strncpy(char *, const char *, size_t); |
47 int th_strcasecmp(char *, char *); | 47 int th_strcasecmp(char *, char *); |
48 int th_strncasecmp(char *, char *, size_t); | 48 int th_strncasecmp(char *, char *, size_t); |
49 void th_strip_ctrlchars(char *); | 49 void th_strip_ctrlchars(char *); |
50 | 50 |
51 char *th_strdup(const char *); | 51 char *th_strdup(const char *); |
52 int th_pstrcpy(char **, char *); | 52 int th_pstrcpy(char **, char *); |
53 int th_pstrcat(char **, char *); | 53 int th_pstrcat(char **, char *); |
54 | 54 |
55 char *th_findnext(char *, size_t *); | 55 char *th_findnext(char *, size_t *); |
56 char *th_findsep(char *, size_t *, char); | 56 char *th_findsep(char *, size_t *, char); |
57 char *th_findseporspace(char *, size_t *, char); | 57 char *th_findseporspace(char *, size_t *, char); |
58 | 58 |
59 BOOL th_strmatch(char *, char *); | 59 BOOL th_strmatch(char *, char *); |
60 BOOL th_strcasematch(char *, char *); | 60 BOOL th_strcasematch(char *, char *); |
61 | 61 |
62 | 62 |
63 #ifdef __cplusplus | 63 #ifdef __cplusplus |
64 } | 64 } |
65 #endif | 65 #endif |