]> git.ozlabs.org Git - ccan/blob - ccan/str/debug.c
tdb2: unify tdb1_traverse into tdb_traverse
[ccan] / ccan / str / debug.c
1 /* Licensed under LGPLv2.1+ - see LICENSE file for details */
2 #include "config.h"
3 #include <ccan/str/str_debug.h>
4 #include <assert.h>
5 #include <ctype.h>
6 #include <string.h>
7
8 #ifdef CCAN_STR_DEBUG
9 /* Because we mug the real ones with macros, we need our own wrappers. */
10 int str_isalnum(int i)
11 {
12         assert(i >= -1 && i < 256);
13         return isalnum(i);
14 }
15
16 int str_isalpha(int i)
17 {
18         assert(i >= -1 && i < 256);
19         return isalpha(i);
20 }
21
22 int str_isascii(int i)
23 {
24         assert(i >= -1 && i < 256);
25         return isascii(i);
26 }
27
28 #if HAVE_ISBLANK
29 int str_isblank(int i)
30 {
31         assert(i >= -1 && i < 256);
32         return isblank(i);
33 }
34 #endif
35
36 int str_iscntrl(int i)
37 {
38         assert(i >= -1 && i < 256);
39         return iscntrl(i);
40 }
41
42 int str_isdigit(int i)
43 {
44         assert(i >= -1 && i < 256);
45         return isdigit(i);
46 }
47
48 int str_isgraph(int i)
49 {
50         assert(i >= -1 && i < 256);
51         return isgraph(i);
52 }
53
54 int str_islower(int i)
55 {
56         assert(i >= -1 && i < 256);
57         return islower(i);
58 }
59
60 int str_isprint(int i)
61 {
62         assert(i >= -1 && i < 256);
63         return isprint(i);
64 }
65
66 int str_ispunct(int i)
67 {
68         assert(i >= -1 && i < 256);
69         return ispunct(i);
70 }
71
72 int str_isspace(int i)
73 {
74         assert(i >= -1 && i < 256);
75         return isspace(i);
76 }
77
78 int str_isupper(int i)
79 {
80         assert(i >= -1 && i < 256);
81         return isupper(i);
82 }
83
84 int str_isxdigit(int i)
85 {
86         assert(i >= -1 && i < 256);
87         return isxdigit(i);
88 }
89
90
91 char *str_strstr(const char *haystack, const char *needle)
92 {
93         return strstr(haystack, needle);
94 }
95
96 char *str_strchr(const char *haystack, int c)
97 {
98         return strchr(haystack, c);
99 }
100
101 char *str_strrchr(const char *haystack, int c)
102 {
103         return strrchr(haystack, c);
104 }
105 #endif