|
Files |
file | otString.h |
| String Library.
|
Modules |
| Version History |
Defines |
#define | __isalpha(c) (c >'9') |
#define | __isspace(c) ((c)==' ' || (c)=='\f' || (c)=='\n' || (c)=='\r' || (c)=='\t' || (c)=='\v') |
#define | __isupper(c) !(c & 0x20) |
#define | __ishex(c) (((c >= '0')&&(c <= '9'))||((c >= 'A')&&(c <= 'F'))) |
#define | __ascii2hex(c) ((c <= '9')? c-'0': c-'A'+10) |
| Convert an hex decimal digit in binary.
|
#define | __isdigit(c) ((c)>='0' && (c)<='9') |
#define | __isblank(c) ((c)==' ' || (c)=='\t') |
#define | __isprint(c) (((c)>=32 && (c)<=126) || ((c)>=161 && (c)<=254)) |
#define | __isalnum(c) |
| Check if character is alphanumeric.
|
Functions |
void | _qsort (void *base, U32 num, U32 size, int(*compar)(const void *, const void *)) |
| Sort elements of array Sorts the num elements of the array pointed to by base, each element size bytes long, using the compar function to determine the order. The sorting algorithm used by this function compares pairs of elements by calling the specified compar function with pointers to them as argument. The function does not return any value, but modifies the content of the array pointed to by base reordering its elements as defined by compar. The order of equivalent elements is undefined.
|
S32 | _strtol (const char *str, char **endptr, int base) |
| Convert string to long integer Parses the C-string str interpreting its content as an integral number of the specified base, which is returned as a long int value. If endptr is not a null pointer, the function also sets the value of endptr to point to the first character after the number. The function first discards as many whitespace characters as necessary until the first non-whitespace character is found. Then, starting from this character, takes as many characters as possible that are valid following a syntax that depends on the base parameter, and interprets them as a numerical value. Finally, a pointer to the first character following the integer representation in str is stored in the object pointed by endptr. If the value of base is zero, the syntax expected is similar to that of integer constants, which is formed by a succession of: An optional sign character (+ or -) An optional prefix indicating octal or hexadecimal base ("0" or "0x"/"0X" respectively) A sequence of decimal digits (if no base prefix was specified) or either octal or hexadecimal digits if a specific prefix is present If the base value is between 2 and 36, the format expected for the integral number is a succession of any of the valid digits and/or letters needed to represent integers of the specified radix (starting from '0' and up to 'z'/'Z' for radix 36). The sequence may optionally be preceded by a sign (either + or -) and, if base is 16, an optional "0x" or "0X" prefix. If the first sequence of non-whitespace characters in str is not a valid integral number as defined above, or if no such sequence exists because either str is empty or it contains only whitespace characters, no conversion is performed. For locales other than the "C" locale, additional subject sequence forms may be accepted.
|
U32 | _strtoul (const char *str, char **endptr, int base) |
| Convert string to unsigned long integer Parses the C-string str, interpreting its content as an integral number of the specified base, which is returned as an value of type unsigned long int. This function operates like strtol to interpret the string, but produces numbers of type unsigned long int (see strtol for details on the interpretation process).
|
S64 | strtoll (const char *str, char **endptr, int base) |
| Convert string to long long integer Parses the C-string str interpreting its content as an integral number of the specified base, which is returned as a value of type long long int. If endptr is not a null pointer, the function also sets the value of endptr to point to the first character after the number.
|
U64 | strtoull (const char *str, char **endptr, int base) |
| Convert string to unsigned long long integer Parses the C-string str interpreting its content as an integral number of the specified base, which is returned as a value of type unsigned long long int. If endptr is not a null pointer, the function also sets the value of endptr to point to the first character after the number.
|
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.
|
int | _toupper (int c) |
| 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.
|
unsigned int | _strlen (const 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).
|
unsigned | dbl2stri (char *outbfr, double dbl, unsigned dec_digits) |
| Convert a double to a C string.
|
int | _atoi (const char *pString) |
| Convert string to integer. Number starting with 0x or 0X are allowed and converted as hex decimal number.
|
long | _atol (const char *nptr) |
char * | _strcat (char *destination, const char *source) |
| Concatenate strings. Appends a copy of the source string to the destination string. The terminating null character in destination is overwritten by the first character of source, and a null-character is included at the end of the new string formed by the concatenation of both in destination. destination and source shall not overlap.
|
char * | _strstr (char *str1, char *str2) |
| Locate substring. Returns a pointer to the first occurrence of str2 in str1, or a null pointer if str2 is not part of str1. The matching process does not include the terminating null-characters, but it stops there.
|
char * | _strtok (char *str, const char *delimiters) |
| Split string into tokens. A sequence of calls to this function split str into tokens, which are sequences of contiguous characters separated by any of the characters that are part of delimiters. On a first call, the function expects a C string as argument for str, whose first character is used as the starting location to scan for tokens. In subsequent calls, the function expects a null pointer and uses the position right after the end of the last token as the new starting location for scanning. To determine the beginning and the end of a token, the function first scans from the starting location for the first character not contained in delimiters (which becomes the beginning of the token). And then scans starting from this beginning of the token for the first character contained in delimiters, which becomes the end of the token. The scan also stops if the terminating null character is found. This end of the token is automatically replaced by a null-character, and the beginning of the token is returned by the function. Once the terminating null character of str is found in a call to strtok, all subsequent calls to this function (with a null pointer as the first argument) return a null pointer. The point where the last token was found is kept internally by the function to be used on the next call (particular library implementations are not required to avoid data races).
|
void | _strchop (char *str1) |
| Remove last character.
|
char | _strlastchar (const char *str1) |
| Return last character of a string.
|
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.
|
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.
|
const char * | _strchr (const char *str, char character) |
| Locate first occurrence of character in string.
|
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.
|
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).
|
void | _reverse (char *str) |
| Reverse the order of stored characters.
|
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.
|
void | _str_leftShift (char *string, int index) |
| Left shift a string starting from index.
|
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.
|
void | _str_toupper (char *text) |
| Convert the string to upper case.
|
void | _str_tolower (char *text) |
| Convert the string to lower case.
|
const char * | _str_field (const char *string, int field) |
| Return nth string field of a string list.
|
void | _replace (char *str, char oldChar, char newChar) |
| Replace a character in a string.
|
int | _strEndsWith (const char *src, const char *txt) |
| Check if a string ends with a specified string.
|
char | _byteHex (U8 val) |
| Convert a binary number (nibble) into an ASCII character. Example: 00001100 -> 01000011 or in C language 0x0C -> 'C'.
|
void | _binHex (U8 *buf, U8 v) |
| Convert a byte in two ASCII characters. Example: 0x3C -> '3C'.
|
void | _binHex16 (U8 *buf, U32 v) |
| Convert a word in four ASCII characters. Example: 0x3CFF -> '3CFF'.
|
void | _binHex32 (U8 *buf, U32 v) |
| Convert a double word in eight ASCII characters. Example: 0x12343CFF -> '12343CFF'.
|
U8 | _asciiToBin (U8 ch) |
| Converts a hexadecimal number (one digits), encoded in ASCII, to binary. Example: 'F' -> 0x0F.
|
U8 | _hexBin (const U8 *str) |
| Converts a hexadecimal number (two digits), encoded in ASCII, to binary. Example: 'FF' -> 0xFF.
|
U16 | _hexBin16 (const U8 *str) |
| Converts a hexadecimal number (four digits), encoded in ASCII, to binary. Example: 'FFEE' -> 0xFFEE.
|
U32 | _hexBin32 (const U8 *str) |
| Converts a hexadecimal number (eight digits), encoded in ASCII, to binary. Example: 'FFEE1234' -> 0xFFEE1234.
|
double | _atof (const char *str) |
| Parses the C string str, interpreting its content as a floating point number and returns its value as a double.
|
double | __atof (const char *s, char **es, bool *done) |
| Parses the C string str, interpreting its content as a floating point number and returns its value as a double.
|