Adaptive Framework  0.9.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
afw_ascii.h
Go to the documentation of this file.
1 // See the 'COPYING' file in the project root for licensing information.
2 /*
3  * Adaptive Framework ASCII
4  *
5  * Copyright (c) 2010-2023 Clemson University
6  *
7  */
8 
9 #ifndef __AFW_ASCII_H__
10 #define __AFW_ASCII_H__
11 
12 #include "afw_minimal.h"
13 
31 
33 #define AFW_ASCII_NUL 0x00
34 
36 #define AFW_ASCII_SOH 0x01
37 
39 #define AFW_ASCII_STX 0x02
40 
42 #define AFW_ASCII_ETX 0x03
43 
45 #define AFW_ASCII_EOT 0x04
46 
48 #define AFW_ASCII_ENQ 0x05
49 
51 #define AFW_ASCII_ACK 0x06
52 
54 #define AFW_ASCII_BEL 0x07
55 
57 #define AFW_ASCII_BS 0x08
58 
60 #define AFW_ASCII_HT 0x09
61 
63 #define AFW_ASCII_LF 0x0A
64 
66 #define AFW_ASCII_VT 0x0B
67 
69 #define AFW_ASCII_FF 0x0C
70 
72 #define AFW_ASCII_CR 0x0D
73 
75 #define AFW_ASCII_SO 0x0E
76 
78 #define AFW_ASCII_SI 0x0F
79 
81 #define AFW_ASCII_DLE 0x10
82 
84 #define AFW_ASCII_DC1 0x11
85 
87 #define AFW_ASCII_DC2 0x12
88 
90 #define AFW_ASCII_DC3 0x13
91 
93 #define AFW_ASCII_DC4 0x14
94 
96 #define AFW_ASCII_NAK 0x15
97 
99 #define AFW_ASCII_SYN 0x16
100 
102 #define AFW_ASCII_ETB 0x17
103 
105 #define AFW_ASCII_CAN 0x18
106 
108 #define AFW_ASCII_EM 0x19
109 
111 #define AFW_ASCII_SUB 0x1A
112 
114 #define AFW_ASCII_ESC 0x1B
115 
117 #define AFW_ASCII_FS 0x1C
118 
120 #define AFW_ASCII_GS 0x1D
121 
123 #define AFW_ASCII_RS 0x1E
124 
126 #define AFW_ASCII_US 0x1F
127 
129 #define AFW_ASCII_DELETE 0x7F
130 
132 #if defined(WIN32)
133 #define AFW_ASCII_Z_PATH_SEPARATOR "\\"
134 #define AFW_ASCII_PATH_SEPARATOR '\\'
135 #else
136 #define AFW_ASCII_Z_PATH_SEPARATOR "/"
137 #define AFW_ASCII_PATH_SEPARATOR '/'
138 #endif
139 
145 #define afw_ascii_is_printable(v) \
146  ( ((v)>=AFW_ASCII_SPACE) && ((v)<=AFW_ASCII_TILDE) )
147 
148 
154 #define afw_ascii_is_lowercase(v) \
155  ( ((v) >= 'a') && ((v) <= 'z') )
156 
157 
163 #define afw_ascii_is_uppercase(v) \
164  ( ((v) >= 'A') && ((v) <= 'Z') )
165 
166 
172 #define afw_ascii_is_alpha(v) \
173  ( afw_ascii_is_ascii_lowercase(v) || afw_ascii_is_ascii_uppercase(v) )
174 
175 
181 #define afw_ascii_is_alphanumeric(v) \
182  ( afw_ascii_is_ascii_alpha(v) || ( ((v)>='0') && ((v)<='9') ) )
183 
184 
190 #define afw_ascii_is_control_character(v) \
191  ( ((v) <= 31) || ((v) == AFW_ASCII_DELETE) )
192 
193 
199 #define afw_ascii_is_digit(v) \
200  ( ((v)>='0') && ((v)<='9') )
201 
202 
203 
211 
212 
213 
219 #define afw_ascii_is_hex_digit(v) \
220  ( afw_ascii_decode_hex_digit(v) != -1 )
221 
222 
230 
231 
232 
238 #define afw_ascii_is_whitespace(v) \
239  ((v) == 32 || ((v) >= 9 && (v) <= 13))
240 
241 
242 AFW_END_DECLARES
243 
246 #endif /* __AFW_ASCII_H__ */
247 
AFW_DEFINE(const afw_object_t *)
#define AFW_BEGIN_DECLARES
Adaptive Framework Minimal Header.
afw_ascii_encode_hex_digit(afw_octet_t octet)
Encode ascii hex digit.
Definition: afw_ascii.c:39
afw_ascii_decode_hex_digit(afw_octet_t octet)
Decode ascii hex digit.
Definition: afw_ascii.c:31
unsigned char afw_octet_t
8 bits (unsigned).
Definition: afw_common.h:211