Hello gentlemen, I am new here.

I am currently trying to make a dspam plugin for a content filtering
system of mine, Zmscanner (http://www.average.org/zmscanner/).  To make
it clear, I am *not* going to run command-line frontend, I am rather
building my own application that links against libdspam and makes use of
dspam_process() and friends, as described in libdspam(3).

I found that this does not work because public dspam headers are
"leaky".  When you #include <libdspam.h>, these two headers are also
pulled in: pref.h and auto_config.h that are not installed into "public
place" during make install.

But there is an even worse thing: the header named "config.h" is
installed into the said "public place". This is guaranteed to conflict
with your own application configuration, and indeed it does, throwing
compile-time errors and generally doing wrong things
(see http://mailing-list.nuclearelephant.com/3476.html for example).

I'd like to suggest to separate the public header from all the internal
ones, and only "publish" this public header.

This public header should contain:

- public function prototypes (dspam_init() etc.)
- public #defines (DSM_PROCESS etc.)
- typedef for DSPAM_CTX

and not #include any other headers at all.

(sidenote: typedef for DSPAM_CTX is not strictly necessary to publish,
it is only needed to get hold of the signature.  It might be better to
expose the signature via accessor functions instead)

Comments?

Eugene

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to