ASN1C C/C++ Common Runtime  ASN1C v7.5.x
rtxCtype.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2003-2021 Objective Systems, Inc.
3  *
4  * This software is furnished under a license and may be used and copied
5  * only in accordance with the terms of such license and with the
6  * inclusion of the above copyright notice. This software or any other
7  * copies thereof may not be provided or otherwise made available to any
8  * other person. No title to and ownership of the software is hereby
9  * transferred.
10  *
11  * The information in this software is subject to change without notice
12  * and should not be construed as a commitment by Objective Systems, Inc.
13  *
14  * PROPRIETARY NOTICE
15  *
16  * This software is an unpublished work subject to a confidentiality agreement
17  * and is protected by copyright and trade secret law. Unauthorized copying,
18  * redistribution or other use of this work is prohibited.
19  *
20  * The above notice of copyright on this source code product does not indicate
21  * any actual or intended publication of such source code.
22  *
23  *****************************************************************************/
27 #ifndef _RTXCTYPE_H_
28 #define _RTXCTYPE_H_
29 
30 /* Ctype substitution macros */
31 
32 #define OS_ISASCII(c) ((unsigned)(c) < 0x80)
33 
34 #define OS_ISUPPER(c) (c >= 'A' && c <= 'Z')
35 #define OS_ISLOWER(c) (c >= 'a' && c <= 'z')
36 #define OS_ISDIGIT(c) (c >= '0' && c <= '9')
37 #define OS_ISALPHA(c) (OS_ISUPPER(c) || OS_ISLOWER(c))
38 #define OS_ISSPACE(c) ((c >= 0x09 && c <= 0x0d) || (c == ' '))
39 #define OS_ISPUNCT(c) (c >= 0 && c <= 0x20)
40 #define OS_ISALNUM(c) (OS_ISALPHA(c) || OS_ISDIGIT(c))
41 #define OS_ISPRINT(c) (c >= ' ' && c <= '~')
42 #define OS_ISGRAPH(c) (c >= '!' && c <= '~')
43 #define OS_ISCNTRL(c) ((c >= 0 && c <= 0x1F) || c == 0x7F)
44 #define OS_ISXDIGIT(c) \
45 (OS_ISDIGIT(c) || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f'))
46 #define OS_ISBASE64(c) (OS_ISALNUM(c) || c == '+' || c == '/' || c == '=')
47 
48 #define OS_TOLOWER(c) (OS_ISUPPER(c) ? (c) - 'A' + 'a' : (c))
49 #define OS_TOUPPER(c) (OS_ISLOWER(c) ? (c) - 'a' + 'A' : (c))
50 
51 #endif /* _RTXCTYPE_H_ */
52