APG
… an ABNF Parser Generator
|
Public header file for the trace functions. More...
Go to the source code of this file.
Macros | |
#define | TRACE_ASCII 0 |
Identifier for plain ASCII trace record format. More... | |
#define | TRACE_HTML 1 |
Identifier for HTML trace record format. More... | |
Functions | |
Public Tracing Functions | |
These functions are used by the application to construct and configure the trace object. | |
void * | vpTraceCtor (void *vpParserCtx) |
The trace object constructor. More... | |
void | vTraceDtor (void *vpCtx) |
Trace destructor. More... | |
void | vTraceOutputType (void *vpCtx, aint uiType) |
Set the trace record display type. More... | |
void | vTraceSetOutput (void *vpCtx, const char *cpFileName) |
void | vTraceConfig (void *vpCtx, const char *cpFileName) |
Read a configuration file and set the trace configuration accordingly. More... | |
void | vTraceConfigDisplay (void *vpCtx, const char *cpFileName) |
Display the trace object's current configuration. More... | |
void | vTraceConfigGen (void *vpCtx, const char *cpFileName) |
Generate a configuration file for the current parser. More... | |
aint | uiTraceGetRecordCount (void *vpCtx) |
Get the number of traced records, displayed or not. More... | |
Public header file for the trace functions.
Definition in file trace.h.
#define TRACE_ASCII 0 |
#define TRACE_HTML 1 |
aint uiTraceGetRecordCount | ( | void * | vpCtx | ) |
Get the number of traced records, displayed or not.
The trace object may be configured to simply count the number of records that it would have displayed, but not to actually display them. With this function the application can retrieve the record count whether or not they were actually displayed.
vpCtx | Pointer to a valid trace object context returned from vpTraceCtor(). If not valid the application will silently exit with a BAD_CONTEXT exit code. |
void* vpTraceCtor | ( | void * | vpCtx | ) |
The trace object constructor.
vpCtx | Pointer to a valid parser context previously returned from vpParserCtor(). If invalid, application will silently exit with a BAD_CONTEXT exit code. |
void vTraceConfig | ( | void * | vpCtx, |
const char * | cpFileName | ||
) |
Read a configuration file and set the trace configuration accordingly.
vpCtx | Pointer to a valid trace object context returned from vpTraceCtor(). If not valid the application will silently exit with a BAD_CONTEXT exit code. |
cpFileName | Name of the configuration file. Must refer to an existing file. |
Definition at line 143 of file trace-config.c.
void vTraceConfigDisplay | ( | void * | vpCtx, |
const char * | cpFileName | ||
) |
Display the trace object's current configuration.
vpCtx | Pointer to a valid trace object context returned from vpTraceCtor(). If not valid the application will silently exit with a BAD_CONTEXT exit code. |
cpFileName | Name of the file to write the configuration information to. If NULL, displays to stdout. |
Definition at line 387 of file trace-config.c.
void vTraceConfigGen | ( | void * | vpCtx, |
const char * | cpFileName | ||
) |
Generate a configuration file for the current parser.
The configuration requires specific knowledge of the rule and UDT names in the SABNF grammar used to define the parser. The generated file will have commented lines for all possible configuration settings. This will serve as a starting point with all options presented for the user's choices.
vpCtx | Pointer to a valid trace object context returned from vpTraceCtor(). If not valid the application will silently exit with a BAD_CONTEXT exit code. |
cpFileName | Name of the file to write the generated configuration to. If NULL, displays to stdout. |
Definition at line 452 of file trace-config.c.
void vTraceDtor | ( | void * | vpCtx | ) |
Trace destructor.
Note: Distruction of the trace object is optional. The parent parser's destructor, vParserDtor(), will call this function via the macro TRACE_DTOR().
vpCtx | Pointer to a trace context, returned from a previous call to vpTraceCtor(), NULL will be silently ignored. However, non-NULL values must be valid or the application will exit with a BAD_CONTEXT exit code. |
void vTraceOutputType | ( | void * | vpCtx, |
aint | uiType | ||
) |
Set the trace record display type.
Choose between ASCII and HTML output mode.
vpCtx | Pointer to a valid trace object context returned from vpTraceCtor(). If not valid the application will silently exit with a BAD_CONTEXT exit code. |
uiType | One of TRACE_ASCII or TRACE_HTML. |
Definition at line 90 of file trace-config.c.