12.06.2015 Views

The Annoyance Filter.pdf - Fourmilab

The Annoyance Filter.pdf - Fourmilab

The Annoyance Filter.pdf - Fourmilab

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

§223 ANNOYANCE-FILTER MAIN PROGRAM 181<br />

223. Main program.<br />

<strong>The</strong> main program is rather simple. We initialise the global variables then chew through the command<br />

line, doing whatever the options request.<br />

〈 Main program 223 〉 ≡<br />

〈 Global declarations used by component in temporary jig 253 〉;<br />

int main (int argc, char ∗argv [ ])<br />

{<br />

int opt ;<br />

〈 Initialise global variables 224 〉;<br />

〈 Process command-line options 243 〉;<br />

#ifdef POP3_PROXY_SERVER<br />

if (popProxyServer ≠ "") {<br />

〈 Operate POP3 proxy server, filtering replies 218 〉;<br />

}<br />

#endif<br />

return exitStatus ;<br />

}<br />

This code is used in section 254.<br />

224.<br />

〈 Initialise global variables 224 〉 ≡<br />

memset (messageCount , 0, sizeof messageCount );<br />

isoToken .setISO 8859defaults (minTokenLength , maxTokenLength );<br />

asciiToken .setUS ASCIIdefaults (streamMinTokenLength , streamMaxTokenLength );<br />

This code is used in section 223.<br />

225. <strong>The</strong> master dictionary is global to the main program and all of its support functions. It’s<br />

declared after all the class definitions it requires. We also support a fastDictionary for classification<br />

runs. If loaded, it takes precedence over any loaded dictionary.<br />

〈 Master dictionary 225 〉 ≡<br />

static dictionary dict ; /∗ Master dictionary ∗/<br />

static fastDictionary fDict ; /∗ Fast dictionary ∗/<br />

See also section 249.<br />

This code is used in section 254.<br />

226.<br />

〈 Global variables 226 〉 ≡<br />

static unsigned int messageCount [2]; /∗ Total messages per category ∗/<br />

static list〈string〉 messageTranscript ; /∗ Message transcript list ∗/<br />

static queue〈string〉 parserDiagnostics ; /∗ List of diagnostics generated by the parser ∗/<br />

static bool saveParserDiagnostics = false ; /∗ Save parser diagnostics in parserDiagnostics ? ∗/<br />

See also sections 241, 250, and 251.<br />

This code is cited in section 241.<br />

This code is used in section 254.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!