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

Function xmlLoadCatalog

ThirdParty/libxml2/vtklibxml2/catalog.c:3134–3160  ·  view source on GitHub ↗

* xmlLoadCatalog: * @filename: a file path * * Load the catalog and makes its definitions effective for the default * external entity loader. It will recurse in SGML CATALOG entries. * this function is not thread safe, catalog initialization should * preferably be done once at startup * * Returns 0 in case of success -1 in case of error */

Source from the content-addressed store, hash-verified

3132 * Returns 0 in case of success -1 in case of error
3133 */
3134int
3135xmlLoadCatalog(const char *filename)
3136{
3137 int ret;
3138 xmlCatalogPtr catal;
3139
3140 if (!xmlCatalogInitialized)
3141 xmlInitializeCatalogData();
3142
3143 xmlRMutexLock(xmlCatalogMutex);
3144
3145 if (xmlDefaultCatalog == NULL) {
3146 catal = xmlLoadACatalog(filename);
3147 if (catal == NULL) {
3148 xmlRMutexUnlock(xmlCatalogMutex);
3149 return(-1);
3150 }
3151
3152 xmlDefaultCatalog = catal;
3153 xmlRMutexUnlock(xmlCatalogMutex);
3154 return(0);
3155 }
3156
3157 ret = xmlExpandCatalog(xmlDefaultCatalog, filename);
3158 xmlRMutexUnlock(xmlCatalogMutex);
3159 return(ret);
3160}
3161
3162/**
3163 * xmlLoadCatalogs:

Callers 3

xmlLoadCatalogsFunction · 0.85
testThreadFunction · 0.85
mainFunction · 0.85

Calls 5

xmlInitializeCatalogDataFunction · 0.85
xmlRMutexLockFunction · 0.85
xmlLoadACatalogFunction · 0.85
xmlRMutexUnlockFunction · 0.85
xmlExpandCatalogFunction · 0.85

Tested by 1

testThreadFunction · 0.68