From 787bb7625c9abc6b09efbc6bbe004a19d4b96166 Mon Sep 17 00:00:00 2001 From: Ian C Date: Sun, 7 Dec 2003 01:46:44 +0000 Subject: Made RE compiled once and added memory release --- src/dbase.h | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'src/dbase.h') 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 */ -- cgit v1.2.3