2007-01-26 03:25:19 +00:00
|
|
|
#ifndef _CTYPE_H
|
|
|
|
|
#define _CTYPE_H
|
|
|
|
|
|
|
|
|
|
/** @file
|
|
|
|
|
*
|
|
|
|
|
* Character types
|
|
|
|
|
*/
|
|
|
|
|
|
2009-05-01 15:41:06 +01:00
|
|
|
FILE_LICENCE ( GPL2_OR_LATER );
|
|
|
|
|
|
2008-05-19 16:34:17 +01:00
|
|
|
#define isdigit(c) ((c) >= '0' && (c) <= '9')
|
|
|
|
|
#define islower(c) ((c) >= 'a' && (c) <= 'z')
|
|
|
|
|
#define isupper(c) ((c) >= 'A' && (c) <= 'Z')
|
2010-07-18 17:53:47 +02:00
|
|
|
#define isxdigit(c) (isdigit(c) || ((c) >= 'A' && (c) <= 'F') || ((c) >= 'a' && (c) <= 'f'))
|
2007-01-26 03:25:19 +00:00
|
|
|
|
|
|
|
|
static inline unsigned char tolower(unsigned char c)
|
|
|
|
|
{
|
|
|
|
|
if (isupper(c))
|
|
|
|
|
c -= 'A'-'a';
|
|
|
|
|
return c;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline unsigned char toupper(unsigned char c)
|
|
|
|
|
{
|
|
|
|
|
if (islower(c))
|
|
|
|
|
c -= 'a'-'A';
|
|
|
|
|
return c;
|
|
|
|
|
}
|
|
|
|
|
|
2009-06-03 10:13:29 +01:00
|
|
|
extern int isspace ( int c );
|
|
|
|
|
|
2007-01-26 03:25:19 +00:00
|
|
|
#endif /* _CTYPE_H */
|