Version 7.0
Copyright © 2021 Lowell D. Thomas
APG
… an ABNF Parser Generator
Functions
stats.h File Reference

Public header file for the statistics gathering functions. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void * vpStatsCtor (void *vpParserCtx)
 The statistics object constructor. More...
 
void vStatsToHtml (void *vpCtx, const char *cpMode, const char *cpFileName)
 Generates an HTML page displaying the node hit statistics. More...
 
void vStatsToAscii (void *vpCtx, const char *cpMode, const char *cpFileName)
 Display the statistics in ASCII format. More...
 

Detailed Description

Public header file for the statistics gathering functions.

Definition in file stats.h.

Function Documentation

◆ vpStatsCtor()

void* vpStatsCtor ( void *  vpParserCtx)

The statistics object constructor.

  • Note 1. There is no corresponding destructor. This object is destroyed by the parent parser's destructor.
  • Note 2. There is no reset. If the parent parser is run multiple times the statistics will accumulate for the total of all runs.
    Parameters
    vpParserCtxPointer to the parent parser's context. If not valid the application will silently exit with a BAD_CONTEXT exit code.
    Returns
    Pointer to the statistics object's context.

Definition at line 113 of file stats.c.

◆ vStatsToAscii()

void vStatsToAscii ( void *  vpCtx,
const char *  cpMode,
const char *  cpFileName 
)

Display the statistics in ASCII format.

Parameters
vpCtxPointer to a valid statistics context returned from vpStatsCtor() If not valid the application will silently exit with a BAD_CONTEXT exit code.
cpModeName of the display mode.
  • "alphabetical" (or any string beginning with "a" or "A"), rule/udt nodes arranged alphabetically
  • "hit count" (or any string beginning with "h" or "H"), rule/udt nodes arranged descending on hit count
  • defaults to "hit count" if mode is NULL or unrecognized as either of above.
cpFileNameName of the file to write the HTML page to. If NULL, writes to stdout.

Definition at line 412 of file stats.c.

◆ vStatsToHtml()

void vStatsToHtml ( void *  vpCtx,
const char *  cpMode,
const char *  cpFileName 
)

Generates an HTML page displaying the node hit statistics.

Parameters
vpCtxPointer to a valid statistics context returned from vpStatsCtor() If not valid the application will silently exit with a BAD_CONTEXT exit code.
cpModeName of the display mode.
  • "alphabetical" (or any string beginning with "a" or "A"), rule/udt nodes arranged alphabetically
  • "hit count" (or any string beginning with "h" or "H"), rule/udt nodes arranged descending on hit count
  • defaults to "hit count" if mode is NULL or unrecognized as either of above.
cpFileNameName of the file to write the HTML page to. If NULL, writes to stdout.

Definition at line 246 of file stats.c.

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