Main Page | Alphabetical List | Class List | File List | Class Members | File Members

ctype.h File Reference

functions for classifying and mapping characters More...

#include <nlibc.h>

Include dependency graph for ctype.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define isupper(c)   ((c) >= 'A' && (c) <= 'Z')
 test for an uppercase

#define islower(c)   ((c)>=97 && (c)<=122)
 test if character is lowercase letter

#define isalpha(c)   (isupper((c)) || islower((c)))
 test if character is alphabetic

#define isdigit(c)   ((c)>='0' && (c)<='9')
 test if character is digit

#define isalnum(c)   ( (isalpha((c)) || isdigit((c)) )
 checks for an alphanumeric character

#define isblank(c)   ((c)==' ' || (c)=='\t')
 test if character ist blank

#define isprint(c)   (((c)>=32 && (c)<=126) || ((c)>=161 && (c)<=254))
 test if character is printable

#define iscntrl(c)   (!isprint(c))
 test if character is control character

#define isgraph(c)   (isprint(c) && (c)==' ')
 if character is printable (and not a space)

#define isspace(c)   ((c)==' ' || (c)=='\f' || (c)=='\n' || (c)=='\r' || (c)=='\t' || (c)=='\v')
 test for a white-space character

#define ispunct(c)   (isprint((c)) && !isalnum((c)) && !isspace((c)))
 test if character is neither space nor alphanumeric

#define isxdigit(c)   ( isdigit(c) || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F') )
 test for a hexadecimal digit


Functions

int tolower (int c)
 convert uppercase letter to lowercase

int toupper (int c)
 convert lowercase letter to uppercase


Detailed Description

functions for classifying and mapping characters

NAME
ctype.h - character types
SYNOPSIS
#include <ctype.h>
DESCRIPTION
The functions defined here are useful for input/output units, i.e.
for c functions like fprint, fprintf, fscan, fscanf, etc.

IMPLEMENTATION for APEnext: possible (ctype.h)

VERSION

Id
ctype.h,v 1.22 2005/10/27 20:04:44 morinl Exp


ISO/IEC 9899:1999 (E) Standard

Author:

Definition in file ctype.h.


Define Documentation

#define isalnum  )     ( (isalpha((c)) || isdigit((c)) )
 

checks for an alphanumeric character

NAME
isalnum - checks for an alphanumeric character

SYNOPSIS
#include <ctype.h>

int isalnum (int)

DESCRIPTION
The isalnum() function tests for any character for which isalpha() or
isdigit() is true. Review these functions below!

for specification, isalnum() function tests if a character is an alphanumeric.
The behavior of the isalnum() function is affected by the current locale.

RETURN VALUE
The isalnum() function returns non-zero for true and zero for false.
If the parameter is not in the domain of the function, the return result
is undefined. Note true and false are not given in c. In apeNEXT we might
have a certain logical unit for suc boolean definations (ToDo!!!!!).

NOTES
To modify the behavior, one can change the LC_CTYPE category in setlocale(),
that is, setlocale(LC_CTYPE, newlocale)! In the C locale or in a locale
where character type information is not defined, characters are classified
according to the rules of the ASCII 7-bit coded character set.

IMPLEMENTATION for APEnext: done for "C" locale (noe 6/04)

Definition at line 204 of file ctype.h.

#define isalpha  )     (isupper((c)) || islower((c)))
 

test if character is alphabetic

NAME
isalpha - if character is alphabetic

SYNOPSIS
#include <ctype.h>

int isalpha (int)

DESCRIPTION
The isalpha() function tests for any character for which
isupper() or islower() is true, or any character that is one of
an implementation-defined set of characters for which none of
iscntrl(), isdigit(), ispunct(), or isspace() is true.

For spicification, the isalpha() function tests if a character is
an alphabetic. The behaviour of the isalpha() function is
affected by the current locale.

