#include <stdlib.h>
#include <string.h>
Go to the source code of this file.
Defines | |
#define | M_EXTERN extern |
String management library. | |
Functions | |
M_EXTERN int | is_empty_str (const char *str) |
Check for a null or spaced string. | |
M_EXTERN char * | clone_str (const char *str) |
Duplicate a string. | |
M_EXTERN char * | toupper_str (const char *str) |
Duplicate a string converting all chars to upper-case. | |
M_EXTERN char * | tolower_str (const char *str) |
Duplicate a string converting all chars to lower-case. | |
M_EXTERN char * | bin2hex (const unsigned char *binstr, const int len) |
Convert a byte array into a colon-separated hexadecimal sequence. | |
M_EXTERN unsigned char * | hex2bin (const char *hexstr) |
Convert a colon-separated hexadecimal data into a byte array. | |
M_EXTERN unsigned char * | hex2bin_static (const char *hexstr, unsigned char **res, int *size) |
Convert a colon-separated hexadecimal data into a byte array, store result into a previously allocated space. | |
M_EXTERN char ** | split (const char *str, char sep, int nelems) |
Splits a string to an array of nelems by using sep as character separator. | |
M_EXTERN char ** | split_static (const char *str, char sep, int nelems, char *dst) |
Splits a string to an array of nelems by using sep as character separator, using dest as pre-allocated destination memory for the resulting array. | |
M_EXTERN char * | trim (const char *str) |
Remove all extra spaces from a string. |
|
String management library.
|
|
Convert a byte array into a colon-separated hexadecimal sequence.
|
|
Duplicate a string.
|
|
Convert a colon-separated hexadecimal data into a byte array.
|
|
Convert a colon-separated hexadecimal data into a byte array, store result into a previously allocated space.
|
|
Check for a null or spaced string.
|
|
Splits a string to an array of nelems by using sep as character separator. To free() memory used by this call, call free(res[0]); free(res);
|
|
Splits a string to an array of nelems by using sep as character separator, using dest as pre-allocated destination memory for the resulting array. To free() memory used by this call, just call free result pointer
|
|
Duplicate a string converting all chars to lower-case.
|
|
Duplicate a string converting all chars to upper-case.
|
|
Remove all extra spaces from a string. a char is considered space if trues isspace()
|