TETware Generic Report Writer |
| grw [-c content] [-f format] [-o out] [-p pagewidth] [-s stylesheet] [journal] |
journal is the path of the input file, i.e. the journal file for which the report is to be generated. If a file name of "-" is specified, or no journal file is given, then grw reads from standard input.
| -c content |
Specify the content and layout of the generated report.
content is one of the following:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -f format |
Specify the document format for the generated report.
The supported values of format are:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -o out | Specify the name of the file to take generated output. "-" indicates standard output. This is also the default. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -p pagewidth | Specify the page width of the generated output, in bytes. The default is 79. (text format only). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -s stylesheet | Specify a URI of a stylesheet to link to in the generated HTML. (chtml and html formats only). |
Running grw with no options is effectively:
grw -c 3 -f chtml -o - -
i.e. read from standard input, write to standard output, produce HTML with colour information, to content level 3.
| 0 | Successful completion. | ||
| 1 | Errors were encountered while producing the report. | ||
| 2 | Invalid options. |
| Component | Source Files | Public Functions | Description |
|---|---|---|---|
| Front-end | main.c | main() | Program entry point. |
| Parser | parser.c | grw_parsejournal() | Parses journal, line by line, and hands parsed line items to handler. |
| Handler | handler.c | grw_beginjournal() grw_handleline() grw_endjournal() |
Controls content and layout of generated document. |
| Formatter | formatter.c formatter.h |
grw_createformatter() grw_begindocument() grw_enddocument() grw_printh1() grw_printh2() grw_printh3() grw_print() grw_starttable() grw_endtable() grw_startrow() grw_endrow() grw_printcell() grw_startcell() grw_endcell() grw_startulist() grw_endulist() grw_printlistentry() grw_breakline() grw_printhline() |
Provides a format independent API for writing documents. Also acts as a layer to perform generic operations for the individual formatters. |
| HTML Formatter | html.c | grw_createhtmlformatter() | Produces HTML. |
| Text Formatter | text.c | grw_createtextformatter() | Produces plain text. |
Remaining source files:
| Source Files | Description |
|---|---|
| grw.h | Overall header file. |
| tet_jrnl.h | Copy of TETware journal defines. |
| utils.c | General utilities, e.g. error handling, memory management. |
| svector.c | String vector code. |
| Information | #define(s) | Source file |
|---|---|---|
| Default document format | DEFAULT_FORMAT | main.c |
| Default content level | DEFAULT_CONTENT | main.c |
| Basic content levels | CONTENT_L1 ... CONTENT_L7 |
handler.c |
| HTML colours | COLOR_.. | html.c |
| Default pagewidth | DEFAULT_PAGEWIDTH | text.c |