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

Declaration for all of the XML Component parser callback functions. More...

#include <limits.h>
#include "../utilities/utilities.h"
#include "xmlgrammar.h"
#include "xml.h"
#include "xmlp.h"
Include dependency graph for callbacks.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define STATE_BEGIN   1
 
#define STATE_TEXT   2
 
#define STATE_WSP   3
 
#define ATT_AMP   38
 
#define ATT_HASH   35
 
#define ATT_X   120
 
#define ATT_SEMI   59
 
#define CABUF_LEN   256
 
#define XML_THROW(msg)   vThrowError(spXml, (msg), spData->uiParserOffset, __LINE__, __FILE__, __func__)
 

Functions

void vThrowError (xml *spXml, const char *cpMsg, aint uiOffset, unsigned int uiLine, const char *cpFile, const char *cpFunc)
 
void vLogMsg (xml *spXml, aint uiOffset, char *cpTitle)
 
void vPushFrame (callback_data *spData)
 
void vPopFrame (callback_data *spData)
 
uint32_t ui2byte (const achar *acpBytes)
 
uint32_t ui3byte (const achar *acpBytes)
 
uint32_t ui4byte (const achar *acpBytes)
 
abool bValidateChar (uint32_t uiChar)
 
void vMakeCDataDisplay (xml *spXml, cdata_id *spDataId, u32_phrase *spCData, aint uiOffset)
 
void vMakeCDataIdFromInput (xml *spXml, const achar *acpInput, aint uiLen, aint uiOffset, cdata_id *spCDataId)
 
cdata_id sCapturePhrase (xml *spXml, achar *acpPhrase, aint uiPhraseLength, aint uiOffset)
 
int iAttComp (const void *vpL, const void *vpR)
 
att_declspLeftMostElement (xml *spXml, att_decl *spAttList)
 
int iEntityComp (const void *vpL, const void *vpR)
 
void vHexValue (callback_data *spData)
 
void vDecValue (callback_data *spData)
 
uint32_t uiDecValue32 (xml *spXml, aint uiOffset, uint32_t *uipChars, uint32_t uiCount)
 
uint32_t uiHexValue32 (xml *spXml, aint uiOffset, uint32_t *uipChars, uint32_t uiCount)
 
abool bHasEntity (uint32_t *uipChars, uint32_t uiLen, uint32_t *uipEntityOffset, uint32_t *uipEntityLen)
 
cdata_id sNormalizeAttributeValue (xml *spXml, aint uiOffset, uint32_t *uipAttValue, uint32_t uiLength, abool bIsCDATA)
 
void vExpandEntity (xml *spXml, aint uiOffset, entity_decl *spValuei)
 
int iSortCompNames (const uint32_t *uipLName, uint32_t uiLLen, const uint32_t *uipRName, uint32_t uiRLen)
 
abool bCompNames (const uint32_t *uipLName, uint32_t uiLLen, const uint32_t *uipRName, uint32_t uiRLen)
 
entity_declspEntityNameLookup (xml *spXml, aint uiOffset, uint32_t *uipName, uint32_t uiNameLen)
 Find the left-most occurrence of the given entity name. More...
 
void vConvertParsedData (xml *spXml, const achar *acpData, aint uiDataLen, uint32_t *uipOffset, uint32_t *uipLength)
 Converts parsed UTF-8 data to UTF-32 code points. More...
 
int iCompNames (const uint32_t *uipLName, uint32_t uiLLen, const uint32_t *uipRName, uint32_t uiRLen)
 
void vDocument (callback_data *spData)
 
void vXmlDeclOpen (callback_data *spData)
 
void vXmlDeclClose (callback_data *spData)
 
void vEncDef (callback_data *spData)
 
void vVersionNum (callback_data *spData)
 
void vVersionInfo (callback_data *spData)
 
void vEncName (callback_data *spData)
 
void vSDeclOther (callback_data *spData)
 
void vSDeclYes (callback_data *spData)
 
void vSDeclNo (callback_data *spData)
 
void vDtdOpen (callback_data *spData)
 
void vDtdName (callback_data *spData)
 
void vDtdClose (callback_data *spData)
 
void vExtSubset (callback_data *spData)
 
void vExternalID (callback_data *spData)
 
void vNExternalID (callback_data *spData)
 