RETURN VALUE
The isalpha() function returns non-zero for true and zero for
false. If the parameter is not in the domain of the function,
the return result is undefined. isalpha() returns true only for
the characters for which isupper() or islower() is true.

Notes
To modify the behavior, one cane change the LC_CTYPE category in
setlocale(), that is, setlocale(LC_CTYPE, newlocale). In the C
locale or in a locale where character type information is not
defined, characters are classified according to the rules of the
ASCII 7-bit coded character set. In apeNEXT we might have a
certain logical unit for such boolean definations (ToDo!!!!!).

IMPLEMENTATION for APEnext:
done for "C" locale (noe 6/04)

Definition at line 135 of file ctype.h.

#define isblank  )     ((c)==' ' || (c)=='\t')
 

test if character ist blank

NAME
isblank - if character ist blank

SYNOPSIS
#include <ctype.h>

int isblank(int)

DESCRIPTION
The isblank() function tests whether a character is of the calss
blank in the program's current locale

The character is a type int, the value of which the application
shall ensure is a character representable as an unsigned char or
equal to the value of the macro EOF. If the argument has any
other value, the behavior is undefined.

RETURN VALUE
The isblank() function returns non-zero (true) if the character
is a <blank>. Otherwise, it returns zero (false).

Notes
In the C locale or in a locale where character type information
is not defined, characters are classified according to the rules
of the ASCII 7-bit coded character set.
In apeNEXT we might have a certain logical unit for such boolean
definations (ToDo!!!!!).

IMPLEMENTATION for APEnext:
done for "C" locale (noe 6/04)

Definition at line 239 of file ctype.h.

#define iscntrl  )     (!isprint(c))
 

test if character is control character

NAME
iscntrl - if character is control character

SYNOPSIS
#include <ctype.h>

int iscntrl(int)

DESCRIPTION
The iscntrl() functions tests for any control character or any
character for which isprint() is false.
The behavior of the iscntrl() function is affected by the current
locale.

RETURN VALUE
The iscntrl() function returns non-zero for true and zero for
false. If the parameter is not in the domain of the function,
the return result is undefined

Notes
To modify the behavior, change the LC_CTYPE category in
setlocale() that is, setlocale(LC_CTYPE, newlocale). In the C
locale or in a locale where character type information is not
defined, characters are classified according to the rules of the
ASCII 7-bit coded character set.
In apeNEXT we might have a certain logical unit for such boolean
definations (ToDo!!!!!).

IMPLEMENTATION for APEnext:
done for "C" locale (noe 6/04)

Definition at line 309 of file ctype.h.

#define isdigit  )     ((c)>='0' && (c)<='9')
 

test if character is digit

NAME
isdigit - test if character is digit

SYNOPSIS
#include <ctype.h>

int isdigit(int)

DESCRIPTIO
The isdigit() function tests for any decimal-digit character.
The behavior of the isdigit() function is affected by the current
locale. To modify the behavior, change the LC_CTYPE category in
setlocale(), that is, setlocale(LC_CTYPE, newlocale).

RETURN VALUE
The isdigit() function returns non-zero for true and zero for
false. If the parameter is not in the domain of the function, the
return result is undefined

Notes
To modify the behavior, change the LC_CTYPE category in
setlocale(), that is, setlocale(LC_CTYPE, newlocale). In the C
locale or in a locale where character type information is not
defined, characters are classified according to the rules of the
7-bit coded character set.
In apeNEXT we might have a certain logical unit for such boolean
definations (ToDo!!!!!).

IMPLEMENTATION for APEnext:
done for "C" locale (noe 6/04)

Definition at line 170 of file ctype.h.

#define isgraph  )     (isprint(c) && (c)==' ')
 

if character is printable (and not a space)

NAME
isgraph - if character is printable (and not a space)

SYNOPSIS
#include <ctype.h>

int isgraph(int)

DESCRIPTION
The isgraph() function tests for any printing character except
the space character, that is, any character for which isalnum()
or ispunct() is true.

