BLOG | DOCUMENTATION | TRAC

Home --> Documentations --> PJLIB Reference

ctype - Character Type

Macros

#define pj_hex_digits   "0123456789abcdef"
 

Functions

int pj_isalnum (unsigned char c)
 
int pj_isalpha (unsigned char c)
 
int pj_isascii (unsigned char c)
 
int pj_isdigit (unsigned char c)
 
int pj_isspace (unsigned char c)
 
int pj_islower (unsigned char c)
 
int pj_isupper (unsigned char c)
 
int pj_isblank (unsigned char c)
 
int pj_tolower (unsigned char c)
 
int pj_toupper (unsigned char c)
 
int pj_isxdigit (unsigned char c)
 
void pj_val_to_hex_digit (unsigned value, char *p)
 
unsigned pj_hex_digit_to_val (unsigned char c)
 

Detailed Description

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.

Macro Definition Documentation

◆ pj_hex_digits

#define pj_hex_digits   "0123456789abcdef"

Array of hex digits, in lowerspace.

Referenced by pj_val_to_hex_digit().

Function Documentation

◆ pj_hex_digit_to_val()

unsigned pj_hex_digit_to_val ( unsigned char  c)

Convert hex digit c to integral value.

Parameters
cThe hex digit character.
Returns
The integral value between 0 and 15.

References PJ_END_DECL.

◆ pj_isalnum()

int pj_isalnum ( unsigned char  c)

Returns a non-zero value if either isalpha or isdigit is true for c.

Parameters
cThe 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
cThe 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
cThe 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
cThe 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
cThe 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
cThe 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
cThe 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
cThe 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
cThe 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
cThe integer character to convert.
Returns
Lowercase character of c.

◆ pj_toupper()

int pj_toupper ( unsigned char  c)

Converts character to uppercase.

Parameters
cThe 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
valueIntegral value to convert.
pBuffer to hold the hex representation, which must be at least two bytes length.

References pj_hex_digits.

 


PJLIB Open Source, high performance, small footprint, and very very portable framework
Copyright (C) 2006-2009 Teluu Inc.