BLOG | DOCUMENTATION | TRAC

Home --> Documentations --> PJLIB Reference

ctype.h
Go to the documentation of this file.
1 /* $Id: ctype.h 3553 2011-05-05 06:14:19Z nanang $ */
2 /*
3  * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
4  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  */
20 #ifndef __PJ_CTYPE_H__
21 #define __PJ_CTYPE_H__
22 
28 #include <pj/types.h>
29 #include <pj/compat/ctype.h>
30 
32 
48 PJ_INLINE(int) pj_isalnum(unsigned char c) { return isalnum(c); }
49 
57 PJ_INLINE(int) pj_isalpha(unsigned char c) { return isalpha(c); }
58 
66 PJ_INLINE(int) pj_isascii(unsigned char c) { return c<128; }
67 
75 PJ_INLINE(int) pj_isdigit(unsigned char c) { return isdigit(c); }
76 
84 PJ_INLINE(int) pj_isspace(unsigned char c) { return isspace(c); }
85 
93 PJ_INLINE(int) pj_islower(unsigned char c) { return islower(c); }
94 
95 
103 PJ_INLINE(int) pj_isupper(unsigned char c) { return isupper(c); }
104 
112 PJ_INLINE(int) pj_isblank(unsigned char c) { return isblank(c); }
113 
119 PJ_INLINE(int) pj_tolower(unsigned char c) { return tolower(c); }
120 
126 PJ_INLINE(int) pj_toupper(unsigned char c) { return toupper(c); }
127 
135 PJ_INLINE(int) pj_isxdigit(unsigned char c){ return isxdigit(c); }
136 
140 /*extern char pj_hex_digits[];*/
141 #define pj_hex_digits "0123456789abcdef"
142 
149 PJ_INLINE(void) pj_val_to_hex_digit(unsigned value, char *p)
150 {
151  *p++ = pj_hex_digits[ (value & 0xF0) >> 4 ];
152  *p = pj_hex_digits[ (value & 0x0F) ];
153 }
154 
160 PJ_INLINE(unsigned) pj_hex_digit_to_val(unsigned char c)
161 {
162  if (c <= '9')
163  return (c-'0') & 0x0F;
164  else if (c <= 'F')
165  return (c-'A'+10) & 0x0F;
166  else
167  return (c-'a'+10) & 0x0F;
168 }
169 
173 
174 #endif /* __PJ_CTYPE_H__ */
175 
int pj_isdigit(unsigned char c)
Definition: ctype.h:75
int pj_isascii(unsigned char c)
Definition: ctype.h:66
Declaration of basic types and utility.
int pj_toupper(unsigned char c)
Definition: ctype.h:126
int pj_isspace(unsigned char c)
Definition: ctype.h:84
unsigned pj_hex_digit_to_val(unsigned char c)
Definition: ctype.h:160
int pj_isxdigit(unsigned char c)
Definition: ctype.h:135
#define PJ_END_DECL
Definition: config.h:1067
int pj_isalnum(unsigned char c)
Definition: ctype.h:48
#define pj_hex_digits
Definition: ctype.h:141
#define PJ_BEGIN_DECL
Definition: config.h:1066
#define PJ_INLINE(type)
Definition: config.h:960
void pj_val_to_hex_digit(unsigned value, char *p)
Definition: ctype.h:149
int pj_isblank(unsigned char c)
Definition: ctype.h:112
int pj_islower(unsigned char c)
Definition: ctype.h:93
int pj_isalpha(unsigned char c)
Definition: ctype.h:57
int pj_isupper(unsigned char c)
Definition: ctype.h:103
int pj_tolower(unsigned char c)
Definition: ctype.h:119

 


PJLIB Open Source, high performance, small footprint, and very very portable framework
Copyright (C) 2006-2009 Teluu Inc.