00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef INCLUDE__shared_h__
00027 #define INCLUDE__shared_h__
00028
00029 #include <time.h>
00030
00031 typedef struct mmapfile_struct {
00032 char *path;
00033 int mode;
00034 int fd;
00035 unsigned long file_size;
00036 unsigned long current_position;
00037 unsigned long current_line;
00038 void *mmap_buf;
00039 } mmapfile;
00040
00041
00042 #define ARRAY_SIZE(ary) (sizeof(ary) / sizeof(ary[0]))
00043
00044 extern char *my_strtok(char *buffer, char *tokens);
00045 extern char *my_strsep(char **stringp, const char *delim);
00046 extern mmapfile *mmap_fopen(char *filename);
00047 extern int mmap_fclose(mmapfile *temp_mmapfile);
00048 extern char *mmap_fgets(mmapfile *temp_mmapfile);
00049 extern char *mmap_fgets_multiline(mmapfile * temp_mmapfile);
00050 extern void strip(char *buffer);
00051 extern int hashfunc(const char *name1, const char *name2, int hashslots);
00052 extern int compare_hashdata(const char *val1a, const char *val1b, const char *val2a,
00053 const char *val2b);
00054 extern void get_datetime_string(time_t *raw_time, char *buffer,
00055 int buffer_length, int type);
00056 extern void get_time_breakdown(unsigned long raw_time, int *days, int *hours,
00057 int *minutes, int *seconds);
00058 #endif
00059