* xmlRegisterCharEncodingHandler: * @handler: the xmlCharEncodingHandlerPtr handler block * * Register the char encoding handler, surprising, isn't it ? */
| 1465 | * Register the char encoding handler, surprising, isn't it ? |
| 1466 | */ |
| 1467 | void |
| 1468 | xmlRegisterCharEncodingHandler(xmlCharEncodingHandlerPtr handler) { |
| 1469 | if (handler == NULL) |
| 1470 | return; |
| 1471 | if (handlers == NULL) { |
| 1472 | handlers = xmlMalloc(MAX_ENCODING_HANDLERS * sizeof(handlers[0])); |
| 1473 | if (handlers == NULL) |
| 1474 | goto free_handler; |
| 1475 | } |
| 1476 | |
| 1477 | if (nbCharEncodingHandler >= MAX_ENCODING_HANDLERS) |
| 1478 | goto free_handler; |
| 1479 | handlers[nbCharEncodingHandler++] = handler; |
| 1480 | return; |
| 1481 | |
| 1482 | free_handler: |
| 1483 | if (handler != NULL) { |
| 1484 | if (handler->name != NULL) { |
| 1485 | xmlFree(handler->name); |
| 1486 | } |
| 1487 | xmlFree(handler); |
| 1488 | } |
| 1489 | } |
| 1490 | |
| 1491 | #ifdef LIBXML_ICONV_ENABLED |
| 1492 | static int |
no outgoing calls
no test coverage detected