Home | History | Annotate | Download | only in libxml2

Lines Matching defs:handler

1302  * parser internals, so the default encoding handler is NULL
1321 xmlCharEncodingHandlerPtr handler;
1354 * allocate and fill-up an handler block.
1356 handler = (xmlCharEncodingHandlerPtr)
1358 if (handler == NULL) {
1363 memset(handler, 0, sizeof(xmlCharEncodingHandler));
1364 handler->input = input;
1365 handler->output = output;
1366 handler->name = up;
1369 handler->iconv_in = NULL;
1370 handler->iconv_out = NULL;
1373 handler->uconv_in = NULL;
1374 handler->uconv_out = NULL;
1378 * registers and returns the handler.
1380 xmlRegisterCharEncodingHandler(handler);
1383 "Registered encoding handler for %s\n", name);
1385 return(handler);
1476 * @handler: the xmlCharEncodingHandlerPtr handler block
1478 * Register the char encoding handler, surprising, isn't it ?
1481 xmlRegisterCharEncodingHandler(xmlCharEncodingHandlerPtr handler) {
1483 if ((handler == NULL) || (handlers == NULL)) {
1485 "xmlRegisterCharEncodingHandler: NULL handler !\n", NULL);
1491 "xmlRegisterCharEncodingHandler: Too many handler registered, see %s\n",
1495 handlers[nbCharEncodingHandler++] = handler;
1502 * Search in the registered set the handler able to read/write that encoding.
1504 * Returns the handler or NULL if not found
1508 xmlCharEncodingHandlerPtr handler;
1523 handler = xmlFindCharEncodingHandler("EBCDIC");
1524 if (handler != NULL) return(handler);
1525 handler = xmlFindCharEncodingHandler("ebcdic");
1526 if (handler != NULL) return(handler);
1527 handler = xmlFindCharEncodingHandler("EBCDIC-US");
1528 if (handler != NULL) return(handler);
1529 handler = xmlFindCharEncodingHandler("IBM-037");
1530 if (handler != NULL) return(handler);
1533 handler = xmlFindCharEncodingHandler("ISO-10646-UCS-4");
1534 if (handler != NULL) return(handler);
1535 handler = xmlFindCharEncodingHandler("UCS-4");
1536 if (handler != NULL) return(handler);
1537 handler = xmlFindCharEncodingHandler("UCS4");
1538 if (handler != NULL) return(handler);
1541 handler = xmlFindCharEncodingHandler("ISO-10646-UCS-4");
1542 if (handler != NULL) return(handler);
1543 handler = xmlFindCharEncodingHandler("UCS-4");
1544 if (handler != NULL) return(handler);
1545 handler = xmlFindCharEncodingHandler("UCS4");
1546 if (handler != NULL) return(handler);
1553 handler = xmlFindCharEncodingHandler("ISO-10646-UCS-2");
1554 if (handler != NULL) return(handler);
1555 handler = xmlFindCharEncodingHandler("UCS-2");
1556 if (handler != NULL) return(handler);
1557 handler = xmlFindCharEncodingHandler("UCS2");
1558 if (handler != NULL) return(handler);
1568 handler = xmlFindCharEncodingHandler("ISO-8859-1");
1569 if (handler != NULL) return(handler);
1572 handler = xmlFindCharEncodingHandler("ISO-8859-2");
1573 if (handler != NULL) return(handler);
1576 handler = xmlFindCharEncodingHandler("ISO-8859-3");
1577 if (handler != NULL) return(handler);
1580 handler = xmlFindCharEncodingHandler("ISO-8859-4");
1581 if (handler != NULL) return(handler);
1584 handler = xmlFindCharEncodingHandler("ISO-8859-5");
1585 if (handler != NULL) return(handler);
1588 handler = xmlFindCharEncodingHandler("ISO-8859-6");
1589 if (handler != NULL) return(handler);
1592 handler = xmlFindCharEncodingHandler("ISO-8859-7");
1593 if (handler != NULL) return(handler);
1596 handler = xmlFindCharEncodingHandler("ISO-8859-8");
1597 if (handler != NULL) return(handler);
1600 handler = xmlFindCharEncodingHandler("ISO-8859-9");
1601 if (handler != NULL) return(handler);
1606 handler = xmlFindCharEncodingHandler("ISO-2022-JP");
1607 if (handler != NULL) return(handler);
1610 handler = xmlFindCharEncodingHandler("SHIFT-JIS");
1611 if (handler != NULL) return(handler);
1612 handler = xmlFindCharEncodingHandler("SHIFT_JIS");
1613 if (handler != NULL) return(handler);
1614 handler = xmlFindCharEncodingHandler("Shift_JIS");
1615 if (handler != NULL) return(handler);
1618 handler = xmlFindCharEncodingHandler("EUC-JP");
1619 if (handler != NULL) return(handler);
1627 "No handler found for encoding %d\n", enc);
1636 * Search in the registered set the handler able to read/write that encoding.
1638 * Returns the handler or NULL if not found
1682 "Found registered handler for encoding %s\n", name);
1715 "Found iconv handler for encoding %s\n", name);
1743 "Found ICU converter handler for encoding %s\n", name);
1756 "No handler found for encoding %s\n", name);
1916 xmlEncInputChunk(xmlCharEncodingHandler *handler, unsigned char *out,
1921 if (handler->input != NULL) {
1922 ret = handler->input(out, outlen, in, inlen);
1925 else if (handler->iconv_in != NULL) {
1926 ret = xmlIconvWrapper(handler->iconv_in, out, outlen, in, inlen);
1930 else if (handler->uconv_in != NULL) {
1931 ret = xmlUconvWrapper(handler->uconv_in, 1, out, outlen, in, inlen,
1946 xmlEncOutputChunk(xmlCharEncodingHandler *handler, unsigned char *out,
1950 if (handler->output != NULL) {
1951 ret = handler->output(out, outlen, in, inlen);
1954 else if (handler->iconv_out != NULL) {
1955 ret = xmlIconvWrapper(handler->iconv_out, out, outlen, in, inlen);
1959 else if (handler->uconv_out != NULL) {
1960 ret = xmlUconvWrapper(handler->uconv_out, 0, out, outlen, in, inlen,
1975 * @handler: char enconding transformation data structure
1980 * Front-end for the encoding handler input function, but handle only
1989 xmlCharEncFirstLineInt(xmlCharEncodingHandler *handler, xmlBufferPtr out,
1995 if (handler == NULL) return(-1);
2022 ret = xmlEncInputChunk(handler, &out->content[out->use], &written,
2062 * @handler: char enconding transformation data structure
2066 * Front-end for the encoding handler input function, but handle only
2075 xmlCharEncFirstLine(xmlCharEncodingHandler *handler, xmlBufferPtr out,
2077 return(xmlCharEncFirstLineInt(handler, out, in, -1));
2085 * Front-end for the encoding handler input function, but handle only
2195 * Generic front-end for the encoding handler on parser input
2290 * @handler: char encoding transformation data structure
2294 * Generic front-end for the encoding handler input function
2302 xmlCharEncInFunc(xmlCharEncodingHandler * handler, xmlBufferPtr out,
2309 if (handler == NULL)
2324 ret = xmlEncInputChunk(handler, &out->content[out->use], &written,
2380 * Generic front-end for the encoding handler on parser output
2551 * @handler: char enconding transformation data structure
2555 * Generic front-end for the encoding handler output function
2568 xmlCharEncOutFunc(xmlCharEncodingHandler *handler, xmlBufferPtr out,
2576 if (handler == NULL) return(-1);
2592 xmlEncOutputChunk(handler, &out->content[out->use], &written,
2613 ret = xmlEncOutputChunk(handler, &out->content[out->use], &written,
2686 ret = xmlEncOutputChunk(handler, &out->content[out->use], &written,
2715 * @handler: char enconding transformation data structure
2717 * Generic front-end for encoding handler close function
2722 xmlCharEncCloseFunc(xmlCharEncodingHandler *handler) {
2727 if (handler == NULL) return(-1);
2728 if (handler->name == NULL) return(-1);
2731 if (handler == handlers[i]) {
2743 ((handler->iconv_out != NULL) || (handler->iconv_in != NULL))) {
2745 if (handler->iconv_out != NULL) {
2746 if (iconv_close(handler->iconv_out))
2748 handler->iconv_out = NULL;
2750 if (handler->iconv_in != NULL) {
2751 if (iconv_close(handler->iconv_in))
2753 handler->iconv_in = NULL;
2759 ((handler->uconv_out != NULL) || (handler->uconv_in != NULL))) {
2761 if (handler->uconv_out != NULL) {
2762 closeIcuConverter(handler->uconv_out);
2763 handler->uconv_out = NULL;
2765 if (handler->uconv_in != NULL) {
2766 closeIcuConverter(handler->uconv_in);
2767 handler->uconv_in = NULL;
2773 if (handler->name != NULL)
2774 xmlFree(handler->name);
2775 handler->name = NULL;
2776 handler);
2781 "failed to close the encoding handler\n");
2784 "closed the encoding handler\n");
2813 xmlCharEncodingHandler * handler = in->buf->encoder;
2829 ret = xmlEncOutputChunk(handler, &convbuf[0], &written,