iPXE
Functions
ctype.h File Reference

Character types. More...

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 
static int isdigit (int character)
 Check if character is a decimal digit. More...
 
static int isxdigit (int character)
 Check if character is a hexadecimal digit. More...
 
static int isupper (int character)
 Check if character is an upper-case letter. More...
 
static int islower (int character)
 Check if character is a lower-case letter. More...
 
static int isalpha (int character)
 Check if character is alphabetic. More...
 
static int isalnum (int character)
 Check if character is alphanumeric. More...
 
static int isprint (int character)
 Check if character is printable. More...
 
static int tolower (int character)
 Convert character to lower case. More...
 
static int toupper (int character)
 Convert character to upper case. More...
 
int isspace (int character)
 Check to see if character is a space. More...
 

Detailed Description

Character types.

Definition in file ctype.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ isdigit()

static int isdigit ( int  character)
inlinestatic

Check if character is a decimal digit.

Parameters
characterASCII character
Return values
is_digitCharacter is a decimal digit

Definition at line 18 of file ctype.h.

18  {
19 
20  return ( ( character >= '0' ) && ( character <= '9' ) );
21 }

Referenced by asn1_generalized_time(), gdbstub_from_hex_digit(), getkey(), isalnum(), and pnm_probe().

◆ isxdigit()

static int isxdigit ( int  character)
inlinestatic

Check if character is a hexadecimal digit.

Parameters
characterASCII character
Return values
is_xdigitCharacter is a hexadecimal digit

Definition at line 29 of file ctype.h.

29  {
30 
31  return ( ( ( character >= '0' ) && ( character <= '9' ) ) ||
32  ( ( character >= 'A' ) && ( character <= 'F' ) ) ||
33  ( ( character >= 'a' ) && ( character <= 'f' ) ) );
34 }

◆ isupper()

static int isupper ( int  character)
inlinestatic

Check if character is an upper-case letter.

Parameters
characterASCII character
Return values
is_upperCharacter is an upper-case letter

Definition at line 42 of file ctype.h.

42  {
43 
44  return ( ( character >= 'A' ) && ( character <= 'Z' ) );
45 }

Referenced by isalpha(), and tolower().

◆ islower()

static int islower ( int  character)
inlinestatic

Check if character is a lower-case letter.

Parameters
characterASCII character
Return values
is_lowerCharacter is a lower-case letter

Definition at line 53 of file ctype.h.

53  {
54 
55  return ( ( character >= 'a' ) && ( character <= 'z' ) );
56 }

Referenced by isalpha(), and toupper().

◆ isalpha()

static int isalpha ( int  character)
inlinestatic

Check if character is alphabetic.

Parameters
characterASCII character
Return values
is_alphaCharacter is alphabetic

Definition at line 64 of file ctype.h.

64  {
65 
66  return ( isupper ( character ) || islower ( character ) );
67 }
static int islower(int character)
Check if character is a lower-case letter.
Definition: ctype.h:53
static int isupper(int character)
Check if character is an upper-case letter.
Definition: ctype.h:42

References islower(), and isupper().

Referenced by getkey(), and isalnum().

◆ isalnum()

static int isalnum ( int  character)
inlinestatic

Check if character is alphanumeric.

Parameters
characterASCII character
Return values
is_alnumCharacter is alphanumeric

Definition at line 75 of file ctype.h.

75  {
76 
77  return ( isalpha ( character ) || isdigit ( character ) );
78 }
static int isalpha(int character)
Check if character is alphabetic.
Definition: ctype.h:64
static int isdigit(int character)
Check if character is a decimal digit.
Definition: ctype.h:18

References isalpha(), and isdigit().

◆ isprint()

static int isprint ( int  character)
inlinestatic

Check if character is printable.

Parameters
characterASCII character
Return values
is_printCharacter is printable

Definition at line 86 of file ctype.h.

86  {
87 
88  return ( ( character >= ' ' ) && ( character <= '~' ) );
89 }

Referenced by dbg_hex_dump_da_row(), deflate_inflate(), efifb_glyphs(), ftp_check_string(), syslog_fix_name(), and uri_character_escaped().

◆ tolower()

static int tolower ( int  character)
inlinestatic

Convert character to lower case.

Parameters
characterCharacter
characterLower-case character

Definition at line 97 of file ctype.h.

97  {
98 
99  return ( isupper ( character ) ?
100  ( character - 'A' + 'a' ) : character );
101 }
static int isupper(int character)
Check if character is an upper-case letter.
Definition: ctype.h:42

References isupper().

Referenced by dns_compare(), gdbstub_from_hex_digit(), and iscsi_large_binary_decode().

◆ toupper()

static int toupper ( int  character)
inlinestatic

Convert character to upper case.

Parameters
characterCharacter
characterUpper-case character

Definition at line 109 of file ctype.h.

109  {
110 
111  return ( islower ( character ) ?
112  ( character - 'a' + 'A' ) : character );
113 }
static int islower(int character)
Check if character is a lower-case letter.
Definition: ctype.h:53

References islower().

Referenced by getkey(), ntlm_key(), peerdisc_open(), pxe_menu_select(), and strcasecmp().

◆ isspace()

int isspace ( int  character)

Check to see if character is a space.

Parameters
characterCharacter
Return values
isspaceCharacter is a space

Definition at line 41 of file ctype.c.

41  {
42 
43  switch ( character ) {
44  case ' ' :
45  case '\f' :
46  case '\n' :
47  case '\r' :
48  case '\t' :
49  case '\v' :
50  return 1;
51  default:
52  return 0;
53  }
54 }

Referenced by base64_decode(), cmdline_init(), http_parse_header(), http_token(), peerdist_discovery_reply_values(), pnm_ascii(), pnm_probe(), previous_word(), process_script(), script_probe(), split_command(), strtoul_pre(), and syslog_fix_name().