Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

String library

Defines

Functions


Define Documentation

#define __ascii2hex  )     ((c <= '9')? c-'0': c-'A'+10)
 

Convert an hex decimal digit in binary.

#define __isalpha  )     (c >'9')
 

Check if character is alphabetic.

Return a value different from zero if indeed c is an alphabetic letter. Zero (i.e., false) otherwise.

#define __isblank  )     ((c)==' ' || (c)=='\t')
 

Checks whether c is a blank character.

A blank character is a space character used to separate words within a line of text. The standard "C" locale considers blank characters the tab character ('\t') and the space character (' ').

#define __isdigit  )     ((c)>='0' && (c)<='9')
 

Checks whether c is a decimal digit character.

Decimal digits are any of: 0 1 2 3 4 5 6 7 8 9

#define __ishex  )     (((c >= '0')&&(c <= '9'))||((c >= 'A')&&(c <= 'F')))
 

Checks whether c is a hexdecimal digit character.
Hexadecimal digits are any of: 0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F.

#define __isprint  )     (((c)>=32 && (c)<=126) || ((c)>=161 && (c)<=254))
 

Checks whether c is a printable character.

A printable character is a character that occupies a printing position on a display. For the standard ASCII character set (used by the "C" locale), printing characters are all with an ASCII code greater than 0x1f (US), except 0x7f (DEL).

#define __isspace  )     ((c)==' ' || (c)=='\f' || (c)=='\n' || (c)=='\r' || (c)=='\t' || (c)=='\v')
 

Check if character is a white-space.

For the "C" locale, white-space characters are any of: (0x20) space (SPC), (0x09) horizontal tab (TAB), (0x0a) newline (LF), (0x0b) vertical tab (VT), (0x0c) feed (FF), (0x0d) carriage return (CR)

#define __isupper  )     !(c & 0x20)
 

Checks if parameter c is an uppercase alphabetic letter.

Notice that what is considered a letter may depend on the locale being used;
In the default "C" locale, an uppercase letter is any of: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z.


Function Documentation

int _atoi char *  pString  ) 
 

Convert string to integer. Number starting with 0x or 0X or ending with H or H are allowed and converted as hex decimal number.

Parameters:
pString C-string beginning with the representation of an integral number.
Returns:
On success, the function returns the converted integral number as an int value.

int _htoi const char *  pString  ) 
 

Convert hex string to integer.

Parameters:
pString C-string beginning with the representation of an hexdecimal integral number.
Returns:
On success, the function returns the converted integral number as an int value.

void _reverse char *  str  ) 
 

Reverse the order of stored characters.

Parameters:
str C string.
Returns:
str contains the reversed string.

const char * _str_field const char *  string,
int  field
 

Return nth string field of a string list.

Parameters:
string C string list (multiple concatenated C strings)
field Index of requested field
Returns:
Requested field

void _str_leftShift char *  string,
int  index
 

Left shift a string starting from index.

Parameters:
string C string
index Starting point for left shift

void _str_simplified char *  string  ) 
 

Returns a string that has whitespace removed from the start and the end, and that has each sequence of internal whitespace replaced with a single space.

Parameters:
string C string

unsigned _str_split char *  string,
char  charSep,
int  maxArgs,
char *  argv
 

Splits the string into substrings wherever charSep occurs, and returns the list of those strings. If charSep does not match anywhere in the string, _str_split() returns a single-element list containing this string. The output is a sequence of string separated by 0. Use _str_field the get selected field.

Parameters:
string C string.
charSep Character separator
Argv Output array, where will be loaded splitted string
maxArgs Maximum number of output string
Returns:
Number of found string.
See also:
_str_field

void _strchop char *  s1  ) 
 

Remove last character.

Parameters:
str1 C string to be truncated.

const char * _strchr const char *  str,
char  character
 

Locate first occurrence of character in string.

Parameters:
str C string.
character Character to be located. It is passed as its int promotion, but it is internally converted back to char for the comparison.
Returns:
A pointer to the first occurrence of character in str.

int _strcmp const char *  str1,
const char *  str2
 

Compare two strings. Compares the C string str1 to the C string str2. This function starts comparing the first character of each string. If they are equal to each other, it continues with the following pairs until the characters differ or until a terminating null-character is reached. This function performs a binary comparison of the characters.

