summary refs log tree commit diff stats
path: root/types.h
blob: 4bfc84b6ef10dabec2d49556182321ab58cfe3b0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#define _is_alpha(c)\
	((c == 'A') ||\
	 (c == 'B') ||\
	 (c == 'C') ||\
	 (c == 'D') ||\
	 (c == 'E') ||\
	 (c == 'F') ||\
	 (c == 'G') ||\
	 (c == 'H') ||\
	 (c == 'I') ||\
	 (c == 'J') ||\
	 (c == 'K') ||\
	 (c == 'L') ||\
	 (c == 'M') ||\
	 (c == 'N') ||\
	 (c == 'O') ||\
	 (c == 'P') ||\
	 (c == 'Q') ||\
	 (c == 'R') ||\
	 (c == 'S') ||\
	 (c == 'T') ||\
	 (c == 'U') ||\
	 (c == 'V') ||\
	 (c == 'W') ||\
	 (c == 'X') ||\
	 (c == 'Y') ||\
	 (c == 'Z') ||\
	 (c == 'a') ||\
	 (c == 'b') ||\
	 (c == 'c') ||\
	 (c == 'd') ||\
	 (c == 'e') ||\
	 (c == 'f') ||\
	 (c == 'g') ||\
	 (c == 'h') ||\
	 (c == 'i') ||\
	 (c == 'j') ||\
	 (c == 'k') ||\
	 (c == 'l') ||\
	 (c == 'm') ||\
	 (c == 'n') ||\
	 (c == 'o') ||\
	 (c == 'p') ||\
	 (c == 'q') ||\
	 (c == 'r') ||\
	 (c == 's') ||\
	 (c == 't') ||\
	 (c == 'u') ||\
	 (c == 'v') ||\
	 (c == 'w') ||\
	 (c == 'x') ||\
	 (c == 'y') ||\
	 (c == 'z'))

#define _is_digit(c)\
	((c == '0') ||\
	 (c == '1') ||\
	 (c == '2') ||\
	 (c == '3') ||\
	 (c == '4') ||\
	 (c == '5') ||\
	 (c == '6') ||\
	 (c == '7') ||\
	 (c == '8') ||\
	 (c == '9'))

#define _is_gen_delim(c)\
	((c == ':') ||\
	 (c == '/') ||\
	 (c == '?') ||\
	 (c == '#') ||\
	 (c == '[') ||\
	 (c == ']') ||\
	 (c == '@'))

#define _is_sub_delim(c)\
	((c == '!') ||\
	 (c == '$') ||\
	 (c == '&') ||\
	 (c == '\'') ||\
	 (c == '(') ||\
	 (c == ')') ||\
	 (c == '*') ||\
	 (c == '+') ||\
	 (c == ',') ||\
	 (c == ';') ||\
	 (c == '='))

#define _is_unreserved(c)\
	(_is_alpha(c) ||\
	 _is_digit(c) ||\
	 (c == '-')   ||\
	 (c == '.')   ||\
	 (c == '_')   ||\
	 (c == '~'))

#define _is_reserved(c)\
	(_is_gen_delim(c) ||\
	 _is_sub_delim(c))

#define _is_pchar(c)\
	(_is_unreserved(c) ||\
	 _is_sub_delim(c)  ||\
	 (c == ':')        ||\
	 (c == '@')        ||\
	 (c == '%'))

#define _is_userinfo(c)\
	(_is_unreserved(c) ||\
	 _is_sub_delim(c)  ||\
	 (c == ':')        ||\
	 (c == '%'))

#define _is_segment(c)\
	_is_pchar(c)

#define _is_segment_nc(c)\
	(_is_unreserved(c) ||\
	 _is_sub_delim(c)  ||\
	 (c == '@')        ||\
	 (c == '%'))