Porting to RISC OS
Stefan Bellon
sbellon at sbellon.de
Sat Sep 6 01:13:42 CEST 2003
David Relson wrote:
> On Fri, 05 Sep 2003 20:20:19 +0200
> Stefan Bellon <sbellon at sbellon.de> wrote:
> > What am I missing?
[snip]
> Anyhow, I'll take a look and probably post a patch in a while. For
> now, don't bother with it.
Ok, I'll forget about it for now. :-)
Then it looks like I have bogofilter running on RISC OS. I'd be happy
to see my changes going into main CVS tree if you agree.
I had to change the following:
1) Comment out the "#include <db.h>" inside bogoconfig.c as we on
RISC OS don't have this header file. I either suggest the
ENABLE_TDB_DATASTORE is uncommented again, or another #ifdef is
added that checks for !__riscos__:
#ifndef __riscos__
#include <db.h>
#endif
2) Put an "#undef atol" before the redefinition in dcdflib/src/dcdflib.c
as Norcroft C doesn't like macro redefinitions. So, something like
#ifdef __riscos__
#undef atol
#endif
#define atol 1.0e-50
would be nice.
3) I had to add dcdflib/src/dcdflib.h as fisher.c includes it.
4) As RISC OS doesn't have automake/configure etc., I hand-edited a
config.h file and a Makefile and can provide it.
5) As RISC OS doesn't have a port of Berkeley DB and TDB was too slow,
I ported sdbm and qdbm and created interfaces to them. I can provide
those files (datastore_sdbm.c and datastore_qdbm.c). (If you're
interested: sdbm is about 40 to 50 % slower and needs 30 % more disc
space than qdbm for average bogofilter usage.)
6) And finally, I found three calls to free() in bogoreader.c but the
relevant allocations have been done with xmalloc(), so that I
suggest the freeing should be done with xfree() for clarity.
Should I post dcdflib/src/dcdflib.h, datastore_sdbm.c, datastore_qdbm.c
and the RISC OS versions of config.h and Makefile here to the list or
someone of you in private email?
Greetings,
Stefan.
--
Zucchini: Dense, flavorless vegetable useful as ballast.
More information about the bogofilter-dev
mailing list