options.c File Reference

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <ctype.h>
#include <dirent.h>
#include "options.h"
#include "print-modes.h"
#include "output.h"
#include "corpmanag.h"
#include "concordance.h"
#include "../cl/attributes.h"
#include "../cl/macros.h"

Defines

Functions

Variables


Define Documentation

#define DEFAULT_EXTERNAL_GROUPING_COMMAND   "sort -n %s +0n +1n -2 | uniq -c | sort -n -r +1n +0rn +2n"
#define DEFAULT_EXTERNAL_SORTING_COMMAND   "sort -k 2 -k 1n "

Function Documentation

void execute_side_effects ( int  opt  ) 
char* expand_filename ( char *  fname  ) 

References cl_strdup().

Referenced by set_string_option_value().

int find_option ( char *  s  ) 

Finds the index of an option.

Return the index in the global options array of the option with name s. This should be never called from outside.

See also:
cqpoptions
Parameters:
s Name of the option to find.
Returns:
Index of element in cqpoptions corresponding to the name s, or -1 if no corresponding element was found.

References _cqpoption::opt_name.

Referenced by parse_options(), print_option_value(), print_option_values(), set_context_option_value(), set_integer_option_value(), and set_string_option_value().

void parse_options ( int  ac,
char *  av[] 
)
void print_option_value ( int  opt  ) 
void print_option_values (  ) 
char* set_context_option_value ( char *  opt_name,
char *  sval,
int  ival 
)
void set_default_option_values ( void   ) 
char* set_integer_option_value ( char *  opt_name,
int  value 
)

Sets an integer or string-valued option.

An error string is returned if the type of the option does not correspond to the function which is called. Upon success, NULL is returned.

Parameters:
opt_name The name of the option to set.
value Its new value.
Returns:
NULL if all OK; otherwise a string describing the problem.

References execute_side_effects(), find_option(), OptBoolean, OptContext, OptInteger, set_context_option_value(), and validate_integer_option_value().

Referenced by open_stream().

char* set_string_option_value ( char *  opt_name,
char *  value 
)

Sets a string-valued option.

An error string is returned if the type of the option does not correspond to the function which is called. Upon success, NULL is returned.

set_string_option_value does NOT strdup the value!

Parameters:
opt_name The name of the option to set.
value Its new value.
Returns:
NULL if all OK; otherwise a string describing the problem.

References execute_side_effects(), expand_filename(), find_option(), OptContext, OptString, set_context_option_value(), and validate_string_option_value().

Referenced by do_SimpleVariableReference(), do_StringConstraint(), and open_stream().

void syntax ( void   ) 

References cqp, cqpcl, cqpserver, progname, and which_app.

Referenced by parse_options().

int validate_integer_option_value ( int  opt,
int  value 
)
int validate_string_option_value ( int  opt,
char *  value 
)

Referenced by set_string_option_value().


Variable Documentation

Global array of options for CQP.


Generated on Sun Feb 28 18:08:04 2010 for CWB by  doxygen 1.6.1