diff options
author | Ian C <ianc@noddybox.co.uk> | 2003-12-07 01:46:44 +0000 |
---|---|---|
committer | Ian C <ianc@noddybox.co.uk> | 2003-12-07 01:46:44 +0000 |
commit | 787bb7625c9abc6b09efbc6bbe004a19d4b96166 (patch) | |
tree | 87b38cae639ced0b5a705a3d1e45d977ea419756 /src/dbase.h | |
parent | f1658930db64af8fecff9c8697592f676114409c (diff) |
Made RE compiled once and added memory release
Diffstat (limited to 'src/dbase.h')
-rw-r--r-- | src/dbase.h | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/dbase.h b/src/dbase.h index df64927..c7a98ee 100644 --- a/src/dbase.h +++ b/src/dbase.h @@ -30,6 +30,7 @@ #define KBS_DBASE_H #include "msg.h" +#include "rexp.h" /* ---------------------------------------- TYPES */ @@ -41,9 +42,10 @@ typedef struct Domain Domain; /* ---------------------------------------- INTERFACES */ -/* Add a new domain and define the regular expression that defines it +/* Add a new domain and define the regular expression that defines it. + re will be freed by the database when closed. */ -Domain *DBNewDomain(const char *regexp); +Domain *DBNewDomain(RE_Expression name); /* Define the default mode for a domain @@ -56,14 +58,16 @@ void DBDefault(Domain *domain, int block); void DBBlockUser(Domain *domain, const char *username); -/* Add an allowable subject for a domain +/* Add an allowable subject for a domain. + re will be freed by the database when closed. */ -void DBAllowSubject(Domain *domain, const char *regexp); +void DBAllowSubject(Domain *domain, RE_Expression re); -/* Adds a disallowed subject for a domain +/* Adds a disallowed subject for a domain. + re will be freed by the database when closed. */ -void DBBlockSubject(Domain *domain, const char *regexp); +void DBBlockSubject(Domain *domain, RE_Expression re); /* Adds a trusted username @@ -81,6 +85,16 @@ void DBTrustedDomain(const char *domain); int DBBlockMessage(const POP3Message *msg); +/* Returns reason for last block if message is to be blocked. +*/ +const char *DBBlockReason(void); + + +/* Free up memory allocated to database. +*/ +void DBClose(void); + + #endif /* END OF FILE */ |