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.
static int isxdigit (int character)
 Check if character is a hexadecimal digit.
static int isupper (int character)
 Check if character is an upper-case letter.
static int islower (int character)
 Check if character is a lower-case letter.
static int isalpha (int character)
 Check if character is alphabetic.
static int isalnum (int character)
 Check if character is alphanumeric.
static int isprint (int character)
 Check if character is printable.
static int tolower (int character)
 Convert character to lower case.
static int toupper (int character)
 Convert character to upper case.
int isspace (int character)
 Check to see if character is a space.

Detailed Description

Character types.

Definition in file ctype.h.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )
static int isdigit ( int  character) [inline, static]

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.

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

                                            {

        return ( ( character >= '0' ) && ( character <= '9' ) );
}
static int isxdigit ( int  character) [inline, static]

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.

                                             {

        return ( ( ( character >= '0' ) && ( character <= '9' ) ) ||
                 ( ( character >= 'A' ) && ( character <= 'F' ) ) ||
                 ( ( character >= 'a' ) && ( character <= 'f' ) ) );
}
static int isupper ( int  character) [inline, static]

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.

Referenced by isalpha(), and tolower().

                                            {

        return ( ( character >= 'A' ) && ( character <= 'Z' ) );
}
static int islower ( int  character) [inline, static]

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.

Referenced by isalpha(), and toupper().

                                            {

        return ( ( character >= 'a' ) && ( character <= 'z' ) );
}
static int isalpha ( int  character) [inline, static]

Check if character is alphabetic.

Parameters:
characterASCII character
Return values:
is_alphaCharacter is alphabetic

Definition at line 64 of file ctype.h.

References islower(), and isupper().

Referenced by getkey(), and isalnum().

                                            {

        return ( isupper ( character ) || islower ( character ) );
}
static int isalnum ( int  character) [inline, static]

Check if character is alphanumeric.

Parameters:
characterASCII character
Return values:
is_alnumCharacter is alphanumeric

Definition at line 75 of file ctype.h.

References isalpha(), and isdigit().

                                            {

        return ( isalpha ( character ) || isdigit ( character ) );
}
static int isprint ( int  character) [inline, static]

Check if character is printable.

Parameters:
characterASCII character
Return values:
is_printCharacter is printable

Definition at line 86 of file ctype.h.

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

                                            {

        return ( ( character >= ' ' ) && ( character <= '~' ) );
}
static int tolower ( int  character) [inline, static]

Convert character to lower case.

Parameters:
characterCharacter
characterLower-case character

Definition at line 97 of file ctype.h.

References isupper().

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

                                            {

        return ( isupper ( character ) ?
                 ( character - 'A' + 'a' ) : character );
}
static int toupper ( int  character) [inline, static]

Convert character to upper case.

Parameters:
characterCharacter
characterUpper-case character

Definition at line 109 of file ctype.h.

References islower().

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

                                            {

        return ( islower ( character ) ?
                 ( character - 'a' + 'A' ) : character );
}
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.

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().

                              {

        switch ( character ) {
        case ' ' :
        case '\f' :
        case '\n' :
        case '\r' :
        case '\t' :
        case '\v' :
                return 1;
        default:
                return 0;
        }
}