void vPEDeclOpen (callback_data *spData)
 
void vPEDeclClose (callback_data *spData)
 
void vPEReference (callback_data *spData)
 
void vPERefError (callback_data *spData)
 
void vGEDeclName (callback_data *spData)
 
void vGEPERef (callback_data *spData)
 
void vGEDefEx (callback_data *spData)
 
void vGEDeclClose (callback_data *spData)
 
void vCloseQuote (callback_data *spData)
 
void vEntityChar (callback_data *spData)
 
void vGERef (callback_data *spData)
 
void vAttlistOpen (callback_data *spData)
 
void vAttName (callback_data *spData)
 
void vAttType (callback_data *spData)
 
void vAttlistValue (callback_data *spData)
 
void vAttDef (callback_data *spData)
 
void vAttlistClose (callback_data *spData)
 
void vNotationOpen (callback_data *spData)
 
void vNotationDef (callback_data *spData)
 
void vNotationClose (callback_data *spData)
 
void vDvalue (callback_data *spData)
 
void vDChar (callback_data *spData)
 
void vEntityRef (callback_data *spData)
 
void vElementOpen (callback_data *spData)
 
void vElementClose (callback_data *spData)
 
void vETagClose (callback_data *spData)
 
void vEOpen (callback_data *spData)
 
void vEStart (callback_data *spData)
 
void vEReserved (callback_data *spData)
 
void vEmptyClose (callback_data *spData)
 
void vSTagClose (callback_data *spData)
 
void vAttValue (callback_data *spData)
 
void vElAttName (callback_data *spData)
 
void vCharData (callback_data *spData)
 
void vCDSectEnd (callback_data *spData)
 
void vCDEnd (callback_data *spData)
 
void vCDRb (callback_data *spData)
 
void vCD2Rb (callback_data *spData)
 
void vRefClose (callback_data *spData)
 
void vComment (callback_data *spData)
 
void vDoubleh (callback_data *spData)
 
void vPIClose (callback_data *spData)
 
void vPITarget (callback_data *spData)
 
void vPIInfo (callback_data *spData)
 
void vPIInfoq (callback_data *spData)
 
void vPIInfoa (callback_data *spData)
 
void vPIForbidden (callback_data *spData)
 
void vPIReserved (callback_data *spData)
 
void vAscii (callback_data *spData)
 
void vUtf82 (callback_data *spData)
 
void vUtf83 (callback_data *spData)
 
void vUtf84 (callback_data *spData)
 
void vName (callback_data *spData)
 
void vNameStartChar (callback_data *spData)
 
void vNameOtherChar (callback_data *spData)
 

Detailed Description

Declaration for all of the XML Component parser callback functions.

Definition in file callbacks.h.

Macro Definition Documentation

◆ ATT_AMP

#define ATT_AMP   38

Definition at line 47 of file callbacks.h.

◆ ATT_HASH

#define ATT_HASH   35

Definition at line 48 of file callbacks.h.

◆ ATT_SEMI

#define ATT_SEMI   59

Definition at line 50 of file callbacks.h.

◆ ATT_X

#define ATT_X   120

Definition at line 49 of file callbacks.h.

◆ CABUF_LEN

#define CABUF_LEN   256

Definition at line 51 of file callbacks.h.

◆ STATE_BEGIN

#define STATE_BEGIN   1

Definition at line 44 of file callbacks.h.

◆ STATE_TEXT

#define STATE_TEXT   2

Definition at line 45 of file callbacks.h.

◆ STATE_WSP

#define STATE_WSP   3

Definition at line 46 of file callbacks.h.

◆ XML_THROW

#define XML_THROW (   msg)    vThrowError(spXml, (msg), spData->uiParserOffset, __LINE__, __FILE__, __func__)

Definition at line 53 of file callbacks.h.

Function Documentation

◆ bCompNames()

abool bCompNames ( const uint32_t *  uipLName,
uint32_t  uiLLen,
const uint32_t *  uipRName,
uint32_t  uiRLen 
)

Definition at line 676 of file basics.c.

◆ bHasEntity()

abool bHasEntity ( uint32_t *  uipChars,
uint32_t  uiLen,
uint32_t *  uipEntityOffset,
uint32_t *  uipEntityLen 
)

Definition at line 946 of file basics.c.

◆ bValidateChar()

