CWB
|
void* cl_calloc | ( | size_t | nr_of_elements, |
size_t | element_size | ||
) |
safely allocates memory calloc-style.
nr_of_elements | Number of elements to allocate |
element_size | Size of each element |
Referenced by alloc_mblob(), cl_new_int_list(), cl_new_lexhash(), cl_new_string_list(), cl_regex2id(), compute_code_lengths(), evaluate_target(), main(), range_declare(), and validate_revcorp().
void cl_get_rng_state | ( | unsigned int * | i1, |
unsigned int * | i2 | ||
) |
void* cl_malloc | ( | size_t | bytes | ) |
safely allocates memory malloc-style.
This function allocates a block of memory of the requested size, and does a test for malloc() failure which aborts the program and prints an error message if the system is out of memory. So the return value of this function can be used without further testing for malloc() failure.
bytes | Number of bytes to allocate |
Referenced by accessible(), add_corpus_property(), add_grant_to_last_user(), add_host_to_list(), add_hosts_in_subnet_to_list(), add_tabular_pattern(), add_to_string(), add_user_to_list(), AddNameToAL(), alloc_mblob(), Allocate(), attach_subcorpus(), binsert_g(), check_alignment_constraints(), cl_id2cpos_oldstyle(), cl_idlist2cpos_oldstyle(), cl_lexhash_add(), cl_make_set(), cl_new_int_list(), cl_new_lexhash(), cl_new_regex(), cl_new_string_list(), cl_path_registry_quote(), cl_regex2id(), cl_string_latex2iso(), cl_string_qsort_compare(), combine_subcorpus_spec(), compute_code_lengths(), compute_grouping(), ComputeGroupExternally(), CopyS(), cqi_read_bool_list(), cqi_read_byte_list(), cqi_read_int_list(), cqi_read_string(), cqi_read_string_list(), cqp_run_mu_query(), cqp_run_tab_query(), creat_rev_corpus(), creat_rev_corpus_idx(), create_bitfield(), define_macro(), do_cqi_cqp_query(), do_flagged_re_variable(), do_MeetStatement(), do_mval_string(), do_undump(), do_UnionStatement(), do_XMLTag(), duplicate_corpus(), encode_generate_registry_file(), encode_scan_directory(), evaltree2searchstr(), find_corpus_registry(), FormState(), get_leaf_value(), get_matched_corpus_positions(), GetVariableItems(), GetVariableStrings(), hash_add(), initialize_cqp(), labellookup(), list_macros(), LookUp(), macro_iterator_next_prototype(), MacroAddSegment(), MacroHashAdd(), main(), make_attribute_hash(), make_first_tabular_pattern(), make_temp_corpus(), MakeExp(), MakeMacroHash(), mallocfile(), matchfirstpattern(), meet_mu(), mval_string_conversion(), new_reftab(), new_symbol_table(), new_tabulation_item(), NewAttributeList(), NewContextDescriptor(), NewVariable(), open_input_stream(), OptimizeStringConstraint(), parse_macro_name(), PushInputBuffer(), RangeSetop(), RangeSort(), read_mapping(), ReadHCD(), regex2dfa(), set_corpus_matchlists(), set_target(), Setop(), show_corpora_files1(), simulate_dfa(), SL_insert_after_point(), SortExternally(), SortSubcorpus(), SortSubcorpusRandomize(), Store(), strdupto(), try_optimization(), and VariableAddItem().
unsigned int cl_random | ( | void | ) |
Gets a random number.
Part of the CL-internal random number generator.
References RNG_I1, and RNG_I2.
Referenced by cl_runif(), and SortSubcorpusRandomize().
void cl_randomize | ( | void | ) |
Initialises the CL-internal random number generator from the current system time.
References cl_set_seed().
Referenced by initialize_cqp(), and main().
void* cl_realloc | ( | void * | block, |
size_t | bytes | ||
) |
safely reallocates memory.
block | Pointer to the block to be reallocated |
bytes | Number of bytes to allocate to the resized memory block @ return Pointer to the block of reallocated memory |
Referenced by add_to_string(), AddBuf(), AddEquiv(), AddState(), binsert_g(), cl_id2cpos_oldstyle(), cl_int_list_set(), cl_string_list_set(), ComputeGroupExternally(), ComputeGroupInternally(), load_macro_file(), MakeExp(), meet_mu(), NewVariable(), PushQ(), RangeSetop(), read_mapping(), Reallocate(), Setop(), and VariableAddItem().
double cl_runif | ( | void | ) |
Gets a random number in the range [0,1] with uniform distribution.
Part of the CL-internal random number generator.
References cl_random().
Referenced by do_cqi_cqp_query(), and do_reduce().
void cl_set_rng_state | ( | unsigned int | i1, |
unsigned int | i2 | ||
) |
Restores the state of the CL-internal random number generator.
i1 | The value to set the first RNG integer to (if zero, resets it to 1) |
i2 | The value to set the second RNG integer to (if zero, resets it to 1) |
References RNG_I1, and RNG_I2.
Referenced by cl_set_seed(), and SortSubcorpusRandomize().
void cl_set_seed | ( | unsigned int | seed | ) |
Initialises the CL-internal random number generator.
seed | A single 32bit number to use as the seed |
References cl_set_rng_state().
Referenced by cl_randomize().
char* cl_strdup | ( | char * | string | ) |
Safely duplicates a string.
string | Pointer to the original string |
Referenced by add_grant_to_last_user(), add_user_to_list(), AddNameToAL(), after_Query(), assign_temp_to_sub(), att_hash_lookup(), attach_subcorpus(), changecase_string(), cl_corpus_list_attributes(), cl_dynamic_call(), cl_lexhash_add(), cl_make_set(), cl_new_corpus(), cl_path_registry_quote(), cl_string_latex2iso(), cl_string_reverse(), combine_subcorpus_spec(), component_full_name(), compose_kwic_line(), cwbci_check_line(), cwbci_parse_options(), do_XMLTag(), duplicate_corpus(), encode_add_wattr_line(), encode_generate_registry_file(), evaltree2searchstr(), execute_side_effects(), expand_filename(), expand_macro(), get_fulllocalpath(), GetSystemCorpus(), labellookup(), load_corpusnames(), load_macro_file(), LookUp(), MacroHashAdd(), main(), make_temp_corpus(), NewVariable(), open_pager(), open_stream(), parse_options(), print_tabulation(), printAlignedStrings(), range_close(), range_declare(), range_open(), read_mapping(), regopt_data_copy_to_regex_object(), sencode_declare_new_satt(), sencode_parse_line(), set_context_option_value(), set_default_option_values(), SL_insert_after_point(), SortSubcorpus(), split_attribute_spec(), split_subcorpus_spec(), VariableAddItem(), VerifyVariable(), and wattr_declare().
void end_indented_list | ( | void | ) |
Ends the printing of a line in an indented 'tabularised' list.
References ilist_cursor.
Referenced by list_macros(), printSingleVariableValue(), and show_corpora_files1().
void ilist_print_blanks | ( | int | n | ) |
Referenced by print_indented_list_br(), and start_indented_list().
void print_indented_list_br | ( | char * | label | ) |
Starts a new line in an indented 'tabularised' list.
Used when a line break is needed within an indented list; this function starts a new line (as
in HTML), an showing optional label in indentation.
label | The optional label, if this is NULL, no label is used; if it is a string, then the string appears on the far left hand side. |
References ilist_cursor, ilist_indent, and ilist_print_blanks().
Referenced by list_macros(), print_indented_list_item(), and show_corpora_files1().
void print_indented_list_item | ( | char * | string | ) |
Prints an item into an ongoing indented list.
string | The string to print as a list item. |
References ilist_cursor, ilist_linewidth, ilist_tab, and print_indented_list_br().
Referenced by describecorpus_show_attribute_names(), list_macros(), printSingleVariableValue(), and show_corpora_files1().
void progress_bar_child_mode | ( | int | on_off | ) |
Activates or deactivates child (simple) mode for progress_bar.
on_off | The new setting for the progress bar mode, where 1 = simple messages ON STDOUT, 0 = pretty-printed messages with carriage returns ON STDERR |
References progress_bar_simple.
Referenced by parse_options().
void progress_bar_clear_line | ( | void | ) |
Clears the progress bar currently displayed on the terminal.
Note: assumes line width of 60 characters.
References progress_bar_simple.
Referenced by ComputeGroupInternally(), do_subset(), evaluate_target(), prepare_do_subset(), and simulate_dfa().
void progress_bar_message | ( | int | pass, |
int | total, | ||
char * | message | ||
) |
Prints a new progress bar (passes-plus-message format).
The progress bar printed is as follows:
[pass {pass} of {total}: {message}]
If total is equal to zero, the function uses the pass and total values from the last call of this function.
References progress_bar_pass, progress_bar_simple, and progress_bar_total.
Referenced by evaluate_subset(), evaluate_target(), prepare_do_subset(), progress_bar_percentage(), simulate_dfa(), and sum_freqs().
void progress_bar_percentage | ( | int | pass, |
int | total, | ||
int | percentage | ||
) |
Prints a new progress bar (passes-plus-percentage-done format).
The progress bar printed is as follows:
[pass {pass} of {total}: {percentage}% complete]
If total is equal to zero, the function uses the pass and total values from the last call of this function.
References progress_bar_message().
Referenced by ComputeGroupInternally(), evaluate_subset(), evaluate_target(), simulate(), and sum_freqs().
void start_indented_list | ( | int | linewidth, |
int | tabsize, | ||
int | indent | ||
) |
Begins the printing of a line in an indented 'tabularised' list.
This function begins the printing of the first line of an indented If any of the three parameters are zero, this function uses the internal default value for that parameter instead (ILIST macro constants).
linewidth | Width of the line (in characters) |
tabsize | Tabulator steps (in characters) |
indent | Indentation of the list from left margin (in characters) |
References ilist_cursor, ILIST_INDENT, ilist_indent, ILIST_LINEWIDTH, ilist_linewidth, ilist_print_blanks(), ILIST_TAB, and ilist_tab.
Referenced by describecorpus_show_attribute_names(), list_macros(), printSingleVariableValue(), and show_corpora_files1().
int ilist_cursor |
Referenced by end_indented_list(), print_indented_list_br(), print_indented_list_item(), and start_indented_list().
int ilist_indent |
Referenced by print_indented_list_br(), and start_indented_list().
int ilist_linewidth |
Referenced by print_indented_list_item(), and start_indented_list().
int ilist_tab |
Referenced by print_indented_list_item(), and start_indented_list().
int progress_bar_pass = 1 |
Referenced by progress_bar_message().
int progress_bar_simple = 0 |
Referenced by progress_bar_child_mode(), progress_bar_clear_line(), and progress_bar_message().
int progress_bar_total = 1 |
Referenced by progress_bar_message().
unsigned int RNG_I1 = 1234 [static] |
Referenced by cl_get_rng_state(), cl_random(), and cl_set_rng_state().
unsigned int RNG_I2 = 5678 |
Referenced by cl_get_rng_state(), cl_random(), and cl_set_rng_state().