* xmlCreateNewCatalog: * @type: type of catalog * @prefer: the PUBLIC vs. SYSTEM current preference value * * create a new Catalog, this type is shared both by XML and * SGML catalogs, but the acceptable types values differs. * * Returns the xmlCatalogPtr or NULL in case of error */
| 381 | * Returns the xmlCatalogPtr or NULL in case of error |
| 382 | */ |
| 383 | static xmlCatalogPtr |
| 384 | xmlCreateNewCatalog(xmlCatalogType type, xmlCatalogPrefer prefer) { |
| 385 | xmlCatalogPtr ret; |
| 386 | |
| 387 | ret = (xmlCatalogPtr) xmlMalloc(sizeof(xmlCatalog)); |
| 388 | if (ret == NULL) { |
| 389 | xmlCatalogErrMemory(); |
| 390 | return(NULL); |
| 391 | } |
| 392 | memset(ret, 0, sizeof(xmlCatalog)); |
| 393 | ret->type = type; |
| 394 | ret->catalNr = 0; |
| 395 | ret->catalMax = XML_MAX_SGML_CATA_DEPTH; |
| 396 | ret->prefer = prefer; |
| 397 | if (ret->type == XML_SGML_CATALOG_TYPE) |
| 398 | ret->sgml = xmlHashCreate(10); |
| 399 | return(ret); |
| 400 | } |
| 401 | |
| 402 | /** |
| 403 | * xmlFreeCatalog: |
no test coverage detected