For spicification, the behavior of the isgraph() function is
affected by the current locale.

RETURN VALUE
The isgraph() function returns non-zero for true and zero for
false. If the parameter is not in the domain of the function,
the return result is undefined.

Notes
To modify the behavior, change the LC_CTYPE category in
setlocale(), that is, setlocale(LC_CTYPE, newlocale). In the C
locale or in a locale where character type information is not
defined, characters are classified according to the rules of the
ASCII 7-bit coded character set. In apeNEXT we might have a
certain logical unit for such boolean definations (ToDo!!!!!).

IMPLEMENTATION for APEnext:
done for "C" locale (noe 6/04)

Definition at line 345 of file ctype.h.

#define islower  )     ((c)>=97 && (c)<=122)
 

test if character is lowercase letter

NAME
islower - if character is lowercase letter

SYNOPSIS
#include <ctype.h>

DESCRIPTION
The islower() function tests for any character that is a
lowercase letter or is one of an implementation-defined set of
characters for which none of iscntrl(), isdigit(), ispunct(), or
isspace() is true. In the C locale, islower() returns true only
for the characters defined as lowercase letters.

Spicifically the behavior of the islower() function is affected
by the current locale.

RETURN VALUE
The islower() function returns non-zero for true and zero for
false. If the parameter is not in the domain of the function,
the return result is undefined.

Notes
To modify the behavior, change the LC_CTYPE category in
setlocale(), that is, setlocale(LC_CTYPE, newlocale). In the C
locale or in a locale where character type information is not
defined, characters are classified according to the rules of the
ASCII 7-bit coded character set.
In apeNEXT we might have a certain logical unit for such boolean
definations (ToDo!!!!!).
IMPLEMENTATION for APEnext:
done for "C" locale

Definition at line 96 of file ctype.h.

#define isprint  )     (((c)>=32 && (c)<=126) || ((c)>=161 && (c)<=254))
 

test if character is printable

NAME
isprint - if character is printable

SYNOPSIS
#include <ctype.h>

int isprint (int)

DESCRIPTION
The isprint() function tests for any printing character,
including the space character, that is, any character for which
isalnum() or ispunct() is true or the space character.

RETURN VALUE
The isprint() function returns non-zero for true and zero for
false. If the parameter is not in the domain of the function,
the return result is undefined.

Notes
To modify the behavior, change the LC_CTYPE category in
setlocale(), that is, setlocale(LC_CTYPE, newlocale). In the C
locale or in a locale where character type information is not
defined, characters are classified according to the rules of the
ASCII 7-bit coded character set.
In apeNEXT we might have a certain logical unit for such boolean
definations (ToDo!!!!!).

IMPLEMENTATION for APEnext:
done for standard locale. Assumes printable chars as in the
latin1 char set.

Definition at line 274 of file ctype.h.

#define ispunct  )     (isprint((c)) && !isalnum((c)) && !isspace((c)))
 

test if character is neither space nor alphanumeric

NAME
ispunct - if character is neither space nor alphanumeric

SYNOPSIS
#include <ctype.h>

int ispunct (int)

DESCRIPTION
The ispunct() function tests for any printing character that is
neither the space character nor a character for which isalnum()
is true.

The chatacter is an int, the value of which the application shall
ensure is a character representable as an unsigned char or equal
to the value of the macro EOF. If the argument has any other
value, the behavior is undefine

RETURN VALUE
The ispunct() function shall return non-zero if the argument is a
punctuation character; otherwise, it shall return 0

Notes
In apeNEXT we might have a certain logical unit for such boolean
definations (ToDo!!!!!).

IMPLEMENTATION for APEnext:
possible (probably not needed) (ispunct)

Definition at line 411 of file ctype.h.

#define isspace  )     ((c)==' ' || (c)=='\f' || (c)=='\n' || (c)=='\r' || (c)=='\t' || (c)=='\v')
 

test for a white-space character

NAME
isspace - test for a white-space chracter

