cwb-check-input.c File Reference

#include <glib-2.0/glib.h>
#include "../cl/globals.h"
#include "../cl/list.h"

Defines

Functions

Variables


Define Documentation

#define MAX_INPUT_LINE_LENGTH   65536

Input buffer size: copied from cwb-encode.

Referenced by cwbci_check_line(), get_input_line(), and main().


Function Documentation

int cwbci_begins_with_blank ( char *  str  ) 

Function for inner-loop in cwbci_check_lin().

IMPORTANT NOTE: if to be used elsewhere will need adapting, because it assumes all utf8 is well-validated and that blanks will be deleted from the line, starting with the first character.

References charset, and utf8.

Referenced by cwbci_check_line().

void cwbci_check_line ( char *  line  ) 
int cwbci_encoding_ok ( char *  str  ) 

checks whether the encoding of a given string is OK.

(Maybe move to the CL later?? in which case the charset should be a parameter, as a global variable cannot be assumed in all programs.) Returns boolean.

References ascii, charset, latin1, and utf8.

Referenced by cwbci_check_line().

void cwbci_file_write_abort ( void   ) 

convenience function with which to abort the program if file-write fails.

References input_fd, output_fd, and output_file.

Referenced by cwbci_check_line().

int cwbci_is_wordchar ( char  c  ) 

Referenced by cwbci_check_line().

void cwbci_parse_options ( int  argc,
char **  argv 
)
void cwbci_report_error_fixable ( char *  msg  ) 
void cwbci_report_error_unfixable ( char *  msg  ) 
void cwbci_usage ( void   ) 

References progname.

Referenced by cwbci_parse_options().

int main ( int  argc,
char **  argv 
)

Variable Documentation

char* charset_label = "ascii"

label of character set used for checking encoding

Referenced by cwbci_parse_options().

int check_nesting = 0

check perfect nesting of XML?

Referenced by cwbci_check_line(), and cwbci_parse_options().

int errors_detected = 0

number of errors found so far

Referenced by cwbci_report_error_fixable(), cwbci_report_error_unfixable(), and main().

first p-att line established number of tags; anything that deviates then counts as an error

Referenced by cwbci_check_line().

string list for keeping track of the XML hierarchy

FILE* input_fd = NULL

file handle for the input file

Referenced by cwbci_file_write_abort(), do_show(), get_input_line(), and main().

char* input_file = NULL

filename of the input file

Referenced by cwbci_parse_options(), and main().

int line_no = 0

line number of the line in the input file currently being checked; first == 1

Referenced by cwbci_report_error_fixable(), cwbci_report_error_unfixable(), and main().

FILE* output_fd = NULL

file handle for the output file; also used for boolean tests on whether we are repairing or not

Referenced by cwbci_check_line(), cwbci_file_write_abort(), and main().

char* output_file = NULL

filename of the output file

Referenced by cwbci_file_write_abort(), cwbci_parse_options(), main(), and parse_options().

deduced from mode, silent & verbose

Referenced by cwbci_parse_options(), and cwbci_report_error_fixable().

deduced from mode, silent & verbose

Referenced by cwbci_parse_options(), and cwbci_report_error_unfixable().

char* progname = NULL

name of the currently running program

int silent = 0

hide messages

check for empty lines

Referenced by cwbci_check_line(), cwbci_parse_options(), main(), and parse_options().

int strip_blanks = 0

check for leading and trailing blanks in input and token annotations?

Referenced by addline(), cwbci_check_line(), cwbci_parse_options(), main(), open_range(), and parse_options().

int verbose = 0

show messages about fixable errors in repair mode

int xml_aware = 0

ignore <? and <! lines

Referenced by addline(), cwbci_check_line(), cwbci_parse_options(), main(), and parse_options().


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