* xmlNewInputString: * @ctxt: parser context * @url: base URL (optional) * @str: zero-terminated string * @encoding: character encoding (optional) * @flags: optimization hints * * Creates a new parser input to read from a zero-terminated string. * * @url is used as base to resolve external entities and for * error reporting. * * If the XML_INPUT_BUF_STATIC flag is set, the string
| 1680 | * Returns a new parser input. |
| 1681 | */ |
| 1682 | xmlParserInputPtr |
| 1683 | xmlNewInputString(xmlParserCtxtPtr ctxt, const char *url, |
| 1684 | const char *str, const char *encoding, int flags) { |
| 1685 | xmlParserInputBufferPtr buf; |
| 1686 | |
| 1687 | if ((ctxt == NULL) || (str == NULL)) |
| 1688 | return(NULL); |
| 1689 | |
| 1690 | buf = xmlNewInputBufferString(str, flags); |
| 1691 | if (buf == NULL) { |
| 1692 | xmlCtxtErrMemory(ctxt); |
| 1693 | return(NULL); |
| 1694 | } |
| 1695 | |
| 1696 | return(xmlNewInputInternal(ctxt, buf, url, encoding)); |
| 1697 | } |
| 1698 | |
| 1699 | /** |
| 1700 | * xmlNewInputFd: |
no test coverage detected