Main Page   Modules   Alphabetical List   Data Structures   File List   Data Fields   Globals   Related Pages  

ctype.h File Reference

Character types header. More...

Go to the source code of this file.

Defines

#define _U   0x01
 upper.

#define _L   0x02
 lower.

#define _D   0x04
 digit.

#define _C   0x08
 cntrl.

#define _P   0x10
 punct.

#define _S   0x20
 white space (space/lf/tab).

#define _X   0x40
 hex digit.

#define _SP   0x80
 hard space (0x20).

#define __ismask(x)   (_ctype[(int)(unsigned char)(x)])
#define isalnum(c)   ((__ismask(c)&(_U|_L|_D)) != 0)
 Return a value != 0 only if c is an alphanumeric character.

#define isalpha(c)   ((__ismask(c)&(_U|_L)) != 0)
 Return a value != 0 only if c is an alphabetic character.

#define iscntrl(c)   ((__ismask(c)&(_C)) != 0)
 Return a value != 0 only if c is a control character.

#define isdigit(c)   ((__ismask(c)&(_D)) != 0)
 Return a value != 0 only if c is a digit character.

#define isgraph(c)   ((__ismask(c)&(_P|_U|_L|_D)) != 0)
 Return a value != 0 only if c is a printable (not a space) character.

#define islower(c)   ((__ismask(c)&(_L)) != 0)
 Return a value != 0 only if c is a lower case character.

#define isprint(c)   ((__ismask(c)&(_P|_U|_L|_D|_SP)) != 0)
 Return a value != 0 only if c is a printable character.

#define ispunct(c)   ((__ismask(c)&(_P)) != 0)
 Return a value != 0 only if c is a punctuation-mark.

#define isspace(c)   ((__ismask(c)&(_S)) != 0)
 Return a value != 0 only if c is an empty space like TAB, CR, LF...

#define isupper(c)   ((__ismask(c)&(_U)) != 0)
 Return a value != 0 only if c is an upper case character.

#define isxdigit(c)   ((__ismask(c)&(_D|_X)) != 0)
 Return a value != 0 only if c is a hexadecimal digit.

#define isascii(c)   (((unsigned char)(c))<=0x7f)
 Return a value != 0 only if c is an ASCII character <= 127.

#define toascii(c)   (((unsigned char)(c))&0x7f)
 Return only the ASCII lower 7 bits of the c character.

#define tolower(c)   __tolower(c)
 Macro equivalent to __tolower(c).

#define toupper(c)   __toupper(c)
 Macro equivalent to __toupper(c).


Functions

unsigned char __tolower (unsigned char c)
 Convert a character into the lower case.
Parameters:
c  The character to convert.
Returns:
The lower case of c.


unsigned char __toupper (unsigned char c)
 Convert a character into the upper case.
Parameters:
c  The character to convert.
Returns:
The upper case of c.



Variables

unsigned char _ctype []


Detailed Description

Character types header.

Author:
Linus Torvalds.
Date:
Last update: 2003-11-05 by Andrea Righi.
Note:
Added Doxygen documentation.

Definition in file ctype.h.


Define Documentation

#define __ismask      (_ctype[(int)(unsigned char)(x)])
 

Definition at line 27 of file ctype.h.

#define _C   0x08
 

cntrl.

Definition at line 19 of file ctype.h.

#define _D   0x04
 

digit.

Definition at line 18 of file ctype.h.

#define _L   0x02
 

lower.

Definition at line 17 of file ctype.h.

#define _P   0x10
 

punct.

Definition at line 20 of file ctype.h.

#define _S   0x20
 

white space (space/lf/tab).

Definition at line 21 of file ctype.h.

#define _SP   0x80
 

hard space (0x20).

Definition at line 23 of file ctype.h.

#define _U   0x01
 

upper.

Definition at line 16 of file ctype.h.

#define _X   0x40
 

hex digit.

Definition at line 22 of file ctype.h.

#define isalnum      ((__ismask(c)&(_U|_L|_D)) != 0)
 

Return a value != 0 only if c is an alphanumeric character.

Definition at line 30 of file ctype.h.

#define isalpha      ((__ismask(c)&(_U|_L)) != 0)
 

Return a value != 0 only if c is an alphabetic character.

Definition at line 32 of file ctype.h.

#define isascii      (((unsigned char)(c))<=0x7f)
 

Return a value != 0 only if c is an ASCII character <= 127.

Definition at line 54 of file ctype.h.

#define iscntrl      ((__ismask(c)&(_C)) != 0)
 

Return a value != 0 only if c is a control character.

Definition at line 34 of file ctype.h.

#define isdigit      ((__ismask(c)&(_D)) != 0)
 

Return a value != 0 only if c is a digit character.

Definition at line 36 of file ctype.h.

#define isgraph      ((__ismask(c)&(_P|_U|_L|_D)) != 0)
 

Return a value != 0 only if c is a printable (not a space) character.

Definition at line 39 of file ctype.h.

#define islower      ((__ismask(c)&(_L)) != 0)
 

Return a value != 0 only if c is a lower case character.

Definition at line 41 of file ctype.h.

#define isprint      ((__ismask(c)&(_P|_U|_L|_D|_SP)) != 0)
 

Return a value != 0 only if c is a printable character.

Definition at line 43 of file ctype.h.

#define ispunct      ((__ismask(c)&(_P)) != 0)
 

Return a value != 0 only if c is a punctuation-mark.

Definition at line 45 of file ctype.h.

#define isspace      ((__ismask(c)&(_S)) != 0)
 

Return a value != 0 only if c is an empty space like TAB, CR, LF...

Definition at line 48 of file ctype.h.

#define isupper      ((__ismask(c)&(_U)) != 0)
 

Return a value != 0 only if c is an upper case character.

Definition at line 50 of file ctype.h.

#define isxdigit      ((__ismask(c)&(_D|_X)) != 0)
 

Return a value != 0 only if c is a hexadecimal digit.

Definition at line 52 of file ctype.h.

#define toascii      (((unsigned char)(c))&0x7f)
 

Return only the ASCII lower 7 bits of the c character.

Definition at line 56 of file ctype.h.

#define tolower      __tolower(c)
 

Macro equivalent to __tolower(c).

Definition at line 79 of file ctype.h.

#define toupper      __toupper(c)
 

Macro equivalent to __toupper(c).

Definition at line 82 of file ctype.h.


Function Documentation

unsigned char __tolower unsigned char    c [inline, static]
 

Convert a character into the lower case.

Parameters:
c  The character to convert.
Returns:
The lower case of c.

Definition at line 61 of file ctype.h.

00062 {
00063         if (isupper(c))
00064                 c -= 'A'-'a';
00065         return c;
00066 }

unsigned char __toupper unsigned char    c [inline, static]
 

Convert a character into the upper case.

Parameters:
c  The character to convert.
Returns:
The upper case of c.

Definition at line 71 of file ctype.h.

00072 {
00073         if (islower(c))
00074                 c -= 'a'-'A';
00075         return c;
00076 }


Variable Documentation

unsigned char _ctype[]
 

Definition at line 25 of file ctype.h.


Generated on Fri Feb 20 15:32:17 2004 for Minirighi by doxygen1.2.18