13#if USE_SQUID_ESI && HAVE_LIBEXPAT
26 void finalizeConfig()
override
32 std::unique_ptr<ESIParser::Register> registration;
41ESIExpatParser::ESIExpatParser(
ESIParserClient *aClient) : theClient (aClient)
44 p = XML_ParserCreateNS(
nullptr,
'|');
45 XML_SetUserData (myParser(),
static_cast<void *
>(
this));
46 XML_SetElementHandler(myParser(),
Start, End);
47 XML_SetDefaultHandler(myParser(), Default);
48 XML_SetCommentHandler(myParser(), Comment);
49 XML_UseParserAsHandlerArg(myParser());
52ESIExpatParser::~ESIExpatParser()
54 XML_ParserFree (myParser());
61 XML_Parser parser =
static_cast<XML_Parser
>(data);
62 ESIExpatParser *me = (ESIExpatParser *)XML_GetUserData(parser);
63 me->theClient->start (el, attr, XML_GetSpecifiedAttributeCount (parser));
67ESIExpatParser::End(
void *data,
const XML_Char *el)
69 XML_Parser parser =
static_cast<XML_Parser
>(data);
70 ESIExpatParser *me = (ESIExpatParser *)XML_GetUserData(parser);
71 me->theClient->end (el);
75ESIExpatParser::Default(
void *data,
const XML_Char *s,
int len)
77 XML_Parser parser =
static_cast<XML_Parser
>(data);
78 ESIExpatParser *me = (ESIExpatParser *)XML_GetUserData(parser);
79 me->theClient->parserDefault (s, len);
83ESIExpatParser::Comment(
void *data,
const XML_Char *s)
85 XML_Parser parser =
static_cast<XML_Parser
>(data);
86 ESIExpatParser *me = (ESIExpatParser *)XML_GetUserData(parser);
87 me->theClient->parserComment (s);
93 return XML_Parse(myParser(), dataToParse, lengthOfData, endOfStream);
97ESIExpatParser::lineNumber()
const
99 return (
long int)XML_GetCurrentLineNumber(myParser());
103ESIExpatParser::errorString()
const
105 return XML_ErrorString(XML_GetErrorCode(myParser()));
#define DefineRunnerRegistratorIn(Namespace, ClassName)
#define EsiParserDefinition(ThisClass)
ESI protocol types and operators.
void Start(const Comm::ConnectionPointer &conn, IDCB *callback, void *cbdata)
static struct node * parse(FILE *fp)