This module contains several inline functions/macros for testing or manipulating character types. It is provided in PJLIB because PJLIB must not depend to LIBC.
◆ pj_hex_digits
#define pj_hex_digits "0123456789abcdef" |
Array of hex digits, in lowerspace.
◆ pj_hex_digit_to_val()
unsigned pj_hex_digit_to_val |
( |
unsigned char |
c | ) |
|
Convert hex digit c to integral value.
- Parameters
-
c | The hex digit character. |
- Returns
- The integral value between 0 and 15.
◆ pj_isalnum()
int pj_isalnum |
( |
unsigned char |
c | ) |
|
Returns a non-zero value if either isalpha or isdigit is true for c.
- Parameters
-
c | The integer character to test. |
- Returns
- Non-zero value if either isalpha or isdigit is true for c.
◆ pj_isalpha()
int pj_isalpha |
( |
unsigned char |
c | ) |
|
Returns a non-zero value if c is a particular representation of an alphabetic character.
- Parameters
-
c | The integer character to test. |
- Returns
- Non-zero value if c is a particular representation of an alphabetic character.
◆ pj_isascii()
int pj_isascii |
( |
unsigned char |
c | ) |
|
Returns a non-zero value if c is a particular representation of an ASCII character.
- Parameters
-
c | The integer character to test. |
- Returns
- Non-zero value if c is a particular representation of an ASCII character.
◆ pj_isblank()
int pj_isblank |
( |
unsigned char |
c | ) |
|
Returns a non-zero value if c is a either a space (' ') or horizontal tab ('\t') character.
- Parameters
-
c | The integer character to test. |
- Returns
- Non-zero value if c is a either a space (' ') or horizontal tab ('\t') character.
◆ pj_isdigit()
int pj_isdigit |
( |
unsigned char |
c | ) |
|
Returns a non-zero value if c is a particular representation of a decimal-digit character.
- Parameters
-
c | The integer character to test. |
- Returns
- Non-zero value if c is a particular representation of a decimal-digit character.
◆ pj_islower()
int pj_islower |
( |
unsigned char |
c | ) |
|
Returns a non-zero value if c is a particular representation of a lowercase character.
- Parameters
-
c | The integer character to test. |
- Returns
- Non-zero value if c is a particular representation of a lowercase character.
◆ pj_isspace()
int pj_isspace |
( |
unsigned char |
c | ) |
|
Returns a non-zero value if c is a particular representation of a space character (0x09 - 0x0D or 0x20).
- Parameters
-
c | The integer character to test. |
- Returns
- Non-zero value if c is a particular representation of a space character (0x09 - 0x0D or 0x20).
◆ pj_isupper()
int pj_isupper |
( |
unsigned char |
c | ) |
|
Returns a non-zero value if c is a particular representation of a uppercase character.
- Parameters
-
c | The integer character to test. |
- Returns
- Non-zero value if c is a particular representation of a uppercase character.
◆ pj_isxdigit()
int pj_isxdigit |
( |
unsigned char |
c | ) |
|
Returns a non-zero value if c is a particular representation of an hexadecimal digit character.
- Parameters
-
c | The integer character to test. |
- Returns
- Non-zero value if c is a particular representation of an hexadecimal digit character.
◆ pj_tolower()
int pj_tolower |
( |
unsigned char |
c | ) |
|
Converts character to lowercase.
- Parameters
-
c | The integer character to convert. |
- Returns
- Lowercase character of c.
◆ pj_toupper()
int pj_toupper |
( |
unsigned char |
c | ) |
|
Converts character to uppercase.
- Parameters
-
c | The integer character to convert. |
- Returns
- Uppercase character of c.
◆ pj_val_to_hex_digit()
void pj_val_to_hex_digit |
( |
unsigned |
value, |
|
|
char * |
p |
|
) |
| |
Convert a value to hex representation.
- Parameters
-
value | Integral value to convert. |
p | Buffer to hold the hex representation, which must be at least two bytes length. |
References pj_hex_digits.