Parameters:
str1 C string to be compared.
str2 C string to be compared.
Returns:
Returns an integral value indicating the relationship between the strings:
<0 the first character that does not match has a lower value in ptr1 than in ptr2
0 the contents of both strings are equal
>0 the first character that does not match has a greater value in ptr1 than in ptr2

char * _strcpy char *  destination,
const char *  source
 

Copy string. Copies the C string pointed by source into the array pointed by destination, including the terminating null character (and stopping at that point). To avoid overflows, the size of the array pointed by destination shall be long enough to contain the same C string as source (including the terminating null character), and should not overlap in memory with source.

Parameters:
destination Pointer to the destination array where the content is to be copied.
source C string to be copied.
Returns:
destination is returned.

char _strlastchar const char *  str1  ) 
 

Return last character of a string.

Parameters:
str1 C string to be analyzed.
Returns:
Return last character of a string.

unsigned int _strlen char *  str  ) 
 

Get string length. The length of a C string is determined by the terminating null-character:
A C string is as long as the number of characters between the beginning of the string and the terminating null character (without including the terminating null character itself).

Parameters:
str C string.
Returns:
Returns the length of the C string str.

int _strncmp const char *  str1,
const char *  str2,
int  num
 

Compare characters of two strings. Compares up to num characters of the C string str1 to those of the C string str2. This function starts comparing the first character of each string. If they are equal to each other, it continues with the following pairs until the characters differ, until a terminating null-character is reached, or until num characters match in both strings, whichever happens first.

Parameters:
str1 C string to be compared.
str2 C string to be compared.
num Maximum number of characters to compare.
Returns:
Returns an integral value indicating the relationship between the strings:
<0 the first character that does not match has a lower value in ptr1 than in ptr2
0 the contents of both strings are equal
>0 the first character that does not match has a greater value in ptr1 than in ptr2

char * _strncpy char *  destination,
const char *  source,
int  num
 

Copy characters from string. Copies the first num characters of source to destination. If the end of the source C string (which is signaled by a null-character) is found before num characters have been copied, destination is padded with zeros until a total of num characters have been written to it. No null-character is implicitly appended at the end of destination if source is longer than num. Thus, in this case, destination shall not be considered a null terminated C string (reading it as such would overflow).

Parameters:
destination Pointer to the destination array where the content is to be copied.
source C string to be copied.
num Maximum number of characters to be copied from source.
Returns:
A pointer to the first occurrence of character in str.

int _tolower int  c  ) 
 

Convert uppercase letter to lowercase. Converts c to its lowercase equivalent if c is an uppercase letter and has a lowercase equivalent. If no such conversion is possible, the value returned is c unchanged. Notice that what is considered a letter may depend on the locale being used; In the default "C" locale, an uppercase letter is any of:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
which translate respectively to:
a b c d e f g h i j k l m n o p q r s t u v w x y z.

Parameters:
c Character to be converted, casted to an int, or EOF.
Returns:
The lowercase equivalent to c, if such value exists, or c (unchanged) otherwise. The value is returned as an int value that can be implicitly casted to char.
See also:
_toupper

int _toupper int  c  )  [inline]
 

Convert lowercase letter to uppercase. Converts c to its lowercase equivalent if c is an uppercase letter and has a lowercase equivalent. If no such conversion is possible, the value returned is c unchanged. Notice that what is considered a letter may depend on the locale being used; In the default "C" locale, an lowercase letter is any of:
a b c d e f g h i j k l m n o p q r s t u v w x y z
which translate respectively to:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z.

Parameters:
c Character to be converted, casted to an int, or EOF.
Returns:
The uppercase equivalent to c, if such value exists, or c (unchanged) otherwise. The value is returned as an int value that can be implicitly casted to char.
See also:
_toupper

unsigned dbl2stri char *  outbfr,
double  dbl,
unsigned  dec_digits
 

Convert a double to a C string.

Parameters:
outbfr Pointer to the output buffer.
dbl Double to be convert.
dec_digits Number of decimal digits.
Returns:
Returns the string length.


Generated on Tue Apr 7 20:07:44 2015 for BF592A Library by doxygen 1.3.1