Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Examples  

strings_utils.h

Go to the documentation of this file.
00001 /*! \file strings_utils.h
00002     Header file for strings_utils.c
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 /*! \brief This defines the minimum number of fields to allocate. 10 should ne enough.
00019  */
00020 
00021 #define INITIAL_NUMBER_OF_FIELD 10
00022 
00023 /*! \brief When a string is cut into fields, the fields are saved into a 'fields' structure.
00024  */
00025 
00026 struct fields {
00027                 /*! \brief Number of field extracted from the string. */
00028                 int  number_of_fields;
00029                 /*! \brief Number of allocated string. Please note that you can have 10 allocated fields, but only 7 are
00030                            actually used to put fields */
00031                 int  size;
00032                 /*! The field tabs points to an array of strings. Each string contains one field. */
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 

Generated on Thu Apr 3 16:23:44 2003 for Common_C_libraries by doxygen1.3-rc1