int main(int argc, char **argv) { token_t t; fpo = stdout; mbox_mode = true; /* to allow multiple messages */ process_arglist(argc, argv); process_config_files(false, longopts_bogolexer); if (encoding == E_UNKNOWN) encoding = E_DEFAULT; textblock_init(); if (!passthrough) { if (quiet) fprintf(fpo, "quiet mode.\n"); else fprintf(fpo, "normal mode.\n"); } bogoreader_init(argc, (const char * const *) argv); while ((*reader_more)()) { word_t token; lexer_init(); while ((t = get_token( &token )) != NONE) { count += 1; if (passthrough) { fprintf(fpo, "%s\n", token.u.text); } else if (!quiet) fprintf(fpo, "get_token: %d \"%s\"\n", (int)t, token.u.text); } } if ( !passthrough ) fprintf(fpo, "%d tokens read.\n", count); /* cleanup storage */ token_cleanup(); mime_cleanup(); textblock_free(); MEMDISPLAY; return 0; }
static void bogotune_free(void) { xfree(ns_scores); xfree(sp_scores); filelist_free(ham_files); filelist_free(spam_files); tunelist_free(ns_msglists); tunelist_free(sp_msglists); tunelist_free(ns_and_sp); word_free(w_msg_count); token_cleanup(); mime_cleanup(); xfree(ds_path); return; }