buff_t cleanup
David Relson
relson at osagesoftware.com
Sat Mar 1 02:20:08 CET 2003
Matthias,
I did a bit of cleaning up of the buff_t code.
Since struct field 'pos' is never used, I removed it.
The t.leng field shows how much data is actually _in_ the buffer and any
additional data added to the buffer is at the end of the buffer's
data. Since this is so, buff_fgetsl() now uses buff->t.leng when it calls
xfgetsl() to read more text. This change also allowed removing any code
(outside of buff.c) that set buff->read.
However, bogofilter does need to know about the most recently read line (to
save it for passthrough and to print it for debugging), so buff_fgetsl()
savees the start position of the line in buff->read.
These changes put more of the "bookkeeping code" for buff_t in buff.c and
simplify the use of the struct. This should help maintain the code.
David
More information about the bogofilter-dev
mailing list