abool bValidateChar ( uint32_t  uiChar)

Definition at line 124 of file basics.c.

◆ iAttComp()

int iAttComp ( const void *  vpL,
const void *  vpR 
)

Definition at line 808 of file basics.c.

◆ iCompNames()

int iCompNames ( const uint32_t *  uipLName,
uint32_t  uiLLen,
const uint32_t *  uipRName,
uint32_t  uiRLen 
)

Definition at line 969 of file basics.c.

◆ iEntityComp()

int iEntityComp ( const void *  vpL,
const void *  vpR 
)

Definition at line 832 of file basics.c.

◆ iSortCompNames()

int iSortCompNames ( const uint32_t *  uipLName,
uint32_t  uiLLen,
const uint32_t *  uipRName,
uint32_t  uiRLen 
)

◆ sCapturePhrase()

cdata_id sCapturePhrase ( xml spXml,
achar acpPhrase,
aint  uiPhraseLength,
aint  uiOffset 
)

Definition at line 192 of file basics.c.

◆ sNormalizeAttributeValue()

cdata_id sNormalizeAttributeValue ( xml spXml,
aint  uiOffset,
uint32_t *  uipAttValue,
uint32_t  uiLength,
abool  bIsCDATA 
)

Definition at line 682 of file basics.c.

◆ spEntityNameLookup()

entity_decl* spEntityNameLookup ( xml spXml,
aint  uiOffset,
uint32_t *  uipName,
uint32_t  uiNameLen 
)

Find the left-most occurrence of the given entity name.

If the list of entity names are alphabetical this binary algorithm will find the given name. If there is more than one identical name in the list, this algorithm will find the left-most occurrence of that name. https://en.wikipedia.org/wiki/Binary_search_algorithm#Procedure_for_finding_the_leftmost_element

Definition at line 645 of file basics.c.

◆ spLeftMostElement()

att_decl* spLeftMostElement ( xml spXml,
att_decl spAttList 
)

Definition at line 606 of file basics.c.

◆ ui2byte()

uint32_t ui2byte ( const achar acpBytes)

Definition at line 101 of file basics.c.

◆ ui3byte()

uint32_t ui3byte ( const achar acpBytes)

Definition at line 108 of file basics.c.

◆ ui4byte()

uint32_t ui4byte ( const achar acpBytes)

Definition at line 116 of file basics.c.

◆ uiDecValue32()

uint32_t uiDecValue32 ( xml spXml,
aint  uiOffset,
uint32_t *  uipChars,
uint32_t  uiCount 
)

Definition at line 581 of file basics.c.

◆ uiHexValue32()

uint32_t uiHexValue32 ( xml spXml,
aint  uiOffset,
uint32_t *  uipChars,
uint32_t  uiCount 
)

Definition at line 544 of file basics.c.

◆ vAscii()

void vAscii ( callback_data spData)

Definition at line 402 of file basics.c.

◆ vAttDef()

void vAttDef ( callback_data spData)

Definition at line 614 of file declarations.c.

◆ vAttlistClose()

void vAttlistClose ( callback_data spData)

Definition at line 666 of file declarations.c.

◆ vAttlistOpen()

void vAttlistOpen ( callback_data spData)

Definition at line 535 of file declarations.c.

◆ vAttlistValue()

void vAttlistValue ( callback_data spData)

Definition at line 600 of file declarations.c.

◆ vAttName()

void vAttName ( callback_data spData)

Definition at line 557 of file declarations.c.

◆ vAttType()

void vAttType ( callback_data spData)

Definition at line 575 of file declarations.c.

◆ vAttValue()

void vAttValue ( callback_data spData)

Definition at line 176 of file elements.c.

◆ vCD2Rb()

void vCD2Rb ( callback_data spData)

Definition at line 388 of file elements.c.

◆ vCDEnd()

void vCDEnd ( callback_data spData)

Definition at line 375 of file elements.c.

◆ vCDRb()

void vCDRb ( callback_data spData)

Definition at line 381 of file elements.c.

◆ vCDSectEnd()

void vCDSectEnd ( callback_data spData)

Definition at line 347 of file elements.c.

◆ vCharData()

void vCharData ( callback_data spData)

Definition at line 341 of file elements.c.

◆ vCloseQuote()

void vCloseQuote ( callback_data spData)

Definition at line 501 of file declarations.c.

