Reader API thoughts

David Relson relson at osagesoftware.com
Tue Aug 19 05:41:26 CEST 2003


Matthias,

I've got some ideas on the types of message readers that bogofilter should have and the functions that need to be supported.  The ideas are, at best, half baked and incomplete.  I'm presenting them as a topic for discussion :-)

David

*** API ideas ***

reader types:

    NORMAL  - input from stdin
    CMDLINE - input files listed on linend
    STDIN   - input files listed on stdin

reader API:

    void initialize(int argc, char **argv, FILE *fp)
    int  fgetsl(buff_t *buff)
    bool eof(void)
    void cleanup(void)
    void print_filename(void)

notes:

    mmap applies to seekable files
    NORMAL applies to mailboxes
    print_filename() applies to CMDLINE and STDIN.
        is dummy function for NORMAL

    '-I filename' names file to substitute for stdin.  Likely should
    be deprecated in favor of '-B filename'.

additional ideas:

    if directory named via CMDLINE or STDIN, 
    process all files of directory

    nestable (recursive) functions, i.e.
	 recurse if sub-directory named in directory
	 using NORMAL mode for files allows mailbox processing




More information about the bogofilter-dev mailing list