]> git.ipfire.org Git - thirdparty/sarg.git/blob - include/conf.h
Use boolean to enable all the options instead of string compares.
[thirdparty/sarg.git] / include / conf.h
1 #include "config.h"
2 #include "info.h"
3
4 #ifdef HAVE_WINDOWS_H
5 #include <windows.h>
6 #endif
7 #ifdef HAVE_STDIO_H
8 #include <stdio.h>
9 #endif
10 #ifdef HAVE_STDLIB_H
11 #include <stdlib.h>
12 #endif
13 #ifdef HAVE_STRING_H
14 #include <string.h>
15 #endif
16 #ifdef HAVE_STRINGS_H
17 #include <strings.h>
18 #endif
19 #ifdef HAVE_SYS_TIME_H
20 #include <sys/time.h>
21 #endif
22 #ifdef HAVE_TIME_H
23 #include <time.h>
24 #endif
25 #ifdef HAVE_SYS_RESOURCE_H
26 #include <sys/resource.h>
27 #endif
28 #ifdef HAVE_UNISTD_H
29 #include <unistd.h>
30 #endif
31 #if defined(HAVE_SYS_DIRENT_H) && !defined(HAVE_DIRENT_H)
32 #include <sys/dirent.h>
33 #endif
34 #ifdef HAVE_DIRENT_H
35 #include <dirent.h>
36 #endif
37 #ifdef HAVE_SYS_SOCKET_H
38 #include <sys/socket.h>
39 #endif
40 #ifdef HAVE_NETDB_H
41 #include <netdb.h>
42 #endif
43 #ifdef HAVE_TYPES_H
44 #include <types.h>
45 #endif
46 #ifdef HAVE_NETINET_IN_H
47 #include <netinet/in.h>
48 #endif
49 #ifdef HAVE_ARPA_INET_H
50 #include <arpa/inet.h>
51 #endif
52 #ifdef HAVE_SYS_STAT_H
53 #include <sys/stat.h>
54 #endif
55 #ifdef HAVE_CTYPE_H
56 #include <ctype.h>
57 #endif
58 #ifdef HAVE_ERRNO_H
59 #include <errno.h>
60 #endif
61 #ifdef HAVE_SYS_WAIT_H
62 #include <sys/wait.h>
63 #endif
64 #ifdef HAVE_GD_H
65 #include <gd.h>
66 #define HAVE_GD
67 gdImagePtr im;
68 gdPoint points[4];
69 #endif
70 #ifdef HAVE_GDFONTL_H
71 #include <gdfontl.h>
72 #endif
73 #ifdef HAVE_GDFONTT_H
74 #include <gdfontt.h>
75 #endif
76 #ifdef HAVE_GDFONTS_H
77 #include <gdfonts.h>
78 #endif
79 #ifdef HAVE_GDFONTMB_H
80 #include <gdfontmb.h>
81 #endif
82 #ifdef HAVE_GDFONTG_H
83 #include <gdfontg.h>
84 #endif
85 #ifdef HAVE_STDARG_H
86 #include <stdarg.h>
87 #endif
88 #ifdef HAVE_INTTYPES_H
89 #include <inttypes.h>
90 #endif
91 #ifdef HAVE_LIMITS_H
92 #include <limits.h>
93 #endif
94 #ifdef HAVE_WINSOCK_H
95 #include <winsock.h>
96 #endif
97 #ifdef HAVE_LOCALE_H
98 #include <locale.h>
99 #endif
100 #ifdef HAVE_EXECINFO_H
101 #include <execinfo.h>
102 #endif
103
104 #if defined(HAVE_FOPEN64)
105 #define _FILE_OFFSET_BITS 64
106 #define MY_FOPEN fopen64
107 #else
108 #define MY_FOPEN fopen
109 #endif
110
111 #if !defined(HAVE_BZERO)
112 #define bzero(mem,size) memset(mem,0,size)
113 #endif
114
115 #if defined(IBERTY_LIB) && !defined(HAVE_MKSTEMP)
116 int mkstemps(char *template, int suffixlen);
117 #define mkstemp(template) mkstemps(template,0)
118 #endif
119
120 #if defined(__MINGW32__)
121 #define mkdir(p,m) _mkdir(p)
122
123 #ifndef WIFEXITED
124 #define WIFEXITED(S) 1
125 #endif
126
127 #ifndef WEXITSTATUS
128 #define WEXITSTATUS(S) (S)
129 #endif
130
131 #endif /*__MINGW32__*/
132
133 #define MAXLEN 20000
134 #define MAXLOGS 255
135
136 FILE *fp_tt;
137
138 char outdir[MAXLEN];
139 char dirname[MAXLEN];
140 char buf[MAXLEN];
141 char url[MAXLEN];
142 char urly[MAXLEN];
143 char user[MAXLEN];
144 char period[MAXLEN];
145 char msg[1024];
146 char per_hour[128];
147 char code[MAXLEN];
148 char code2[MAXLEN];
149 char tmp[MAXLEN];
150 char tmp2[MAXLEN];
151 char tmp3[MAXLEN];
152 char tmp4[MAXLEN];
153 char tmp5[MAXLEN];
154 char tmp6[MAXLEN];
155 char tmp7[MAXLEN];
156 char parse_out[MAXLEN];
157 char arqtt[MAXLEN];
158 char html[MAXLEN];
159 char datestimes[MAXLEN];
160 char ConfigFile[MAXLEN];
161 char href[MAXLEN];
162 char href2[MAXLEN];
163 char href3[MAXLEN];
164 char df[20];
165 char day[3], month[4], year[5];
166 char nmonth[30];
167 char ltext110[50];
168 char cdfrom[30];
169 char cduntil[30];
170 char LastLog[5];
171 int RemoveTempFiles;
172 char ReplaceIndex[256];
173 char Index[20];
174 int OverwriteReport;
175 char u2[255];
176 char RecordsWithoutUser[20];
177 int UseComma;
178 char MailUtility[PATH_MAX];
179 char TopSitesNum[20];
180 int TopUsersNum;
181 char ExcludeCodes[256];
182 char TopsitesSortField[15];
183 char TopsitesSortType[20];
184 char ReportType[255];
185 char UserTabFile[255];
186 char warea[MAXLEN];
187 char name[MAXLEN];
188 int LongUrl;
189 int Ip2Name;
190 char language[255];
191 char bufy[MAXLEN];
192 int NAccessLog;
193 char AccessLog[MAXLOGS][MAXLEN];
194 int AccessLogFromCmdLine;
195 char Title[MAXLEN];
196 char BgColor[MAXLEN];
197 char BgImage[MAXLEN];
198 char TxColor[MAXLEN];
199 char TxBgColor[MAXLEN];
200 char TiColor[MAXLEN];
201 char LogoImage[MAXLEN];
202 char LogoText[MAXLEN];
203 char LogoTextColor[MAXLEN];
204 char Width[MAXLEN];
205 char Height[MAXLEN];
206 char FontFace[MAXLEN];
207 char HeaderColor[MAXLEN];
208 char HeaderBgColor[MAXLEN];
209 char FontSize[MAXLEN];
210 char PasswdFile[MAXLEN];
211 char TempDir[MAXLEN];
212 char OutputDir[MAXLEN];
213 char OutputEmail[MAXLEN];
214 char TopuserSortField[30];
215 char UserSortField[30];
216 char TopuserSortOrder[10];
217 char UserSortOrder[10];
218 char UserAgentLog[255];
219 char module[255];
220 char ExcludeHosts[255];
221 char ExcludeUsers[255];
222 char DateFormat[2];
223 char PerUserLimitFile[255];
224 int PerUserLimit;
225 int UserIp;
226 char MaxElapsed[255];
227 char datetimeby[10];
228 char csort[255];
229 char CharSet[255];
230 char UserInvalidChar[255];
231 int Graphs;
232 char GraphDaysBytesBarColor[255];
233 int Privacy;
234 char PrivacyString[255];
235 char PrivacyStringColor[30];
236 char IncludeUsers[MAXLEN];
237 char ExcludeString[MAXLEN];
238 int SuccessfulMsg;
239 char TopUserFields[255];
240 char UserReportFields[255];
241 char DataFile[MAXLEN];
242 char DataFileDelimiter[3];
243 char DataFileFields[MAXLEN];
244 char DataFileUrl[20];
245 char SiteUserTimeDateType[10];
246 int ShowReadStatistics;
247 char IndexSortOrder[5];
248 char DansGuardianConf[MAXLEN];
249 int DansguardianIgnoreDate;
250 char SquidGuardConf[MAXLEN];
251 char SquidGuarddbHome[255];
252 char SquidGuardLogFormat[MAXLEN];
253 char SquidGuardLogAlternate[MAXLEN];
254 int SquidguardIgnoreDate;
255 int ShowSargInfo;
256 int BytesInSitesUsersReport;
257 int ShowSargLogo;
258 char ParsedOutputLog[MAXLEN];
259 char ParsedOutputLogCompress[255];
260 char DisplayedValues[20];
261 char HeaderFontSize[5];
262 char TitleFontSize[5];
263 char wwwDocumentRoot[MAXLEN];
264 char ExternalCSSFile[MAXLEN];
265 char BlockIt[255];
266 char BlockImage[512];
267 char NtlmUserFormat[30];
268 char hbc1[30];
269 char hbc2[255];
270 char hbc3[30];
271 char hbc4[30];
272 char hbc5[30];
273 char hbc6[30];
274 char hbc7[30];
275 char hbc8[30];
276 char hbc9[30];
277 char hbc10[30];
278 char IndexTree[10];
279 int UserAuthentication;
280 char AuthUserFile[255];
281 char AuthName[512];
282 char AuthType[255];
283 char Require[512];
284 char *userfile;
285 char *str;
286 char *str2;
287 char text[200][255];
288 char val1[MAXLEN];
289 char val2[MAXLEN];
290 char val3[MAXLEN];
291 char val4[MAXLEN];
292 char val5[MAXLEN];
293 char val6[MAXLEN];
294 char val7[MAXLEN];
295 char val8[MAXLEN];
296 char val9[MAXLEN];
297 char val10[MAXLEN];
298 char val11[MAXLEN];
299 char wwork1[MAXLEN];
300 char wwork2[MAXLEN];
301 char wwork3[MAXLEN];
302 char mask[MAXLEN];
303 char httplink[MAXLEN];
304 char html_old[MAXLEN];
305 char site[MAXLEN];
306 char us[50];
307 char email[MAXLEN];
308 char test[1];
309 char ouser2[255];
310 char user2[MAXLEN];
311 char wentp[512];
312 char addr[MAXLEN];
313 char Ulimit[6];
314 char RealtimeTypes[1024];
315 char cmd[255];
316 char ImageFile[255];
317 char tbuf[128];
318 char ip[25];
319 char RealtimeUnauthRec[15];
320
321 int idate;
322 int smartfilter;
323 int denied_count;
324 int download_count;
325 int authfail_count;
326 int dansguardian_count;
327 int squidguard_count;
328 int limit_flag;
329 int color1;
330 int color2;
331 int color3;
332 int z1, z2, z3;
333 int ttopen;
334 int ind2;
335 int sarglog;
336 int isalog;
337 int dfrom;
338 int duntil;
339 int dataonly;
340 int indexonly;
341 int iprel;
342 int userip;
343 int langcode;
344 int debug;
345 int debugz;
346 int debugm;
347 int AuthfailReportLimit;
348 int DeniedReportLimit;
349 int DownloadReportLimit;
350 int SiteUsersReportLimit;
351 int DansGuardianReportLimit;
352 int SquidGuardReportLimit;
353 int UserReportLimit;
354 int dotinuser;
355 int realtime_refresh;
356 int realtime_access_log_lines;
357 int realt;
358 int rc;
359 int ntopsites;
360 int nsitesusers;
361 int nrepday;
362 int ndownload;
363 int ntopuser;
364 int squid24;
365 float perc;
366
367 long long int nocost;
368 float cost;
369
370 typedef struct
371 { int list[ 24 ];
372 int len;
373 } numlist;
374
375 DIR *dirp;
376 struct dirent *direntp;