1 /******************************************************************************
3 * Copyright (c) 2020 ICT/CAS.
5 * Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * https://www.o-ran.org/software
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 *******************************************************************************/
25 #include "vos_types.h"
28 * NOTE! This ctype does not handle EOF like the standard C
29 * library is required to.
32 #define _VOS_U 0x01 /* upper */
33 #define _VOS_L 0x02 /* lower */
34 #define _VOS_D 0x04 /* digit */
35 #define _VOS_C 0x08 /* cntrl */
36 #define _VOS_P 0x10 /* punct */
37 #define _VOS_S 0x20 /* white space (space/lf/tab) */
38 #define _VOS_X 0x40 /* hex digit */
39 #define _VOS_SP 0x80 /* hard space (0x20) */
41 extern unsigned char _vos_ctype[];
43 #define __vos_ismask(x) (_vos_ctype[(int)(unsigned char)(x)])
46 #define vos_isalnum(c) ((__vos_ismask(c)&(_VOS_U|_VOS_L|_VOS_D)) != 0)
49 #define vos_isalpha(c) ((__vos_ismask(c)&(_VOS_U|_VOS_L)) != 0)
52 #define vos_iscntrl(c) ((__vos_ismask(c)&(_VOS_C)) != 0)
55 #define vos_isdigit(c) ((__vos_ismask(c)&(_VOS_D)) != 0)
58 #define vos_isgraph(c) ((__vos_ismask(c)&(_VOS_P|_VOS_U|_VOS_L|_VOS_D)) != 0)
61 #define vos_islower(c) ((__vos_ismask(c)&(_VOS_L)) != 0)
64 #define vos_isprint(c) ((__vos_ismask(c)&(_VOS_P|_VOS_U|_VOS_L|_VOS_D|_VOS_SP)) != 0)
67 #define vos_ispunct(c) ((__vos_ismask(c)&(_VOS_P)) != 0)
70 #define vos_isspace(c) ((__vos_ismask(c)&(_VOS_S)) != 0)
73 #define vos_isupper(c) ((__vos_ismask(c)&(_VOS_U)) != 0)
76 #define vos_isxdigit(c) ((__vos_ismask(c)&(_VOS_D|_VOS_X)) != 0)
79 #define vos_isascii(c) (((unsigned char)(c))<=0x7f)
82 #define vos_toascii(c) (((unsigned char)(c))&0x7f)
85 UCHAR vos_tolower(UCHAR c);
88 UCHAR vos_toupper(UCHAR c);