1 typedef struct Config { 2 const char *cache_directory; 3 const char *target_directory; 4 const char *reports_site_name; 5 const char *log_file; 6 const char *configuration_file; 7 const char *username_file; 8 const char *global_filter; 9 const char *users_filter; 10 const char *reports_logo; 11 const char *configuration_name; 12 const char *email_address; 13 const char *locale; 14 const char *reports_privacy_username; 15 const char *users_excess; 16 const char *username_remove; 17 const char *real_time_home; 18 double reports_svg_width; 19 double users_excess_limit; 20 time_t real_time_timeout; 21 time_t reports_rotate; 22 time_t log_time_zone_shift; 23 short int log_format; 24 short int reports_url_limit; 25 short int top_sites_limit; 26 short int reports_overwrite; 27 short int reports_privacy_mode; 28 char log_skip_errors; 29 char reports_bytes_divisor; 30 char index_show_calendar; 31 char index_sort; 32 char server_efficiency_bytes_divisor; 33 char username_is_preferred; 34 char username_unescape; 35 char username_resolve_ip; 36 char users_graphics_svg; 37 char users_show_ips; 38 char users_show_local_filters; 39 char reports_show_info; 40 char reports_indicators; 41 char users_fullurl_report; 42 char users_fullurl_split; 43 char users_report; 44 char top_sites_report; 45 char top_sites_svg; 46 char top_users_svg; 47 char server_efficiency_report; 48 char server_efficiency_svg; 49 char recipient_tolower; 50 } Config; 51 52 typedef struct owConfig { 53 const char *target_directory; 54 const char *log_file; 55 const char *email_address; 56 const char *configuration_name; 57 } owConfig; 58 59 typedef struct iConfig { 60 const char *locDivisor; 61 const char *ReportDir; 62 const char *CharSet; 63 const char *locFile; 64 const char *TTLname; 65 const char *AVGname; 66 const char *DFname; 67 const char *IRname; 68 const char *LRname; 69 const char *TURname; 70 const char *TSRname; 71 const char *ERname; 72 const char *SERname; 73 const char *PTname; 74 short int SYear; 75 short int EYear; 76 short int LFcount; 77 short int LFcsscount; 78 time_t SDate; 79 time_t EDate; 80 short int LocDateLen; 81 short int username_remove_length; 82 short int dldCount; 83 short int utCount; 84 short int ueCount; 85 double reports_bytes_divisor; 86 char **Downloads; 87 struct SAusertab *Usertab; 88 char Period[DATETIMESIZE * 2L]; 89 char *(*SAB)(double); 90 char GF; 91 char UF; 92 char Mode; 93 char PScale; 94 } iConfig; 95 96 typedef struct Localisation { 97 const char *No; 98 const char *User; 99 const char *Connections; 100 const char *Seconds; 101 const char *Bytes; 102 const char *URL; 103 const char *Period; 104 const char *SortFieldNOrder; 105 const char *Users; 106 const char *Served; 107 const char *Actual; 108 const char *Cached; 109 const char *Denied; 110 const char *TrafType; 111 const char *OthLocal; 112 const char *TopUsers; 113 const char *TopSites; 114 const char *SEfficiency; 115 const char *InRealTime; 116 const char *DnT; 117 const char *DsT; 118 const char *DoM; 119 const char *Asc; 120 const char *Desc; 121 const char *TOTAL; 122 const char *AVERAGE; 123 const char *MAXIMUM; 124 const char *Code; 125 const char *GeneratedBy; 126 const char *Configuration; 127 const char *GenerationD; 128 const char *PSP; 129 const char *P; 130 const char *T; 131 const char *G; 132 const char *M; 133 const char *k; 134 const char *Sender; 135 const char *Messages; 136 const char *Recipient; 137 const char *Senders; 138 const char *Recipients; 139 const char *Month; 140 const char *Year; 141 const char *Search; 142 const char *Report; 143 const char *IPaddress; 144 } Localisation; 145 146 typedef struct FConfig { 147 short int inameCount; 148 short int urlCount; 149 short int ipCount; 150 short int codeCount; 151 short int limit; 152 const void **inames; 153 const void **urls; 154 const void **ips; 155 short int *codes; 156 char *methods; 157 char *name; 158 double bytes; 159 char stats; 160 char inameMode; 161 char urlMode; 162 char ipMode; 163 char codeMode; 164 char methodMode; 165 char statMode; 166 char bytesMode; 167 char showbytes; 168 } FConfig; 169 170 typedef struct SAFNAMES { 171 char srt[FILENAMESIZE]; 172 char uns[FILENAMESIZE]; 173 } SAFNAMES; 174 175 typedef struct SVGConfig { 176 double Scale; 177 short int Top; 178 char Legend; 179 char Pie; 180 char Relative; 181 } SVGConfig; 182 183 typedef struct RConfig { 184 double SVGwidth; 185 double SVGheight; 186 char *UFRsort; 187 char *URsort; 188 char *UDRsort; 189 char *LFRsort; 190 char *IRsort; 191 struct SAFNAMES TSRfnames; 192 struct SVGConfig UGR; 193 struct SVGConfig TSGR; 194 struct SVGConfig TUGR; 195 struct SVGConfig SEGR; 196 } RConfig; 197 198 199 extern struct Config cfg; 200 extern struct owConfig owcfg; 201 extern struct iConfig icfg; 202 extern struct Localisation defloc; 203 extern struct Localisation *loc; 204 extern struct FConfig *gfcfg; 205 extern struct FConfig *ufcfg; 206 extern struct FConfig **lfcfgs; 207 extern struct RConfig rcfg; 208 209 210 extern void InitConfigWithCL(int argc, char **argv); 211 extern void InitConfig(void); 212 extern void InitLocale(void); 213 214 215 #define LOCSIZE sizeof(Localisation)/sizeof(char *) 216