◆ vComment()

void vComment ( callback_data spData)

Definition at line 273 of file basics.c.

◆ vConvertParsedData()

void vConvertParsedData ( xml spXml,
const achar acpData,
aint  uiDataLen,
uint32_t *  uipOffset,
uint32_t *  uipLength 
)

Converts parsed UTF-8 data to UTF-32 code points.

At times content is needed and it is necessary to convert the raw UTF-8 input data to internal 32-bit code points.

Parameters
spXmlAn XML context pointer
acpDataPointer to the UTF-8 data to convert. Note that achar may not necessarily be 8-bit characters.
uiDataLenThe number of input characters to convert.
uipOffsetpointer to receive the offset into vpVec32 of the first converted code point
uipLengthPointer to receive the number of 32-bit code points.

Definition at line 234 of file basics.c.

◆ vDChar()

void vDChar ( callback_data spData)

Definition at line 200 of file elements.c.

◆ vDecValue()

void vDecValue ( callback_data spData)

Definition at line 229 of file elements.c.

◆ vDocument()

void vDocument ( callback_data spData)

Definition at line 51 of file declarations.c.

◆ vDoubleh()

void vDoubleh ( callback_data spData)

Definition at line 267 of file basics.c.

◆ vDtdClose()

void vDtdClose ( callback_data spData)

Definition at line 241 of file declarations.c.

◆ vDtdName()

void vDtdName ( callback_data spData)

Definition at line 233 of file declarations.c.

◆ vDtdOpen()

void vDtdOpen ( callback_data spData)

Definition at line 221 of file declarations.c.

◆ vDvalue()

void vDvalue ( callback_data spData)

Definition at line 194 of file elements.c.

◆ vElAttName()

void vElAttName ( callback_data spData)

Definition at line 157 of file elements.c.

◆ vElementClose()

void vElementClose ( callback_data spData)

Definition at line 724 of file declarations.c.

◆ vElementOpen()

void vElementOpen ( callback_data spData)

Definition at line 717 of file declarations.c.

◆ vEmptyClose()

void vEmptyClose ( callback_data spData)

Definition at line 92 of file elements.c.

◆ vEncDef()

void vEncDef ( callback_data spData)

Definition at line 174 of file declarations.c.

◆ vEncName()

void vEncName ( callback_data spData)

Definition at line 180 of file declarations.c.

◆ vEntityChar()

void vEntityChar ( callback_data spData)

Definition at line 507 of file declarations.c.

◆ vEntityRef()

void vEntityRef ( callback_data spData)

Definition at line 209 of file elements.c.

◆ vEOpen()

void vEOpen ( callback_data spData)

Definition at line 74 of file elements.c.

◆ vEReserved()

void vEReserved ( callback_data spData)

Definition at line 85 of file elements.c.

◆ vEStart()

void vEStart ( callback_data spData)

Definition at line 50 of file elements.c.

◆ vETagClose()

void vETagClose ( callback_data spData)

Definition at line 120 of file elements.c.

◆ vExpandEntity()

void vExpandEntity ( xml spXml,
aint  uiOffset,
entity_decl spValuei 
)

Definition at line 855 of file basics.c.

◆ vExternalID()

void vExternalID ( callback_data spData)

Definition at line 375 of file declarations.c.

◆ vExtSubset()

void vExtSubset ( callback_data spData)

Definition at line 367 of file declarations.c.

◆ vGEDeclClose()

void vGEDeclClose ( callback_data spData)

Definition at line 454 of file declarations.c.

◆ vGEDeclName()

void vGEDeclName ( callback_data spData)

Definition at line 417 of file declarations.c.

◆ vGEDefEx()

void vGEDefEx ( callback_data spData)

Definition at line 447 of file declarations.c.

◆ vGEPERef()

void vGEPERef ( callback_data spData)

Definition at line 440 of file declarations.c.

◆ vGERef()

void vGERef ( callback_data spData)

Definition at line 513 of file declarations.c.

◆ vHexValue()

void vHexValue ( callback_data spData)

Definition at line 259 of file elements.c.

◆ vLogMsg()

void vLogMsg ( xml spXml,
aint  uiOffset,
char *  cpTitle 
)

Definition at line 61 of file basics.c.

◆ vMakeCDataDisplay()

