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

Function xmlFindHandler

ThirdParty/libxml2/vtklibxml2/encoding.c:1731–1763  ·  view source on GitHub ↗

* xmlFindHandler: * @name: a string describing the char encoding. * @output: boolean, use handler for output * @out: pointer to resulting handler * * Search all handlers for an exact match. * * Returns 0 on success, 1 if no handler was found, -1 if a memory * allocation failed. */

Source from the content-addressed store, hash-verified

1729 * allocation failed.
1730 */
1731static int
1732xmlFindHandler(const char *name, int output, xmlCharEncodingHandler **out) {
1733 int i;
1734
1735 /*
1736 * Check for default handlers
1737 */
1738 for (i = 0; i < (int) NUM_DEFAULT_HANDLERS; i++) {
1739 xmlCharEncodingHandler *handler;
1740
1741 handler = (xmlCharEncodingHandler *) &defaultHandlers[i];
1742
1743 if (xmlStrcasecmp((const xmlChar *) name,
1744 (const xmlChar *) handler->name) == 0) {
1745 if (output) {
1746 if (handler->output != NULL) {
1747 *out = handler;
1748 return(0);
1749 }
1750 } else {
1751 if (handler->input != NULL) {
1752 *out = handler;
1753 return(0);
1754 }
1755 }
1756 }
1757 }
1758
1759 /*
1760 * Check for other handlers
1761 */
1762 return(xmlFindExtraHandler(name, output, out));
1763}
1764
1765/**
1766 * xmlLookupCharEncodingHandler:

Callers 1

Calls 2

xmlStrcasecmpFunction · 0.85
xmlFindExtraHandlerFunction · 0.85

Tested by

no test coverage detected