MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlInitParser

Function xmlInitParser

ThirdParty/libxml2/vtklibxml2/threads.c:568–602  ·  view source on GitHub ↗

* xmlInitParser: * * Initialization function for the XML parser. * * Call once from the main thread before using the library in * multithreaded programs. */

Source from the content-addressed store, hash-verified

566 * multithreaded programs.
567 */
568void
569xmlInitParser(void) {
570 /*
571 * Note that the initialization code must not make memory allocations.
572 */
573 if (xmlParserInitialized != 0)
574 return;
575
576 xmlGlobalInitMutexLock();
577
578 if (xmlParserInnerInitialized == 0) {
579#if defined(_WIN32) && \
580 !defined(LIBXML_THREAD_ALLOC_ENABLED) && \
581 (!defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL))
582 if (xmlFree == free)
583 atexit(xmlCleanupParser);
584#endif
585
586 xmlInitRandom(); /* Required by xmlInitGlobalsInternal */
587 xmlInitMemoryInternal();
588 xmlInitGlobalsInternal();
589 xmlInitDictInternal();
590 xmlInitEncodingInternal();
591#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
592 xmlInitXPathInternal();
593#endif
594 xmlInitIOCallbacks();
595
596 xmlParserInnerInitialized = 1;
597 }
598
599 xmlGlobalInitMutexUnlock();
600
601 xmlParserInitialized = 1;
602}
603
604/**
605 * xmlCleanupParser:

Callers 15

xmlInitializeDictFunction · 0.85
xmlDictCreateFunction · 0.85
xmlMemMallocFunction · 0.85
xmlMemReallocFunction · 0.85
xmlMemoryStrdupFunction · 0.85
xmlInitMemoryFunction · 0.85
initializeLibxml2Function · 0.85
xmlXPathInitFunction · 0.85
xmlXPathCtxtCompileFunction · 0.85
xmlXPathEvalFunction · 0.85
htmlNewSAXParserCtxtFunction · 0.85

Calls 9

xmlGlobalInitMutexLockFunction · 0.85
xmlInitRandomFunction · 0.85
xmlInitMemoryInternalFunction · 0.85
xmlInitGlobalsInternalFunction · 0.85
xmlInitDictInternalFunction · 0.85
xmlInitEncodingInternalFunction · 0.85
xmlInitXPathInternalFunction · 0.85
xmlInitIOCallbacksFunction · 0.85
xmlGlobalInitMutexUnlockFunction · 0.85

Tested by 2

initializeLibxml2Function · 0.68
testThreadFunction · 0.68