Version 7.0
Copyright © 2021 Lowell D. Thomas
APG
… an ABNF Parser Generator
Macros | Functions
trace-config.c File Reference

Parse a configuration file and set the trace configuration. More...

#include "./apg.h"
#include <time.h>
#include <errno.h>
#include "../utilities/utilities.h"
#include "./parserp.h"
#include "./tracep.h"
Include dependency graph for trace-config.c:

Go to the source code of this file.

Macros

#define BUF_SIZE   512
 

Functions

void vSetDefaultConfig (trace *spTrace)
 Sets the default trace configuration on construction. More...
 
void vTraceOutputType (void *vpCtx, aint uiType)
 Set the trace record display type. More...
 
void vTraceApgexType (void *vpCtx, aint uiType)
 Called only by apgex. Sets the display type for apgex tracing. More...
 
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...
 

Detailed Description

Parse a configuration file and set the trace configuration.

Definition in file trace-config.c.

Macro Definition Documentation

◆ BUF_SIZE

#define BUF_SIZE   512

Definition at line 45 of file trace-config.c.

Function Documentation

◆ vSetDefaultConfig()

void vSetDefaultConfig ( trace spTrace)

Sets the default trace configuration on construction.

Definition at line 56 of file trace-config.c.

◆ vTraceApgexType()

void vTraceApgexType ( void *  vpCtx,
aint  uiType 
)

Called only by apgex. Sets the display type for apgex tracing.

Definition at line 116 of file trace-config.c.

◆ vTraceConfig()

void vTraceConfig ( void *  vpCtx,
const char *  cpFileName 
)

Read a configuration file and set the trace configuration accordingly.

Parameters
vpCtxPointer to a valid trace object context returned from vpTraceCtor(). If not valid the application will silently exit with a BAD_CONTEXT exit code.
cpFileNameName of the configuration file. Must refer to an existing file.

Definition at line 143 of file trace-config.c.

◆ vTraceConfigDisplay()

void vTraceConfigDisplay ( void *  vpCtx,
const char *  cpFileName 
)

Display the trace object's current configuration.

Parameters
vpCtxPointer to a valid trace object context returned from vpTraceCtor(). If not valid the application will silently exit with a BAD_CONTEXT exit code.
cpFileNameName of the file to write the configuration information to. If NULL, displays to stdout.

Definition at line 387 of file trace-config.c.

◆ vTraceConfigGen()

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.

Parameters
vpCtxPointer to a valid trace object context returned from vpTraceCtor(). If not valid the application will silently exit with a BAD_CONTEXT exit code.
cpFileNameName of the file to write the generated configuration to. If NULL, displays to stdout.

Definition at line 452 of file trace-config.c.

◆ vTraceOutputType()

void vTraceOutputType ( void *  vpCtx,
aint  uiType 
)

Set the trace record display type.

Choose between ASCII and HTML output mode.

Parameters
vpCtxPointer to a valid trace object context returned from vpTraceCtor(). If not valid the application will silently exit with a BAD_CONTEXT exit code.
uiTypeOne of TRACE_ASCII or TRACE_HTML.

Definition at line 90 of file trace-config.c.

APG Version 7.0 is licensed under the 2-Clause BSD License,
an Open Source Initiative Approved License.