* xmlNewInputMemory: * @ctxt: parser context * @url: base URL (optional) * @mem: pointer to char array * @size: size of array * @encoding: character encoding (optional) * @flags: optimization hints * * Creates a new parser input to read from a memory area. * * @url is used as base to resolve external entities and for * error reporting. * * If the XML_INPUT_BUF_STATIC flag is set
| 1643 | * Returns a new parser input. |
| 1644 | */ |
| 1645 | xmlParserInputPtr |
| 1646 | xmlNewInputMemory(xmlParserCtxtPtr ctxt, const char *url, |
| 1647 | const void *mem, size_t size, |
| 1648 | const char *encoding, int flags) { |
| 1649 | xmlParserInputBufferPtr buf; |
| 1650 | |
| 1651 | if ((ctxt == NULL) || (mem == NULL)) |
| 1652 | return(NULL); |
| 1653 | |
| 1654 | buf = xmlNewInputBufferMemory(mem, size, flags, XML_CHAR_ENCODING_NONE); |
| 1655 | if (buf == NULL) { |
| 1656 | xmlCtxtErrMemory(ctxt); |
| 1657 | return(NULL); |
| 1658 | } |
| 1659 | |
| 1660 | return(xmlNewInputInternal(ctxt, buf, url, encoding)); |
| 1661 | } |
| 1662 | |
| 1663 | /** |
| 1664 | * xmlNewInputString: |
no test coverage detected