[cvs] bogofilter/src common.h,1.15,1.16 globals.c,1.30,1.31 wordlists.c,1.19,1.20
Fast Bayesian spam filter along lines suggested by Paul Graham
Brought to you by:
m-a
From: <re...@us...> - 2003-07-19 19:17:48
|
Update of /cvsroot/bogofilter/bogofilter/src In directory sc8-pr-cvs1:/tmp/cvs-serv12636 Modified Files: common.h globals.c wordlists.c Log Message: Move variable wl_mode to wordlists.c and define variable wl_default. Index: common.h =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/src/common.h,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- common.h 19 Jul 2003 19:04:56 -0000 1.15 +++ common.h 19 Jul 2003 19:17:45 -0000 1.16 @@ -98,8 +98,6 @@ B_STDIN } bulk_t; -#define WL_M_DEFAULT WL_M_COMBINED - typedef enum wl_e { WL_M_UNKNOWN ='U', WL_M_SEPARATE='S', WL_M_COMBINED='C' } wl_t; Index: globals.c =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/src/globals.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- globals.c 19 Jul 2003 19:04:56 -0000 1.30 +++ globals.c 19 Jul 2003 19:17:45 -0000 1.31 @@ -36,7 +36,6 @@ bool terse; /* '-t' */ int test = 0; /* '-T' */ int verbose; /* '-v' */ -wl_t wl_mode = WL_M_UNKNOWN; /* '-W' */ /* config file options */ int max_repeats; Index: wordlists.c =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/src/wordlists.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- wordlists.c 19 Jul 2003 19:12:22 -0000 1.19 +++ wordlists.c 19 Jul 2003 19:17:45 -0000 1.20 @@ -24,6 +24,11 @@ #include "xmalloc.h" #include "xstrdup.h" +/* Default wordlist mode is single wordlist (named wordlist.db) + which contains both ham and spam tokens */ +wl_t wl_default = WL_M_COMBINED; +wl_t wl_mode = WL_M_UNKNOWN; /* '-W' flag */ + #define MIN_SLEEP 0.5e+3 /* .5 milliseconds */ #define MAX_SLEEP 2.0e+6 /* 2 seconds */ @@ -185,18 +190,21 @@ { if (wl_mode == WL_M_UNKNOWN) { void *dbh = NULL; - wl_mode = WL_M_DEFAULT; if (dbh == NULL) { dbh = db_open(filepath, cCombined, aCombined, dbmode); if (dbh == NULL) wl_mode = WL_M_COMBINED; } + if (dbh == NULL) { dbh = db_open(filepath, cSeparate, aSeparate, dbmode); if (dbh == NULL) wl_mode = WL_M_SEPARATE; } + + if (dbh == NULL) + wl_mode = wl_default; if (dbhp != NULL) *dbhp = dbh; |