CWB
Data Structures | Defines | Typedefs | Enumerations | Functions | Variables

options.h File Reference

#include "../cl/globals.h"
#include "concordance.h"

Data Structures

Defines

Typedefs

Enumerations

Functions

Variables


Define Documentation

#define CQP_FALLBACK_PAGER   "more"

Referenced by open_stream().

#define DEFAULT_CONTEXT   25

Default value for the context scope configuration option (counted in characters)

Referenced by set_default_option_values().

#define DEFAULT_HARDBOUNDARY   100

Default value for the HardBoundary configuration option.

#define DEFAULT_LOCAL_PATH_ENV_VAR   "CQP_LOCAL_CORP_DIR"

Referenced by do_save().

#define OPTION_CQP   1

Flag for CQP configuration options: is this visible interactively in CQP?

Referenced by print_option_values().


Typedef Documentation

typedef struct _cqpoption CQPOption

A CQPOption represents a single configuration option for CQP.

It does not actually contain the config-option itself; that is held as a global variable somewhere. Instead, it holds metadata about the config-option, including a pointer to the actual variable.

Note it's possible to have wo CQPOption objects referring to the same actual variable - in this case the two option names in question would be synonymous.

typedef enum _opttype OptType

Labels for the types of CQP option.


Enumeration Type Documentation

matching strategy

Enumerator:
traditional 
shortest_match 
standard_match 
longest_match 
enum _opttype

Labels for the types of CQP option.

Enumerator:
OptInteger 
OptString 
OptBoolean 
OptContext 
enum _which_app
Enumerator:
undef 
cqp 
cqpcl 
cqpserver 

Function Documentation

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:
sName of the option to find (or abbreviation); matched case-insensitively.
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  argc,
char **  argv 
)
void print_option_value ( int  opt)
void print_option_values ( )

Prints out the values of all the CQP configuration options.

References find_option(), _cqpoption::opt_name, OPTION_CQP, print_option_value(), silent, and user_level.

char* set_context_option_value ( char *  opt_name,
char *  sval,
int  ival 
)
char* set_integer_option_value ( char *  opt_name,
int  value 
)

Sets an integer-valued option.

An error string (function-internal constant, do NOT free) is returned if the type of the option does not correspond to the function which is called. Upon success, NULL is returned.

Parameters:
opt_nameThe name of the option to set.
valueIts 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 (function-internal constant, do NOT free) 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_nameThe name of the option to set.
valueIts 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().


Variable Documentation

if true, the CL's debug message setting is set to On.

Referenced by execute_side_effects(), parse_options(), and set_default_option_values().

int auto_save
int autoshow

UI option: show query results after evaluation (otherwise, just print number of matches)

Referenced by after_CorpusCommand(), main(), and parse_options().

FILE* batchfd

Referenced by initialize_cqp(), main(), and parse_options().

int batchmode

