Input


Detailed Description

User interface for reading the input.


Data Structures

struct  input_t
 Input. More...

Functions

static void usage (const char *name)
 Print documentation and exit.
static void version (void)
 Print version information and exit.
static void parse_command_line (input_t *restrict pinput, int argc, char **argv)
 Parse the command line.
static void process_input (input_t *restrict pinput)
 Read the input file.
static void free_input (const input_t *pinput)
 Frees the memory allocated for the fields of input_t.


Function Documentation

static void free_input ( const input_t pinput  )  [static]

Frees the memory allocated for the fields of input_t.

Definition at line 742 of file types.c.

References input_t::hapax, input_t::incidenceb, input_t::incidencezom, and input_t::sample_items.

Referenced by main().

static void parse_command_line ( input_t *restrict  pinput,
int  argc,
char **  argv 
) [static]

Parse the command line.

Set the relevant parts of pinput. Exit with failure if unsuccessful. Print usage information and exit successfully if the command line switch -h or --help is specified.

Definition at line 594 of file types.c.

References get_uint(), usage(), and version().

Referenced by main().

static void process_input ( input_t *restrict  pinput  )  [static]

Read the input file.

Allocate memory for input and set the relevant parts of pinput. Exit with failure if unsuccessful.

Definition at line 672 of file types.c.

References myfscanf(), MYMALLOC, and WORD_BITS.

Referenced by main().

static void usage ( const char *  name  )  [static]

Print documentation and exit.

Definition at line 472 of file types.c.

References LEVELS_LIST, and STRINGIFY.

Referenced by parse_command_line().

static void version ( void   )  [static]

Print version information and exit.

Definition at line 526 of file types.c.

References VERSION, and YEAR.

Referenced by parse_command_line().