Next: , Up: Character and String Functions in C Locale   [Contents][Index]


16.1.4.1 c-ctype

The c-ctype module contains functions operating on single-byte characters, like the functions in <ctype.h>, that operate as if the locale encoding was ASCII. (The "C" locale on many systems has the locale encoding "ASCII".)

The functions are:

extern bool c_isascii (int c);

extern bool c_isalnum (int c);
extern bool c_isalpha (int c);
extern bool c_isblank (int c);
extern bool c_iscntrl (int c);
extern bool c_isdigit (int c);
extern bool c_islower (int c);
extern bool c_isgraph (int c);
extern bool c_isprint (int c);
extern bool c_ispunct (int c);
extern bool c_isspace (int c);
extern bool c_isupper (int c);
extern bool c_isxdigit (int c);

extern int c_tolower (int c);
extern int c_toupper (int c);

These functions assign properties only to ASCII characters.

The c argument can be a char or unsigned char value, whereas the corresponding functions in <ctype.h> take an argument that is actually an unsigned char value.

The c_is* functions return ‘bool’, where the corresponding functions in <ctype.h> return ‘int’ for historical reasons.

Note: The <ctype.h> functions support only unibyte locales.