set by -f {file} option (don't read ~/.cqprc, then process input from {file})

Referenced by initialize_cqp(), main(), and parse_options().

Child process mode (used by Perl interface (CQP.pm) and by CQPweb (cqp.inc.php))

  • don't automatically read in user's .cqprc and .cqpmacros
  • print CQP version on startup
  • now: output blank line after each command -> SHOULD BE CHANGED
  • command ".EOL.;" prints special line (``-::-EOL-::-''), which parent can use to recognise end of output
  • print message "PARSE ERROR" on STDERR when a parse error occurs (which parent can easily recognise)

This global variable is a Boolean: child process mode on or off.

Referenced by cqp_parse_file(), initialize_cqp(), main(), and parse_options().

filename where CQP command history will be saved

Referenced by addHistoryLine().

changed from 'init_file' because of clash with a # define in {term.h}

Referenced by initialize_cqp(), parse_options(), and set_default_option_values().

Global array of options for CQP.

if true, debug messages are printed when simulating an NFA.

See also:
simulate

Referenced by parse_options(), and simulate().

Query option: unbracketed attribute (attribute matched by "..." patterns)

Referenced by do_SimpleVariableReference(), and do_StringConstraint().

corpus specified with -D {corpus}

Referenced by initialize_cqp(), and parse_options().

enable macros only at user request in case they introduce compatibility problems

Referenced by initialize_cqp(), list_macros(), macro_iterator_next_macro(), parse_options(), and print_macro_definition().

if true, assorted debug messages related to query evaluation are printed

Referenced by calculate_initial_matchlist_1(), eval_bool(), get_label_referenced_position(), get_leaf_value(), get_matched_corpus_positions(), and parse_options().

(option which should not exist) external group command to use

Referenced by ComputeGroupExternally(), and set_default_option_values().

(option which should not exist) external sort command to use

Referenced by set_default_option_values(), and SortExternally().

Query option: use implicit 'within' clause (unless overridden by explicit spec)

Referenced by cqp_run_tab_query(), and parse_options().

int hard_cut

Query option: use hard cut value for all queries (cannot be changed)

Referenced by cqp_run_query().

UI option: highlight match / fields in terminal output? (default = yes)

Referenced by ascii_print_output(), and parse_options().

Boolean: inhibit corpus activations in parser.

Referenced by ActivateCorpus(), parse_options(), and set_default_option_values().

if true, debug messages relating to the initial set of candidate matches are printed.

Referenced by get_corpus_positions(), get_matched_corpus_positions(), parse_options(), and simulate_dfa().

int insecure

Boolean: != 0 means we should not allow pipes etc.

(For example, in CGI.)

Referenced by compute_grouping(), open_input_stream(), open_stream(), parse_options(), and SortSubcorpus().

kwic option: the match start prefix (defaults to '<')

Referenced by print_concordance_line().

UI option: name of environment variable for controlling less charset (usually LESSCHARSET)

Referenced by open_pager().

char* licensee

Referenced by parse_options().

directory where subcorpora are stored (saved & loaded)

Referenced by check_available_corpora(), do_save(), get_fulllocalpath(), load_corpusnames(), parse_options(), save_subcorpus(), and save_unsaved_subcorpora().

int localhost

cqpserver option: accept local connections (loopback) only

Referenced by accept_connection(), main(), parse_options(), and set_default_option_values().

enable debugging of macros (and print macro hash stats on shutdown).

Referenced by expand_macro(), main(), parse_options(), and yy_input_char().

secondary init file for loading macro definitions (not read if macros are disabled)

Referenced by initialize_cqp(), parse_options(), and set_default_option_values().

The matching strategy option: which is implemented as a vstring option with side-effect.

Referenced by execute_side_effects().

char* pager

UI option: pager program to used for paged kwic display.

Referenced by open_stream(), and parse_options().

int paging

UI option: activate/deactivate paging of query results.

Referenced by main(), open_stream(), and parse_options().

int parseonly

if true, queries are only parsed, not evaluated.

Referenced by do_MUQuery(), do_StandardQuery(), and do_TABQuery().

if true, the parser's internal Bison-generated debug setting is turned on.

Referenced by initialize_cqp(), and parse_options().

UI option: pretty-print most of CQP's output (turn off to simplify parsing of CQP output)

Referenced by ascii_print_group(), list_macros(), PrintContextDescriptor(), show_corpora_files1(), and SortSubcorpus().

kwic option: some printing options

Referenced by ParsePrintOptions().

kwic option: string of current printmode

Referenced by execute_side_effects().

kwic option: -> 'cat' prints number of matches in first line (do we need this?)

Referenced by catalog_corpus().

kwic option: show annotations of structures containing match

Referenced by ComputePrintStructures().

cqpserver option: makes CQPserver accept a single connection only

Referenced by accept_connection(), parse_options(), and set_default_option_values().

char* progname

UI option: show progress bar during query execution.

Referenced by ComputeGroupInternally(), do_subset(), evaluate_subset(), evaluate_target(), prepare_do_subset(), simulate(), simulate_dfa(), and sum_freqs().

cqpserver option: safe mode for network/HTTP servers (allow query execution only)

Referenced by do_cqi_cqp_query().

cqpserver option: set for CQPserver's sake to detect attempted query lock violation

Query option: use query optimisation (untested and expensive optimisations)

Referenced by execute_side_effects(), matchfirstpattern(), and set_default_option_values().

char* query_string

query specified on command line (-E {string}, cqpcl only)

Referenced by main(), parse_options(), and set_default_option_values().

(option which should not exist)

Referenced by catalog_corpus(), and parse_options().

char* registry

kwic option: the match end suffix (defaults to '>')

Referenced by print_concordance_line().

save unsaved subcorpora upon exit

Referenced by cqp_parse_file().

if true, the evaltree of a pattern is pretty-printed before the DFA is created.

Referenced by do_SearchPattern(), and parse_options().

cqpserver option: logging (print log messages to standard output)

Referenced by accept_connection(), do_cqi_cqp_query(), main(), and parse_options().

cqpserver option: CQPserver's listening port (if 0, listens on CQI_PORT)

Referenced by main(), parse_options(), and set_default_option_values().

cqpserver option: spawn server and return to caller (for CQI::Server.pm)

Referenced by accept_connection(), parse_options(), and set_default_option_values().

if true, the complete DFA is printed when an EvalEnvironment is displayed

Referenced by parse_options(), and show_environment().

int show_dfa

if true, the regex2dfa module will print out the states of the DFA after it is parsed.

Referenced by parse_options(), and regex2dfa().

if true, the evaluation tree is printed when an EvalEnvironment is displayed

Referenced by parse_options(), and show_environment().

if true, the tree of global contraints is printed when an EvalEnvironment is displayed

Referenced by parse_options(), and show_environment().

if true, the pattern list is printed when an EvalEnvironment is displayed

Referenced by parse_options(), and show_environment().

Doesn't seem to be used anywhere; should show_environment use it? if not, remove? TODO.

Referenced by parse_options().

kwic option: show values of s-attributes as SGML tag attributes in kwic lines

Referenced by get_position_values().

kwic option: show numbers of target anchors in brackets

Referenced by ascii_print_field(), do_attribute_show(), and PrintContextDescriptor().

int silent
int snoop

boolean: expression between {s} ...

{/s} tags is constrained to single {s} region

Referenced by do_XMLTag(), eval_constraint(), and simulate().

int subquery

Query option: use auto-subquery mode.

Referenced by after_CorpusCommand(), and parse_options().

if this AND debug_simulation are true, print extra messages relating to eval environment labels when simulating an NFA.

Referenced by parse_options(), and simulate().

char* tested_pager

UI option: CQP tests if selected pager works & will fall back to "more" if it doesn't.

Referenced by open_pager(), and set_default_option_values().

int timing

UI option: time queries (printed after execution)

Referenced by do_start_timer(), and do_timing().

if true, extra messages are embedded when an evaluation tree is pretty-printed

Referenced by print_booltree().

UI option: use colours for terminal output (experimental)

Referenced by main(), and parse_options().

UI option: use GNU Readline for input line editing if available.

Referenced by main(), and parse_options().

(option which should not exist) use external grouping algorithm

Referenced by ascii_print_group(), and compute_grouping().

(option which should not exist) use external sorting algorithm

Referenced by SortSubcorpus().

(option which should not exist) user level: 0 == normal, 1 == advanced, 2 == expert)

Referenced by ensure_corpus_size(), and print_option_values().

if true, absolutely all messages from the parser get printed (inc Message-level).

Referenced by cqpmessage(), and parse_options().

Controls whether CQP command history is written to file.

Referenced by addHistoryLine(), and yy_input_char().