Home | History | Annotate | Download | only in include
      1 #ifndef _CTYPE_H
      2 #define _CTYPE_H
      3 
      4 /** @file
      5  *
      6  * Character types
      7  */
      8 
      9 FILE_LICENCE ( GPL2_OR_LATER );
     10 
     11 #define isdigit(c)	((c) >= '0' && (c) <= '9')
     12 #define islower(c)	((c) >= 'a' && (c) <= 'z')
     13 #define isupper(c)	((c) >= 'A' && (c) <= 'Z')
     14 
     15 static inline unsigned char tolower(unsigned char c)
     16 {
     17 	if (isupper(c))
     18 		c -= 'A'-'a';
     19 	return c;
     20 }
     21 
     22 static inline unsigned char toupper(unsigned char c)
     23 {
     24 	if (islower(c))
     25 		c -= 'a'-'A';
     26 	return c;
     27 }
     28 
     29 extern int isspace ( int c );
     30 
     31 #endif /* _CTYPE_H */
     32