arg_foreach [was: [cvs] main.c, bogoconfig.c,...]

David Relson relson at osagesoftware.com
Fri May 9 22:30:13 CEST 2003


At 04:19 PM 5/9/03, Matthias Andree wrote:

>relson at users.sourceforge.net writes:
>
> >      process_args_and_config_file(argc, argv, true);
> >
> >      /* open all wordlists */
> >      open_wordlists((run_type == RUN_NORMAL) ? DB_READ : DB_WRITE);
> >
> > -    out = output_setup();
> > +    fpo = output_setup();
> >
> >      initialize(NULL);
> >
> >      if (run_type & (RUN_NORMAL | RUN_UPDATE)) {
> > -     exitcode = classify(argc, argv, out);
> > +     exitcode = arg_foreach(classify, argc, argv);
>
>Is this the right thing to do? Does arg_foreach iterate over options as
>well?

Matthias,

I'm not sure I understand your questions.

At the point when argc and argv are passed to arg_foreach(), the options 
have already been consumed.  What's left are bulk mode filenames (if any).

arg_foreach() iterates over the bulk mode file list (or reads filenames 
from stdin, if appropriate) and calls hook() for each file.  This is done 
to extend the bulk mode from classification to classification and registration.

David





More information about the bogofilter-dev mailing list