Debian Codegraph @

addons/ooh323c/src/rtctype.h

raw symbols SCIP
1 /*
2 * Copyright (C) 1997-2005 by Objective Systems, Inc.
3 *
4 * This software is furnished under an open source license and may be
5 * used and copied only in accordance with the terms of this license.
6 * The text of the license may generally be found in the root
7 * directory of this installation in the COPYING file. It
8 * can also be viewed online at the following URL:
9 *
10 * http://www.obj-sys.com/open/license.html
11 *
12 * Any redistributions of this file including modified versions must
13 * maintain this copyright notice.
14 *
15 *****************************************************************************/
16
17 /**
18 * @file rtctype.h
19 */
20 #ifndef _RTCTYPE_H_
21 #define _RTCTYPE_H_
22
23 #include "ooasn1.h"
24
25 /* Ctype module constants */
26
27 #define OS_CTYPE_UPPER 0x1
28 #define OS_CTYPE_LOWER 0x2
29 #define OS_CTYPE_NUMBER 0x4
30 #define OS_CTYPE_SPACE 0x8
31 #define OS_CTYPE_PUNCT 0x10
32 #define OS_CTYPE_CTRL 0x20
33 #define OS_CTYPE_HEX 0x40
34 #define OS_CTYPE_BLANK 0x80
35
36 /* Ctype substitution macros */
37
38 #define OS_ISALPHA(c) \
39 (rtCtypeTable[(unsigned)(c)]&(OS_CTYPE_UPPER|OS_CTYPE_LOWER))
40 #define OS_ISUPPER(c) \
41 (rtCtypeTable[(unsigned)(c)]&OS_CTYPE_UPPER)
42 #define OS_ISLOWER(c) \
43 (rtCtypeTable[(unsigned)(c)]&OS_CTYPE_LOWER)
44 #define OS_ISDIGIT(c) \
45 (rtCtypeTable[(unsigned)(c)]&OS_CTYPE_NUMBER)
46 #define OS_ISXDIGIT(c) \
47 (rtCtypeTable[(unsigned)(c)]&(OS_CTYPE_HEX|OS_CTYPE_NUMBER))
48 #define OS_ISSPACE(c) \
49 (rtCtypeTable[(unsigned)(c)]&OS_CTYPE_SPACE)
50 #define OS_ISPUNCT(c) \
51 (rtCtypeTable[(unsigned)(c)]&OS_CTYPE_PUNCT)
52 #define OS_ISALNUM(c) \
53 (rtCtypeTable[(unsigned)(c)]&(OS_CTYPE_UPPER|OS_CTYPE_LOWER|OS_CTYPE_NUMBER))
54 #define OS_ISPRINT(c) \
55 (rtCtypeTable[(unsigned)(c)]& \
56 (OS_CTYPE_PUNCT|OS_CTYPE_UPPER|OS_CTYPE_LOWER|OS_CTYPE_NUMBER|OS_CTYPE_BLANK))
57 #define OS_ISGRAPH(c) \
58 (rtCtypeTable[(unsigned)(c)]& \
59 (OS_CTYPE_PUNCT|OS_CTYPE_UPPER|OS_CTYPE_LOWER|OS_CTYPE_NUMBER))
60 #define OS_ISCNTRL(c) \
61 (rtCtypeTable[(unsigned)(c)]&OS_CTYPE_CTRL)
62
63 #define OS_TOLOWER(c) (OS_ISUPPER(c) ? (c) - 'A' + 'a' : (c))
64 #define OS_TOUPPER(c) (OS_ISLOWER(c) ? (c) - 'a' + 'A' : (c))
65
66 #ifdef __cplusplus
67 extern "C" {
68 #endif
69
70 #ifndef EXTERN
71 #ifdef MAKE_DLL
72 #define EXTERN __declspec(dllexport)
73 #else
74 #define EXTERN
75 #endif /* MAKE_DLL */
76 #endif /* EXTERN */
77 /* ctype module table */
78
79 extern EXTERN const ASN1OCTET rtCtypeTable[256];
80
81 #ifdef __cplusplus
82 }
83 #endif
84
85 #endif /* _RTCTYPE_H_ */