iPXE
Functions
string.h File Reference

String functions. More...

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 
 FILE_SECBOOT (PERMITTED)
 
unsigned int digit_value (unsigned int digit)
 Calculate digit value. More...
 

Detailed Description

String functions.

Definition in file string.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ FILE_SECBOOT()

FILE_SECBOOT ( PERMITTED  )

◆ digit_value()

unsigned int digit_value ( unsigned int  character)

Calculate digit value.

Parameters
characterDigit character
Return values
digitDigit value

Invalid digits will be returned as a value greater than or equal to the numeric base.

Definition at line 427 of file string.c.

427  {
428 
429  if ( character >= 'a' )
430  return ( character - ( 'a' - 10 ) );
431  if ( character >= 'A' )
432  return ( character - ( 'A' - 10 ) );
433  if ( character <= '9' )
434  return ( character - '0' );
435  return character;
436 }

Referenced by hex_decode(), string_test_exec(), strtoul(), and strtoull().