This repository has been archived on 2020-12-06. You can view files and clone it, but cannot push or open issues or pull requests.
2007-01-26 04:25:19 +01:00
|
|
|
#ifndef _CTYPE_H
|
|
|
|
#define _CTYPE_H
|
|
|
|
|
|
|
|
/** @file
|
|
|
|
*
|
|
|
|
* Character types
|
|
|
|
*/
|
|
|
|
|
2009-05-01 16:41:06 +02:00
|
|
|
FILE_LICENCE ( GPL2_OR_LATER );
|
|
|
|
|
2008-05-19 17:34:17 +02: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 04:25:19 +01: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 11:13:29 +02:00
|
|
|
extern int isspace ( int c );
|
|
|
|
|
2007-01-26 04:25:19 +01:00
|
|
|
#endif /* _CTYPE_H */
|