APG
… an ABNF Parser Generator
|
A message logging object. More...
#include "../library/lib.h"
Go to the source code of this file.
Data Structures | |
struct | msgs |
The message log context. More... | |
Functions | |
void * | vpMsgsCtor (exception *spEx) |
The Message Log constructor. More... | |
void | vMsgsDtor (void *vpCtx) |
The object destructor. More... | |
abool | bMsgsValidate (void *vpCtx) |
Validate a msglog context pointer. More... | |
void | vMsgsClear (void *vpCtx) |
Clears the object of all messages. More... | |
void | vMsgsLog (void *vpCtx, const char *cpMsg) |
Logs a message. More... | |
const char * | cpMsgsFirst (void *vpCtx) |
Get a pointer to the first logged message, if any. More... | |
const char * | cpMsgsNext (void *vpCtx) |
Get a pointer to the next logged message, if any. More... | |
aint | uiMsgsCount (void *vpCtx) |
Get the number of logged messages. More... | |
A message logging object.
This object is a simple, but consistent method for logging multiple messages, whether error messages or warning messages or otherwise, with an iterator for retrieving them.
See vUtilPrintMsgs() for a utility that will display all messages in a message log object.
Definition in file msglog.c.
abool bMsgsValidate | ( | void * | vpCtx | ) |
Validate a msglog context pointer.
vpCtx | A pointer to a possibly valid msglog context previously return from vpMsgsCtor(). |
const char* cpMsgsFirst | ( | void * | vpCtx | ) |
Get a pointer to the first logged message, if any.
Initializes an iterator over the logged messages.
vpCtx | - Pointer to a valid object context, previously returned from vpMsgsCtor(). If not valid the application will silently exit with a BAD_CONTEXT exit code. |
const char* cpMsgsNext | ( | void * | vpCtx | ) |
Get a pointer to the next logged message, if any.
Iterates over the logged messages.
vpCtx | - Pointer to a valid object context, previously returned from vpMsgsCtor(). If not valid the application will silently exit with a BAD_CONTEXT exit code. |
aint uiMsgsCount | ( | void * | vpCtx | ) |
Get the number of logged messages.
vpCtx | - Pointer to a valid object context, previously returned from vpMsgsCtor(). If not valid the application will silently exit with a BAD_CONTEXT exit code. |
void vMsgsClear | ( | void * | vpCtx | ) |
Clears the object of all messages.
Restores it to the same state as a newly created object.
vpCtx | - Pointer to a valid object context, previously returned from vpMsgsCtor(). If not valid the application will silently exit with a BAD_CONTEXT exit code. |
void vMsgsDtor | ( | void * | vpCtx | ) |
The object destructor.
Frees all memory associated with the object. Clears the memory to prevent accidental use of stale pointers.
vpCtx | A valid context pointer returned from a previous call to vpMsgsCtor(). NULL is silently ignored. However, if non-NULL it must be a valid point or the application will silently exit with BAD_CONTEXT exit code. |
void vMsgsLog | ( | void * | vpCtx, |
const char * | cpMsg | ||
) |
Logs a message.
vpCtx | - Pointer to a valid object context, previously returned from vpMsgsCtor(). If not valid the application will silently exit with a BAD_CONTEXT exit code. |
cpMsg | Pointer to a null-terminated message string. |
void* vpMsgsCtor | ( | exception * | spEx | ) |
The Message Log constructor.
Allocates memory and initializes the buffers, vectors and iterators.
spEx | Pointer to a valid exception structure initialized with XCTOR(). If not valid the application will silently exit with a BAD_CONTEXT exit code. |