Go to the source code of this file.
Data Structures | |
| struct | fields |
| When a string is cut into fields, the fields are saved into a 'fields' structure. More... | |
Defines | |
| #define | INITIAL_NUMBER_OF_FIELD 10 |
| This defines the minimum number of fields to allocate. 10 should ne enough. | |
| #define | STRINGS_UTILS_HPP |
Functions | |
| char * | make_one_line (char *st) |
| Replace all series of ' ' by one ';' and all series of spaces by one space. | |
| int | s_split (char *st, char *delimitor, struct fields *f) |
| Split a string into fields. | |
| int | s_split_exact (char *st, char *delimitor, struct fields *f) |
| Split a string into fields. | |
| void | free_fields (struct fields *fd) |
| Free allocated memory used to put fields extracted from a string of characters. | |
| char * | get_end_of_string (char *src, char *dst, int nbcar) |
| Extract everything between the string " = " and the end of the string. | |
| char * | IP2hex (char *src, char *dst, int nbcar) |
| Transform a IP address "XXX.XXX.XXX.XXX" into a hexadecimal representation "HHHHHHHH". | |
| char * | post_chop (char *src) |
| Delete spaces (or tabulations) at the end of a string. | |
| char * | pre_chop (char *src) |
| Delete spaces (or tabulations) at the begining of a string. | |
| char * | chop (char *src) |
| Delete spaces (or tabulations) at the begining and at the end of a string. | |
| char * | add_comment (char *src, char **dst) |
| Replace all charater 'new line' (that is ' '), by the sequence ' #'. | |
| char * | get_config_value (char *buffer, char *delim) |
| Extract a field's value from a configuration file. | |
| char * | replace_tag_by_integer (char *src, char *tag, int value) |
| Replace a tag by an integer in a string. | |
| unsigned int | string2unsigned_int (char *st, int *error) |
| Convert a string of characters into an 'unsigned int'. | |
| int | string2int (char *st, int *error) |
| Convert a string of characters into an 'int'. | |
| time_t | string2time_t (char *st, int *error) |
| Convert a string of characters into a 'time_t'. | |
| int | is_integer (char *st) |
| Test if a string of characters represents an interger. | |
| int | is_hexa (char *st) |
| Test if a string of characters represents a hexadecimal. | |
| int | is_ip_address (char *st) |
| Test if a string of characters represents an IP address. | |
| int | ip_address_to_num (char *st, unsigned char *num) |
| Convert an IPV4 address to its numerical equivalent. | |
Definition in file strings_utils.h.
|
||||||||||||
|
Replace all charater 'new line' (that is '
Definition at line 488 of file strings_utils.c. |
|
|
Delete spaces (or tabulations) at the begining and at the end of a string.
Definition at line 473 of file strings_utils.c. References post_chop(), and pre_chop(). Referenced by get_config_value(). |
|
|
Free allocated memory used to put fields extracted from a string of characters.
Definition at line 317 of file strings_utils.c. References fields::number_of_fields, fields::size, and fields::tabs. Referenced by date2timestamp(), IP2hex(), ip_address_to_num(), and is_ip_address(). |
|
||||||||||||
|
Extract a field's value from a configuration file.
Definition at line 532 of file strings_utils.c. References chop(). |
|
||||||||||||||||
|
Extract everything between the string " = " and the end of the string.
Definition at line 335 of file strings_utils.c. |
|
||||||||||||||||
|
Transform a IP address "XXX.XXX.XXX.XXX" into a hexadecimal representation "HHHHHHHH".
Definition at line 365 of file strings_utils.c. References bin2hex_hexa, free_fields(), s_split(), and fields::tabs. |
|
||||||||||||
|
Convert an IPV4 address to its numerical equivalent.
Definition at line 825 of file strings_utils.c. References free_fields(), is_ip_address(), fields::number_of_fields, s_split(), and fields::tabs. |
|
|
Test if a string of characters represents a hexadecimal.
Definition at line 737 of file strings_utils.c. References char2hex. |
|
|
Test if a string of characters represents an interger.
Definition at line 710 of file strings_utils.c. References char2int. |
|
|
Test if a string of characters represents an IP address.
Definition at line 765 of file strings_utils.c. References free_fields(), fields::number_of_fields, s_split(), string2int(), and fields::tabs. Referenced by ip_address_to_num(). |
|
|
Replace all series of '
Definition at line 19 of file strings_utils.c. |
|
|
Delete spaces (or tabulations) at the end of a string.
Definition at line 414 of file strings_utils.c. Referenced by chop(). |
|
|
Delete spaces (or tabulations) at the begining of a string.
Definition at line 437 of file strings_utils.c. Referenced by chop(). |
|
||||||||||||||||
|
Replace a tag by an integer in a string.
Definition at line 564 of file strings_utils.c. References INTEGER_STR_MAX_SIZE. |
|
||||||||||||||||
|
Split a string into fields.
Definition at line 94 of file strings_utils.c. References INITIAL_NUMBER_OF_FIELD, fields::number_of_fields, fields::size, and fields::tabs. Referenced by date2timestamp(), IP2hex(), ip_address_to_num(), and is_ip_address(). |
|
||||||||||||||||
|
Split a string into fields.
Definition at line 180 of file strings_utils.c. References INITIAL_NUMBER_OF_FIELD, fields::number_of_fields, fields::size, and fields::tabs. |
|
||||||||||||
|
Convert a string of characters into an 'int'.
Definition at line 678 of file strings_utils.c. References char2int. Referenced by is_ip_address(). |
|
||||||||||||
|
Convert a string of characters into a 'time_t'.
Definition at line 649 of file strings_utils.c. References char2int. Referenced by test_tz_conf(). |
|
||||||||||||
|
Convert a string of characters into an 'unsigned int'.
Definition at line 618 of file strings_utils.c. References char2int. |
1.3-rc1