CWB
|
Enumeration specifying different types of redirectable (error) messages & warnings.
More...typedef enum _msgtype MessageType |
Enumeration specifying different types of redirectable (error) messages & warnings.
typedef struct _TabulationItem * TabulationItem |
TabulationItem object: contains the data structures needed by CQP's "tabulate" command.
Note that TabulationItem is typedefed as a pointer-to-structure.
enum _msgtype |
void append_tabulation_item | ( | TabulationItem | item | ) |
append tabulation item to end of current list
References _TabulationItem::next, and TabulationList.
void catalog_corpus | ( | CorpusList * | cl, |
struct Redir * | rd, | ||
int | first, | ||
int | last, | ||
PrintMode | mode | ||
) |
prints matches #first..last; use (0,-1) for entire corpus
References access_corpus(), bp_signal_handler(), broken_pipe, CD, TCorpus::charset, close_stream(), cl::corpus, cqpmessage(), _Range::end, Error, False, GlobalPrintMode, GlobalPrintOptions, handle_sigpipe, Redir::is_paging, Redir::is_pipe, Redir::mode, Redir::name, open_stream(), print_corpus_info_header(), _print_option_rec_::print_header, print_output(), PrintASCII, PrintBINARY, PrintHTML, printNrMatches, cl::range, rangeoutput, cl::size, _Range::start, Redir::stream, True, and verify_context_descriptor().
Referenced by after_CorpusCommand(), and do_cat().
int close_input_stream | ( | struct InputRedir * | rd | ) |
References InputRedir::is_pipe, and InputRedir::stream.
Referenced by do_undump().
int close_stream | ( | struct Redir * | rd | ) |
Closes the stream within a Redir structure.
rd | The Redir stream to close. |
References Redir::is_pipe, and Redir::stream.
Referenced by catalog_corpus(), corpus_info(), do_dump(), print_group(), print_tabulation(), PrintContextDescriptor(), and SortSubcorpus().
void corpus_info | ( | CorpusList * | cl | ) |
Outputs a blob of information on the mother-corpus of the specified cl.
References ascii, buf, TCorpus::charset, cl_charset_name(), cl_corpus_property(), cl_first_corpus_property(), CL_MAX_LINE_LENGTH, cl_next_corpus_property(), close_stream(), cl::corpus, corpus_info(), cqpmessage(), findcorpus(), Info, TCorpus::info_file, cl::mother_name, cl::mother_size, cl::name, open_file(), open_stream(), TCorpusProperty::property, Redir::stream, SYSTEM, cl::type, unknown_charset, TCorpusProperty::value, and Warning.
Referenced by corpus_info(), and do_info().
void cqpmessage | ( | MessageType | type, |
char * | format, | ||
... | |||
) |
Print a message to output (for instance a debug message).
type | Specifies what type of message (messages of some types are not always printed) |
format | Format string (and ...) are passed as arguments to vfprintf(). |
References Error, Info, Message, silent, verbose_parser, and Warning.
Referenced by ActivateCorpus(), add_host_to_list(), add_hosts_in_subnet_to_list(), add_user_to_list(), addHistoryLine(), after_CorpusSetExpr(), attach_subcorpus(), calculate_initial_matchlist_1(), call_predefined_function(), catalog_corpus(), check_alignment_constraints(), check_labels(), compute_grouping(), ComputeGroupExternally(), ComputeGroupInternally(), ComputePrintStructures(), copy_intervals(), corpus_info(), cqp_parse_string(), cqp_run_mu_query(), define_macro(), do_AddSubVariables(), do_AnchorPoint(), do_attribute_show(), do_cat(), do_cut(), do_delete_lines(), do_delete_lines_num(), do_Description(), do_dump(), do_exec(), do_flagged_re_variable(), do_flagged_string(), do_IDReference(), do_LabelReference(), do_MUQuery(), do_mval_string(), do_NamedWfPattern(), do_OptDistance(), do_printVariableSize(), do_PrintVariableValue(), do_reduce(), do_RelExpr(), do_save(), do_SearchPattern(), do_setop(), do_SetVariableValue(), do_SimpleVariableReference(), do_StandardQuery(), do_StringConstraint(), do_StructuralContext(), do_timing(), do_undump(), do_WordformPattern(), do_XMLTag(), duplicate_corpus(), ensure_corpus_size(), eval_bool(), evaluate_subset(), evaluate_target(), execute_side_effects(), expand_dataspace(), expand_macro(), field_type_to_name(), findcorpus(), FunctionCall(), get_leaf_value(), in_CorpusCommand(), in_UnnamedCorpusCommand(), init_macros(), initialize_cqp(), install_signal_handler(), load_corpusnames(), load_macro_file(), MacroHashAdd(), MacroHashDelete(), MacroHashLookup(), matchfirstpattern(), mval_string_conversion(), open_stream(), OptimizeStringConstraint(), prepare_AlignmentConstraints(), prepare_do_subset(), prepare_parse(), prepare_Query(), print_concordance_line(), print_group(), print_macro_definition(), print_output(), print_tabulation(), pt_validate_anchor(), push_regchr(), RangeSort(), save_subcorpus(), save_unsaved_subcorpora(), set_reftab(), set_target(), SetVariableValue(), simulate(), simulate_dfa(), SortExternally(), SortSubcorpus(), SortSubcorpusRandomize(), string_to_strategy(), Varref2IDList(), verify_context_descriptor(), and yy_input_char().
void free_tabulation_list | ( | void | ) |
free global list of tabulation items (before building new one)
References _TabulationItem::attribute_name, cl_free, _TabulationItem::next, and TabulationList.
Referenced by print_tabulation().
TabulationItem new_tabulation_item | ( | void | ) |
allocate and initialize new tabulation item
References _TabulationItem::anchor1, _TabulationItem::anchor2, ATT_NONE, _TabulationItem::attribute, _TabulationItem::attribute_name, _TabulationItem::attribute_type, cl_malloc(), _TabulationItem::flags, _TabulationItem::next, NoField, _TabulationItem::offset1, and _TabulationItem::offset2.
FILE* open_file | ( | char * | name, |
char * | mode | ||
) |
This function is a wrapper round fopen() which provides checks for different shorthands for a "home" directory, such as ~ or $HOME.
Its arguments and return values are the same as fopen().
References CL_MAX_FILENAME_LENGTH.
Referenced by addHistoryLine(), attach_subcorpus(), check_stamp(), corpus_info(), do_exec(), open_input_stream(), open_stream(), parse_options(), save_subcorpus(), and SetVariableValue().
int open_input_stream | ( | struct InputRedir * | rd | ) |
References cl_free, cl_malloc(), False, insecure, InputRedir::is_pipe, InputRedir::name, open_file(), InputRedir::stream, and True.
Referenced by do_undump().
int open_stream | ( | struct Redir * | rd, |
CorpusCharset | charset | ||
) |
Open the stream within a Redir structure.
rd | Redir structure to be opened. |
charset | The charset to be used. Only has an effect if the stream to be opened is to an output pager. |
References cl_strdup(), CQP_FALLBACK_PAGER, cqpmessage(), Error, False, insecure, Redir::is_paging, Redir::is_pipe, Redir::mode, Redir::name, open_file(), open_pager(), pager, paging, set_integer_option_value(), set_string_option_value(), Redir::stream, True, and Warning.
Referenced by catalog_corpus(), corpus_info(), do_dump(), print_group(), print_tabulation(), PrintContextDescriptor(), and SortSubcorpus().
FILE* open_temporary_file | ( | char * | tmp_name_buffer | ) |
Creates, and opens for text-mode write, a temporary file.
Temporary files have the prefix "$PID.cqpt." (where $PID = the process ID of this copy of CQP) and are placed in the directory defined as TEMPDIR_PATH.
tmp_nam_buffer | A pre-allocated buffer which will be overwritten with the name of the temporary file. This should be at least TEMP_FILENAME_BUFSIZE bytes in size. If opening is unsuccessful, this will be set to "". |
References cl_free, and TEMPDIR_PATH.
Referenced by ComputeGroupExternally(), and SortExternally().
void print_corpus_info_header | ( | CorpusList * | cl, |
FILE * | stream, | ||
PrintMode | mode, | ||
int | force | ||
) |
void print_output | ( | CorpusList * | cl, |
FILE * | fd, | ||
int | interactive, | ||
ContextDescriptor * | cd, | ||
int | first, | ||
int | last, | ||
PrintMode | mode | ||
) |
References ascii_print_output(), cqpmessage(), Error, html_print_output(), latex_print_output(), PrintASCII, PrintHTML, PrintLATEX, PrintSGML, and sgml_print_output().
Referenced by catalog_corpus().
int print_tabulation | ( | CorpusList * | cl, |
int | first, | ||
int | last, | ||
struct Redir * | rd | ||
) |
References _TabulationItem::anchor1, _TabulationItem::anchor2, ATT_NONE, ATT_POS, ATT_STRUC, _TabulationItem::attribute, _TabulationItem::attribute_name, _TabulationItem::attribute_type, TCorpus::charset, cl_cpos2str(), cl_cpos2struc2str(), cl_free, cl_new_attribute, cl_strdup(), cl_string_canonical(), cl_struc_values(), close_stream(), cl::corpus, cqpmessage(), Error, _TabulationItem::flags, free_tabulation_list(), last, cl::name, _TabulationItem::next, _TabulationItem::offset1, _TabulationItem::offset2, open_stream(), pt_get_anchor_cpos(), pt_validate_anchor(), cl::size, Redir::stream, and TabulationList.
int broken_pipe |
Referenced by ascii_print_output(), bp_signal_handler(), catalog_corpus(), html_print_output(), latex_print_output(), and sgml_print_output().
Global list of tabulation items for use with the "tabulate" operator.
Referenced by append_tabulation_item(), free_tabulation_list(), and print_tabulation().