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

Function xmlNewInputBufferString

ThirdParty/libxml2/vtklibxml2/xmlIO.c:2095–2121  ·  view source on GitHub ↗

* xmlNewInputBufferString: * @str: C string * @flags: flags * * Create an input buffer for a null-teriminated C string. * * Returns the new input buffer or NULL. */

Source from the content-addressed store, hash-verified

2093 * Returns the new input buffer or NULL.
2094 */
2095xmlParserInputBufferPtr
2096xmlNewInputBufferString(const char *str, int flags) {
2097 xmlParserInputBufferPtr ret;
2098 xmlStringIOCtxt *ctxt;
2099
2100 if ((flags & XML_INPUT_BUF_STATIC) == 0)
2101 return(xmlNewInputBufferMemory(str, strlen(str), flags,
2102 XML_CHAR_ENCODING_NONE));
2103
2104 ret = xmlAllocParserInputBuffer(XML_CHAR_ENCODING_NONE);
2105 if (ret == NULL)
2106 return(NULL);
2107
2108 ctxt = xmlMalloc(sizeof(*ctxt));
2109 if (ctxt == NULL) {
2110 xmlFreeParserInputBuffer(ret);
2111 return(NULL);
2112 }
2113
2114 ctxt->str = str;
2115
2116 ret->context = ctxt;
2117 ret->readcallback = xmlStringRead;
2118 ret->closecallback = xmlStringClose;
2119
2120 return(ret);
2121}
2122
2123#ifdef LIBXML_OUTPUT_ENABLED
2124/**

Callers 1

xmlNewInputStringFunction · 0.85

Calls 3

xmlNewInputBufferMemoryFunction · 0.85
xmlFreeParserInputBufferFunction · 0.85

Tested by

no test coverage detected