CWB
Macros | Variables
globals.h File Reference
#include "cl.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <strings.h>
#include <assert.h>
#include <unistd.h>

Macros

#define PATH_SEPARATOR   ':'
 character used to separate different paths in a string variable More...
 
#define SUBDIR_SEPARATOR   '/'
 character used to delimit subdirectories in a path More...
 
#define SUBDIR_SEP_STRING   "/"
 character from SUBDIR_SEPARATOR as a string for compile-time concatenation More...
 
#define TEMPDIR_PATH   "/tmp"
 name of directory for temporary files (as string, absolute path) More...
 
#define TEMP_FILENAME_BUFSIZE   128
 size in bytes of string buffers capable of holding absolute paths of temporary filenames; needs to be big enough for TEMPDIR_PATH plus the result of a call to tempnam() plus the length of a process ID, at least. More...
 
#define VERSION   " x.y.z "
 The current version of CWB. More...
 
#define REGISTRY_DEFAULT_PATH   "/corpora/c1/registry"
 The default path assumed for the location of the corpus registry. More...
 
#define INFOFILE_DEFAULT_NAME   ".info"
 
#define O_BINARY   0
 
#define COMMA_SEP_THOUSANDS_CONVSPEC   "'"
 
#define REGISTRY_ENVVAR   "CORPUS_REGISTRY"
 The environment variable from which the value of the registry will be taken. More...
 
#define MAX_LINE_LENGTH   CL_MAX_LINE_LENGTH
 DEPRACATED synonym for CL_MAX_LINE_LENGTH. More...
 
#define TODO
 Macro which exits the program when a "to do" point is hit. More...
 

Variables

int cl_debug
 global configuration variable: debug level. More...
 
int cl_optimize
 global configuration variable: optimisation. More...
 
size_t cl_memory_limit
 global configuration variable: memory limit. More...
 

Macro Definition Documentation

#define COMMA_SEP_THOUSANDS_CONVSPEC   "'"

Referenced by main().

#define INFOFILE_DEFAULT_NAME   ".info"
#define MAX_LINE_LENGTH   CL_MAX_LINE_LENGTH

DEPRACATED synonym for CL_MAX_LINE_LENGTH.

this is the length of temporary strings which are allocated with a fixed size ... better make it large

#define O_BINARY   0

Referenced by mallocfile(), and mmapfile().

#define PATH_SEPARATOR   ':'

character used to separate different paths in a string variable

Referenced by cl_path_get_component(), find_corpus(), and find_corpus_registry().

#define REGISTRY_DEFAULT_PATH   "/corpora/c1/registry"

The default path assumed for the location of the corpus registry.

Referenced by cl_standard_registry().

#define REGISTRY_ENVVAR   "CORPUS_REGISTRY"

The environment variable from which the value of the registry will be taken.

Referenced by cl_standard_registry().

#define SUBDIR_SEP_STRING   "/"

character from SUBDIR_SEPARATOR as a string for compile-time concatenation

Referenced by check_stamp(), and main().

#define SUBDIR_SEPARATOR   '/'
#define TEMP_FILENAME_BUFSIZE   128

size in bytes of string buffers capable of holding absolute paths of temporary filenames; needs to be big enough for TEMPDIR_PATH plus the result of a call to tempnam() plus the length of a process ID, at least.

Referenced by ComputeGroupExternally(), open_temporary_file(), and SortExternally().

#define TEMPDIR_PATH   "/tmp"

name of directory for temporary files (as string, absolute path)

Referenced by open_temporary_file().

#define TODO
Value:
{(void)fprintf(stderr,"TODO point reached: file \"%s\", line %d\n", \
__FILE__, \
__LINE__); \
exit(1);}

Macro which exits the program when a "to do" point is hit.

#define VERSION   " x.y.z "

The current version of CWB.

This VERSION macro should be defined by the CL's build environment. If it isn't already defined, this definition ensures compilation of the CL, and any programs that use it, won't fail (e.g. if you're test-compiling a single file that contains VERSION).

Referenced by align_usage(), aligndecode_usage(), alignencode_usage(), alignshow_usage(), compressrdx_usage(), cqiserver_welcome(), decode_usage(), describecorpus_usage(), encode_usage(), huffcode_usage(), lexdecode_usage(), main(), makeall_usage(), parse_options(), scancorpus_usage(), sdecode_usage(), and sencode_usage().

Variable Documentation

int cl_debug

global configuration variable: debug level.

Controls how many debug messages are printed.

0 = none (default), 1 = some, 2 = heavy

Referenced by cl_lexhash_check_grow(), cl_new_regex(), cl_ngram_hash_check_grow(), cl_regex2id(), cl_regex_match(), cl_regopt_analyse(), cl_set_debug_level(), creat_rev_corpus(), create_component(), make_jump_table(), and regopt_data_copy_to_regex_object().

size_t cl_memory_limit

global configuration variable: memory limit.

In megabytes; some functions will try to keep to this limit; 0 or less turns the limit off.

(ensure memory limit > 2GB is correctly converted to byte size or number of ints)

Referenced by cl_set_memory_limit(), and creat_rev_corpus().

int cl_optimize

global configuration variable: optimisation.

0 = off, 1 = on (untested / expensive optimisations)

Referenced by cl_regex_match(), and cl_set_optimize().