1 /* $Id: config.h,v 1.16 2011/06/28 00:13:48 sbajic Exp $ */
2 
3 /*
4  DSPAM
5  COPYRIGHT (C) 2002-2012 DSPAM PROJECT
6 
7  This program is free software: you can redistribute it and/or modify
8  it under the terms of the GNU Affero General Public License as
9  published by the Free Software Foundation, either version 3 of the
10  License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  GNU Affero General Public License for more details.
16 
17  You should have received a copy of the GNU Affero General Public License
18  along with this program.  If not, see <http://www.gnu.org/licenses/>.
19 
20 */
21 
22 #ifndef _DEFS_H
23 #define _DEFS_H
24 
25 #ifdef HAVE_CONFIG_H
26 #include <auto-config.h>
27 #endif
28 
29 #include <limits.h>
30 #ifndef _WIN32
31 #include <sys/param.h>
32 #endif
33 
34 #ifndef CONFIG_DEFAULT
35 #	warning CONFIG_DEFAULT is not defined by configure/Makefile
36 #	warning Fallback to hardcoded defaults
37 #define CONFIG_DEFAULT	"/usr/local/etc/dspam.conf"
38 #endif
39 
40 #ifndef CONFIGURE_ARGS
41 #define CONFIGURE_ARGS "default"
42 #endif
43 
44 /* Acceptable Word Delimiters */
45 /*
46 OLD DELIMITERS
47 #define DELIMITERS              " .,;:\"/\\[]}{=+_()<>|&\n\t\r@-*~`?"
48 #define DELIMITERS_HEADING      " ,;:\"/\\[]}{=+()<>|&\n\t\r@*~`?"
49 
50 | " : +FP,+ FN
51  - : -FP, -FN
52 + *:
53 */
54 
55 #define SPARSE_DELIMITERS           " .,;:\"/\\[]}{=+_()<>|&\n\t\r@-*~`?#$%^"
56 #define SPARSE_DELIMITERS_HEADING   " ,;:\"/\\[]}{=+()<>|&\n\t\r@*~`?#$%^"
57 
58 #define DELIMITERS              " .,;:\n\t\r@-+*"
59 #define DELIMITERS_HEADING      " ,;:\n\t\r@-+*"
60 
61 #define DELIMITERS_EOT		"!"
62 
63 /* Our 64-bit Polynomial */
64 #define POLY64REV       0xd800000000000000ULL
65 
66 #ifndef LOGDIR
67 #	warning LOGDIR is not defined by configure/Makefile
68 #	warning Fallback to hardcoded defaults
69 #define LOGDIR "/usr/local/var/dspam/log"
70 #endif
71 
72 /* General-Purpose Character Array Sizes */
73 #ifdef PATH_MAX
74 #	define MAX_FILENAME_LENGTH	PATH_MAX
75 #else
76 #	define MAX_FILENAME_LENGTH	128
77 #endif
78 
79 /* General-Purpose Character Array Sizes */
80 #ifdef LONG_USERNAMES
81 #	define MAX_USERNAME_LENGTH	256
82 #else
83 #ifdef LOGIN_NAME_MAX
84 #       define MAX_USERNAME_LENGTH      LOGIN_NAME_MAX
85 #else
86 #       define MAX_USERNAME_LENGTH      256
87 #endif
88 #endif
89 
90 #ifndef MAX
91 #define MAX(a,b)  ((a)>(b)?(a):(b))
92 #endif
93 
94 #ifndef MIN
95 #define MIN(a,b)  ((a)<(b)?(a):(b))
96 #endif
97 
98 #ifndef LLU_FMT_SPEC
99 #define LLD_FMT_SPEC "lld"
100 #define LLU_FMT_SPEC "llu"
101 #endif
102 
103 #endif
104