main.cpp File Reference

Main file with main function. More...

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <getopt.h>
#include <string.h>
#include <libgen.h>
#include "db.h"
#include "compute.h"
#include "config.h"
#include "helper.h"
#include "threads.h"

Include dependency graph for main.cpp:


Defines

#define NON_EXTERN_GLOBALS
 This macro sets, where global variables should be extern and where not.

Functions

void help (char **argv)
 Just printout brief help about usage.
int main (int argc, char **argv)
 Main.

Variables

int verbose
 Global variable controlling verbosity of output.
unsigned int maxlen
 Maximal length of prefix.
unsigned int minlen
 Minimal length of prefix.
unsigned int longest
 Longest word from input file.
char * optarg
 String used by getopt library.
bool numbered
 Are occurrences included in input file?
char * affstring
 How do we call that thing, that we want to recognize.

Detailed Description

Main file with main function.

This file contains main function (

See also:
main). As is mentioned in documentation of main, it's really simple and short and all logic is in other functions. So nothing interesting here ;-) I nearly forgot, mainpage of documentation is also in this file. But who cares about documentation ;-)

Function Documentation

int main ( int  argc,
char **  argv 
)

Main.

Main function. It parses command-line arguments and run other functions. Program itself is really easy. It just parse input file, compute statistics, use statistics to find prefixes, and save them. This is also reflected in main. It could be much shorter, but I'm too lazy to write separate function just because of parsing command-line arguments.

References affstring, CHECK_PTR, compute_stats(), destroy_db(), find_it(), help(), init_db(), init_pool(), longest, maxlen, minlen, numbered, optarg, print_it(), and verbose.


Variable Documentation

unsigned int longest

Longest word from input file.

Longest word found.

Referenced by compute_stats(), find_it_thread(), for_each_segment(), main(), and sqrs().

int verbose

Global variable controlling verbosity of output.

It is used by outputting macros. Possible values are:

  • 0 Suppress all output.
  • 1 Normal amount of informations.
  • 2 Verbose output.
  • 3 Extremely verbose output.

See also:
VPRINTF(), WPRINTF(), VWPRINTF()

Referenced by main(), and print_it().


Generated on Sat Dec 20 11:32:18 2008 for Affisix by  doxygen 1.5.7.1