MCPcopy Create free account
hub / github.com/KhronosGroup/OpenCOLLADA / htmlReadFd

Function htmlReadFd

Externals/LibXML/HTMLparser.c:6066–6093  ·  view source on GitHub ↗

* htmlReadFd: * @fd: an open file descriptor * @URL: the base URL to use for the document * @encoding: the document encoding, or NULL * @options: a combination of htmlParserOption(s) * * parse an XML from a file descriptor and build a tree. * * Returns the resulting document tree */

Source from the content-addressed store, hash-verified

6064 * Returns the resulting document tree
6065 */
6066htmlDocPtr
6067htmlReadFd(int fd, const char *URL, const char *encoding, int options)
6068{
6069 htmlParserCtxtPtr ctxt;
6070 xmlParserInputBufferPtr input;
6071 xmlParserInputPtr stream;
6072
6073 if (fd < 0)
6074 return (NULL);
6075
6076 xmlInitParser();
6077 input = xmlParserInputBufferCreateFd(fd, XML_CHAR_ENCODING_NONE);
6078 if (input == NULL)
6079 return (NULL);
6080 ctxt = xmlNewParserCtxt();
6081 if (ctxt == NULL) {
6082 xmlFreeParserInputBuffer(input);
6083 return (NULL);
6084 }
6085 stream = xmlNewIOInputStream(ctxt, input, XML_CHAR_ENCODING_NONE);
6086 if (stream == NULL) {
6087 xmlFreeParserInputBuffer(input);
6088 xmlFreeParserCtxt(ctxt);
6089 return (NULL);
6090 }
6091 inputPush(ctxt, stream);
6092 return (htmlDoRead(ctxt, URL, encoding, options, 0));
6093}
6094
6095/**
6096 * htmlReadIO:

Callers

nothing calls this directly

Calls 7

xmlNewParserCtxtFunction · 0.85
xmlFreeParserInputBufferFunction · 0.85
xmlNewIOInputStreamFunction · 0.85
xmlFreeParserCtxtFunction · 0.85
inputPushFunction · 0.85
htmlDoReadFunction · 0.85

Tested by

no test coverage detected