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 isascii (int character)
 Check if character is ASCII. More...
 
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  )

◆ isascii()

static int isascii ( int  character)
inlinestatic

Check if character is ASCII.

Parameters
characterCharacter
Return values
is_asciiCharacter is an ASCII character

Definition at line 18 of file ctype.h.

18  {
19 
20  return ( character <= '\x7f' );
21 }

Referenced by parse_key().

◆ 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 29 of file ctype.h.

29  {
30 
31  return ( ( character >= '0' ) && ( character <= '9' ) );
32 }

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 40 of file ctype.h.

40  {
41 
42  return ( ( ( character >= '0' ) && ( character <= '9' ) ) ||
43  ( ( character >= 'A' ) && ( character <= 'F' ) ) ||
44  ( ( character >= 'a' ) && ( character <= 'f' ) ) );
45 }

◆ 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 53 of file ctype.h.

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

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 64 of file ctype.h.

64  {
65 
66  return ( ( character >= 'a' ) && ( character <= 'z' ) );
67 }

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 75 of file ctype.h.

75  {
76 
77  return ( isupper ( character ) || islower ( character ) );
78 }
static int islower(int character)
Check if character is a lower-case letter.
Definition: ctype.h:64
static int isupper(int character)
Check if character is an upper-case letter.
Definition: ctype.h:53

References islower(), and isupper().

Referenced by getkey(), isalnum(), key_remap(), and parse_uri().

◆ isalnum()

static int isalnum ( int  character)
inlinestatic

Check if character is alphanumeric.

Parameters
characterASCII character
Return values
is_alnumCharacter is alphanumeric

Definition at line 86 of file ctype.h.

86  {
87 
88  return ( isalpha ( character ) || isdigit ( character ) );
89 }
static int isalpha(int character)
Check if character is alphabetic.
Definition: ctype.h:75
static int isdigit(int character)
Check if character is a decimal digit.
Definition: ctype.h:29

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 97 of file ctype.h.

97  {
98 
99  return ( ( character >= ' ' ) && ( character <= '~' ) );
100 }

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 108 of file ctype.h.

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

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 120 of file ctype.h.

120  {
121 
122  return ( islower ( character ) ?
123  ( character - 'a' + 'A' ) : character );
124 }
static int islower(int character)
Check if character is a lower-case letter.
Definition: ctype.h:64

References islower().

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

◆ 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(), efi_cmdline_init(), http_parse_header(), http_token(), image_argument(), peerdist_discovery_reply_values(), pnm_ascii(), pnm_probe(), previous_word(), process_script(), script_probe(), split_command(), strtoul_pre(), and syslog_fix_name().