Better database??
michael at optusnet.com.au
michael at optusnet.com.au
Wed Mar 3 08:39:01 CET 2004
David Relson <relson at osagesoftware.com> writes:
> Michael,
>
> Let me see if I can summarize the effect:
>
> Rather than passing a pointer to a struct containing the 3 values, you'd
> prefer to pass a trio of values (for writing) or a trio of addresses
> (for reading). Yes?
Unless I terribly misread the code, the datastores actually get passed
a 12 byte array rather than a struct? (dbv_t *v containing void *data,
and uint32_t len)
And while I can do ((uint32_t*)v->data)[1], it's rather
kludgy... :)
What I'd really rather is that the datastores got passed dsv_t* and word_t*.
What would be even better is to have the datastore's pass a struct containing
a bunch of function pointers to datastore.c which implements stub functions
for all functions that aren't filled in.
I.e. pass
{
func_t (*set_token)(),
func_t (*get_token)(),
func_t (*set_robx)(),
....
}
and then datastore can do
if (set_robs)
set_robx(new_robx_value)
else {
dbv_t x;
x.spam = robx;
set_token(msg_robx_token, &dbv_t);
}
etc etc. Does that make any sense?? After typing all this I'm
realizing that I should have just implemented it and sent in the patch
because it would have been clearer and less work. :)
Michael, dreaming of a white christmas.
More information about the Bogofilter
mailing list