mirror of
https://github.com/jezhiggins/arabica
synced 2025-01-29 08:36:45 +01:00
Ensure xmlInitParser is called once, before anything else happens.
This commit is contained in:
parent
d7e2d7fb33
commit
5c455f543f
1 changed files with 10 additions and 1 deletions
|
@ -141,6 +141,11 @@ xmlParserInputPtr lwit_resolveEntity(void* user_data, const xmlChar* publicId, c
|
|||
return p->SAXresolveEntity(publicId, systemId);
|
||||
} // lwit_resolveEntity
|
||||
|
||||
class libxmlInitialiser
|
||||
{
|
||||
public:
|
||||
libxmlInitialiser() { xmlInitParser(); }
|
||||
};
|
||||
|
||||
static xmlSAXHandler saxHandler = {
|
||||
0, // internalSubsetSAXFunc internalSubset;
|
||||
|
@ -178,7 +183,11 @@ static xmlSAXHandler saxHandler = {
|
|||
0 // serror;
|
||||
};
|
||||
|
||||
xmlSAXHandler* lwit_SaxHandler() { return &saxHandler; }
|
||||
xmlSAXHandler* lwit_SaxHandler()
|
||||
{
|
||||
static libxmlInitialiser init;
|
||||
return &saxHandler;
|
||||
}
|
||||
|
||||
void lwit_setFeature(xmlParserCtxtPtr context, const char* name, bool value)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue