#ifndef __DOCUMENT_H__ #ifdef HAVE_ERROR_H #include #endif #include #include #define __DOCUMENT_H__ #include #define LINE_LENGTH 1024 typedef enum index_type { IDX_RELATIVE, IDX_ABSOLUTE, IDX_REGEX } idxt; typedef struct indexd { idxt index_type; int page_no; int line_no; int start_char; int stop_char; int suppress_spaces; int suppress_duplicates; int reparent; /* Means number of levels to reparent now */ char *format; char *regstring; regex_t regcomp; char *last_index; int indexid; } indexd; typedef struct document { int width; int height; int chars_per_line; int lines_per_page; int ignore_form_feed; float left_margin; float top_margin; float image_scale_x; float image_scale_y; float image_dpi; char *image_filename; int image_id; char *font_face; int font_index; float font_size; char *background_image; int index_count; indexd *index_def; PDF *pdf; char *output_filename; int page_count; int line_count; int default_reparent; int total_line_count; char *title; char *author; char *subject; char *input_filename; char *extra_key; char *extra_data; int strip_non_printable; char line[ LINE_LENGTH ]; } document; int document_init( document *d ); int document_start( document *d ); int document_add_index( document *d, const indexd *i ); int document_addline( document *d, const char *line ); int document_end( document *d ); int document_do_index( document *d, indexd *i, const char *line, int parentid, int depth ); int document_set_page( document *d, const char *ptype ); #endif