void vMakeCDataDisplay ( xml spXml,
cdata_id spDataId,
u32_phrase spCData,
aint  uiOffset 
)

Definition at line 156 of file basics.c.

◆ vMakeCDataIdFromInput()

void vMakeCDataIdFromInput ( xml spXml,
const achar acpInput,
aint  uiLen,
aint  uiOffset,
cdata_id spCDataId 
)

Definition at line 167 of file basics.c.

◆ vName()

void vName ( callback_data spData)

Definition at line 426 of file basics.c.

◆ vNameOtherChar()

void vNameOtherChar ( callback_data spData)

Definition at line 503 of file basics.c.

◆ vNameStartChar()

void vNameStartChar ( callback_data spData)

Definition at line 432 of file basics.c.

◆ vNExternalID()

void vNExternalID ( callback_data spData)

Definition at line 382 of file declarations.c.

◆ vNotationClose()

void vNotationClose ( callback_data spData)

Definition at line 710 of file declarations.c.

◆ vNotationDef()

void vNotationDef ( callback_data spData)

Definition at line 697 of file declarations.c.

◆ vNotationOpen()

void vNotationOpen ( callback_data spData)

Definition at line 675 of file declarations.c.

◆ vPEDeclClose()

void vPEDeclClose ( callback_data spData)

Definition at line 396 of file declarations.c.

◆ vPEDeclOpen()

void vPEDeclOpen ( callback_data spData)

Definition at line 390 of file declarations.c.

◆ vPEReference()

void vPEReference ( callback_data spData)

Definition at line 402 of file declarations.c.

◆ vPERefError()

void vPERefError ( callback_data spData)

Definition at line 408 of file declarations.c.

◆ vPIClose()

void vPIClose ( callback_data spData)

Definition at line 332 of file basics.c.

◆ vPIForbidden()

void vPIForbidden ( callback_data spData)

Definition at line 383 of file basics.c.

◆ vPIInfo()

void vPIInfo ( callback_data spData)

Definition at line 360 of file basics.c.

◆ vPIInfoa()

void vPIInfoa ( callback_data spData)

Definition at line 376 of file basics.c.

◆ vPIInfoq()

void vPIInfoq ( callback_data spData)

Definition at line 367 of file basics.c.

◆ vPIReserved()

void vPIReserved ( callback_data spData)

Definition at line 389 of file basics.c.

◆ vPITarget()

void vPITarget ( callback_data spData)

Definition at line 346 of file basics.c.

◆ vPopFrame()

void vPopFrame ( callback_data spData)

Definition at line 86 of file basics.c.

◆ vPushFrame()

void vPushFrame ( callback_data spData)

Definition at line 77 of file basics.c.

◆ vRefClose()

void vRefClose ( callback_data spData)

Definition at line 737 of file declarations.c.

◆ vSDeclNo()

void vSDeclNo ( callback_data spData)

Definition at line 207 of file declarations.c.

◆ vSDeclOther()

void vSDeclOther ( callback_data spData)

Definition at line 194 of file declarations.c.

◆ vSDeclYes()

void vSDeclYes ( callback_data spData)

Definition at line 200 of file declarations.c.

◆ vSTagClose()

void vSTagClose ( callback_data spData)

Definition at line 103 of file elements.c.

◆ vThrowError()

void vThrowError ( xml spXml,
const char *  cpMsg,
aint  uiOffset,
unsigned int  uiLine,
const char *  cpFile,
const char *  cpFunc 
)

Definition at line 47 of file basics.c.

◆ vUtf82()

void vUtf82 ( callback_data spData)

Definition at line 408 of file basics.c.

◆ vUtf83()

void vUtf83 ( callback_data spData)

Definition at line 414 of file basics.c.

◆ vUtf84()

void vUtf84 ( callback_data spData)

Definition at line 420 of file basics.c.

◆ vVersionInfo()

void vVersionInfo ( callback_data spData)

Definition at line 152 of file declarations.c.

◆ vVersionNum()

void vVersionNum ( callback_data spData)

Definition at line 158 of file declarations.c.

◆ vXmlDeclClose()

void vXmlDeclClose ( callback_data spData)

Definition at line 86 of file declarations.c.

◆ vXmlDeclOpen()

void vXmlDeclOpen ( callback_data spData)

Definition at line 69 of file declarations.c.

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