1 /*----------------------------------------------------------------------------
2 *
3 * File:
4 * eas_ctype.h
5 *
6 * Contents and purpose:
7 * This is a replacement for the CRT ctype.h functions. These
8 * functions are currently ASCII only, but eventually, we will want
9 * to support wide-characters for localization.
10 *
11 * Copyright (c) 2005 Sonic Network Inc.
12
13 * Licensed under the Apache License, Version 2.0 (the "License");
14 * you may not use this file except in compliance with the License.
15 * You may obtain a copy of the License at
16 *
17 * http://www.apache.org/licenses/LICENSE-2.0
18 *
19 * Unless required by applicable law or agreed to in writing, software
20 * distributed under the License is distributed on an "AS IS" BASIS,
21 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 * See the License for the specific language governing permissions and
23 * limitations under the License.
24 *
25 *----------------------------------------------------------------------------
26 * Revision Control:
27 * $Revision: 429 $
28 * $Date: 2006-10-19 23:50:15 -0700 (Thu, 19 Oct 2006) $
29 *----------------------------------------------------------------------------
30 */
31
32 #ifndef _EAS_CTYPE_H
33 #define _EAS_CTYPE_H
34
IsDigit(EAS_I8 c)35 EAS_INLINE EAS_I8 IsDigit (EAS_I8 c) { return ((c >= '0') && (c <= '9')); }
IsSpace(EAS_I8 c)36 EAS_INLINE EAS_I8 IsSpace (EAS_I8 c) { return (((c >= 9) && (c <= 13)) || (c == ' ')); }
ToUpper(EAS_I8 c)37 EAS_INLINE EAS_I8 ToUpper (EAS_I8 c) { if ((c >= 'a') && (c <= 'z')) return c & ~0x20; else return c; }
ToLower(EAS_I8 c)38 EAS_INLINE EAS_I8 ToLower (EAS_I8 c) { if ((c >= 'A') && (c <= 'Z')) return c |= 0x20; else return c; }
39
40 #endif
41
42