str.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define char_isascii(ch)   ((unsigned int)(ch) < 128u)
 check for an ASCII character
#define char_isblank(ch)   (ch == ' ' || ch == '\t')
 check for a blank character (space, horizontal tab)
#define char_iscntrl(ch)   ((unsigned int)(ch) < 32u || ch == 127)
 check for an ASCII control character
#define char_isdigit(ch)   ((unsigned int)(ch - '0') < 10u)
 check for a digit character (0-9)
#define char_isgraph(ch)   ((unsigned int)(ch - '!') < 94u)
 check for graphable characters (excluding space)
#define char_islower(ch)   ((unsigned int)(ch - 'a') < 26u)
 check for a lower-case character
#define char_isprint(ch)   ((unsigned int)(ch - ' ') < 95u)
 check for a printable character (including space)
#define char_isspace(ch)   ((unsigned int)(ch - '\t') < 5u || ch == ' ')
 check for a whitespace character (\t, \n, \v, \f, \r)
#define char_isupper(ch)   ((unsigned int)(ch - 'A') < 26u)
 check for an upper-case character
#define char_isxdigit(ch)
 check for a hexadecimal character
#define char_isalpha(ch)   (char_islower(ch) || char_isupper(ch))
 check for an upper- or lower-case character
#define char_isalnum(ch)   (char_isalpha(ch) || char_isdigit(ch))
 check for an upper-, lower-case or digit character
#define char_ispunct(ch)
 check for a punctuation character
#define char_tolower(ch)   do { if (char_isupper(ch)) ch += 32; } while(0)
 convert character to lower-case
#define char_toupper(ch)   do { if (char_islower(ch)) ch -= 32; } while(0)
 convert character to upper-case
#define CC_ALNUM   (1 << 1)
 class for alpha-numerical characters
#define CC_ALPHA   (1 << 2)
 class for upper- or lower-case characters
#define CC_ASCII   (1 << 3)
 class for ASCII characters
#define CC_BLANK   (1 << 4)
 class for blank characters
#define CC_CNTRL   (1 << 5)
 class for ASCII control characters
#define CC_DIGIT   (1 << 6)
 class for digit characters
#define CC_GRAPH   (1 << 7)
 class for graphable characters
#define CC_LOWER   (1 << 8)
 class for lower-case characters
#define CC_PRINT   (1 << 9)
 class for printable characters
#define CC_PUNCT   (1 << 10)
 class for punctuation characters
#define CC_SPACE   (1 << 11)
 class for white space characters
#define CC_UPPER   (1 << 12)
 class for upper-case characters
#define CC_XDIGIT   (1 << 13)
 class for hexadecimal characters
#define str_isempty(str)   (!str || str_check(str, CC_SPACE))
 check if string is empty
#define str_isalnum(str)   str_check(str, CC_ALNUM)
 check string for alpha-numerical characters
#define str_isalpha(str)   str_check(str, CC_ALPHA)
 check string for upper- or lower-case characters
#define str_isascii(str)   str_check(str, CC_ASCII)
 check string for ASCII characters
#define str_isdigit(str)   str_check(str, CC_DIGIT)
 check string for digit characters
#define str_isgraph(str)   str_check(str, CC_GRAPH)
 check string for graphable characters
#define str_islower(str)   str_check(str, CC_LOWER)
 check string for lower-case characters
#define str_isprint(str)   str_check(str, CC_PRINT)
 check string for printable characters
#define str_isupper(str)   str_check(str, CC_UPPER)
 check string for upper-case characters
#define str_isxdigit(str)   str_check(str, CC_XDIGIT)
 check string for hexadecimal characters

Functions

int str_check (const char *str, int allowed)
 check string against classes of allowed characters
int str_cmp (const char *str1, const char *str2)
 compare two strings
int str_cpy (char *dst, const char *src)
 copy a string
int str_cpyn (void *dst, const void *src, int n)
 copy a string
char * str_dup (const char *str)
 duplicate a string
char * str_dupn (const char *str, int n)
 duplicate a string
char * str_index (const char *str, int c, int n)
 scan string for character
int str_len (const char *str)
 calculate the length of a string
void str_zero (void *str, int n)
 write zero-valued bytes
char * str_path_concat (const char *dirname, const char *basename)
 concatenate dirname and basename
int str_path_isabs (const char *str)
 check if path is absolute and contains no dot entries or ungraphable characters
int str_path_isdot (const char *str)
 check if given path contains . or .. entries
char * str_tolower (char *str)
 convert string to lower-case
char * str_toupper (char *str)
 convert string to upper-case
int str_toumax (const char *str, unsigned long long int *val, int base, int n)
 convert string to integer


Generated on Sun Dec 3 17:46:08 2006 for lucid by  doxygen 1.5.1