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