00001
00002
00003
00004
00005 #ifdef __cplusplus
00006 extern "C" {
00007 #endif
00008
00009
00010
00011 #ifndef STRINGS_UTILS_HPP
00012
00013 #include <stdio.h>
00014 #include <string.h>
00015 #include <stdlib.h>
00016 #include <time.h>
00017
00018
00019
00020
00021 #define INITIAL_NUMBER_OF_FIELD 10
00022
00023
00024
00025
00026 struct fields {
00027
00028 int number_of_fields;
00029
00030
00031 int size;
00032
00033 char **tabs;
00034 };
00035
00036 char *make_one_line (char *st);
00037 int s_split(char *st, char* delimitor, struct fields *f);
00038 int s_split_exact(char *st, char* delimitor, struct fields *f);
00039 void free_fields (struct fields *fd);
00040 char* get_end_of_string (char *src, char *dst, int nbcar);
00041 char* IP2hex (char *src, char *dst, int nbcar);
00042 char* post_chop(char *src);
00043 char* pre_chop(char *src);
00044 char* chop(char *src);
00045 char* add_comment (char *src, char **dst);
00046 char* get_config_value (char *buffer, char *delim);
00047 char* replace_tag_by_integer (char* src, char *tag, int value);
00048 unsigned int string2unsigned_int (char *st, int *error);
00049 int string2int (char *st, int *error);
00050 time_t string2time_t (char *st, int *error);
00051 int is_integer (char *st);
00052 int is_hexa (char *st);
00053 int is_ip_address (char *st);
00054 int ip_address_to_num (char *st, unsigned char *num);
00055
00056
00057 #define STRINGS_UTILS_HPP
00058 #endif
00059
00060
00061 #ifdef __cplusplus
00062 }
00063 #endif
00064