SYNOPSIS
#include <ctype.h>

int isspace(int)

DESCRIPTION
The isspace() function tests whether the argument is a character
of class space in the program's current locale

The argument is an int, the value of which the application shall
ensure is a character representable as an unsigned char or equal
to the value of the macro EOF. If the argument has any other
value, the behavior is undefined.

RETURN VALUE
The isspace() function returns non-zero if the argument is a
white-space character; otherwise, it shall return 0.

Notes
In apeNEXT we might have a certain logical unit for such boolean
definations (ToDo!!!!!).

IMPLEMENTATION for APEnext:
possible (probably not needed) (isspace)

Definition at line 377 of file ctype.h.

#define isupper  )     ((c) >= 'A' && (c) <= 'Z')
 

test for an uppercase

NAME
isupper - test for an uppercase

SYNOPSIS
#include <ctype.h>

int isupper(int)

DESCRIPTION
The isupper() function tests whether the argument is a character
of class upper in the program's current locale

The argument is an int, the value of which the application shall
ensure is a character representable as an unsigned char or equal
to the value of the macro EOF. If the argument has any other
value, the behavior is undefined.

RETURN VALUE
The isupper() function returns non-zero if the argument is an
uppercase letter; otherwise, it shall return 0.

Notes
In apeNEXT we might have a certain logical unit for such boolean
definations (ToDo!!!!!).

IMPLEMENTATION for APEnext:
possible (not needed) (isupper)

Definition at line 59 of file ctype.h.

#define isxdigit  )     ( isdigit(c) || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F') )
 

test for a hexadecimal digit

NAME
isxdigit - test for a hexadecimal digit

SYNOPSIS
#include <ctype.h>

int isxdigit(int)

DESCRIPTION
The isxdigit() function shall test whether c is a character of
class xdigit in the program's current locale.
The argument is an int, the value of which the application shall
ensure is a character representable as an unsigned char or equal
to the value of the macro EOF. If the argument has any other
value, the behavior is undefined

RETURN VALUE
The isxdigit() function shall return non-zero if c is a
hexadecimal digit; otherwise, it shall return 0

Notes
In apeNEXT we might have a certain logical unit for such boolean
definations.

IMPLEMENTATION for APEnext:
possible (isxdigit)

Definition at line 442 of file ctype.h.


Function Documentation

int tolower int  c  ) 
 

convert uppercase letter to lowercase

NAME
tolower - convert uppercase letter to lowercase

SYNOPSIS
#include <ctype.h>

int tolower(int)

DESCRIPTION
The tolower() function converts an uppercase letter to the
corresponding lowercase letter The integer is the value of which
it is representable as an unsigned char, or the value of the
macro EO

RETURN VALUE
If the parameter is a character for which isupper() is true and
there is a corresponding character for which islower() is true,
the tolower() function returns the corresponding character.
Otherwise, the parameter is returned unchanged.

Notes
In apeNEXT we might have a certain logical unit for such boolean
definations (ToDo!!!!!).

IMPLEMENTATION for APEnext:
possible (not needed) (tolower)

int toupper int  c  )  [inline]
 

convert lowercase letter to uppercase

NAME
toupper - convert lowercase letter to uppercase
SYNOPSIS
#include <ctype.h>
int toupper(int)
DESCRIPTION
The toupper() function converts an lowercase letter to the corresponding uppercase
letter. The integer is the value of which it is representable as an unsigned char,
or the value of the macro EOF
RETURN VALUE
If the parameter is a character for which islower() is true and there is a
corresponding character for which isupper() is true, the toupper() function returns
the corresponding character. Otherwise, the parameter is returned unchanged.
Notes
In apeNEXT we might have a certain logical unit for such boolean definations.
IMPLEMENTATION for APEnext
possible (prob. not needed) (toupper)

Definition at line 512 of file ctype.h.


Generated on Fri Jul 14 10:51:38 2006 for nlibc by doxygen 1.3.5