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

Function xmlBufFromBuffer

ThirdParty/libxml2/vtklibxml2/buf.c:832–853  ·  view source on GitHub ↗

* xmlBufFromBuffer: * @buffer: incoming old buffer to convert to a new one * * Helper routine to switch from the old buffer structures in use * in various APIs. It creates a wrapper xmlBufPtr which will be * used for internal processing until the xmlBufBackToBuffer() is * issued. * * Returns a new xmlBufPtr unless the call failed and NULL is returned */

Source from the content-addressed store, hash-verified

830 * Returns a new xmlBufPtr unless the call failed and NULL is returned
831 */
832xmlBufPtr
833xmlBufFromBuffer(xmlBufferPtr buffer) {
834 xmlBufPtr ret;
835
836 if (buffer == NULL)
837 return(NULL);
838
839 ret = (xmlBufPtr) xmlMalloc(sizeof(xmlBuf));
840 if (ret == NULL) {
841 return(NULL);
842 }
843 ret->use = buffer->use;
844 ret->size = buffer->size;
845 UPDATE_COMPAT(ret);
846 ret->error = 0;
847 ret->buffer = buffer;
848 ret->alloc = buffer->alloc;
849 ret->content = buffer->content;
850 ret->contentIO = buffer->contentIO;
851
852 return(ret);
853}
854
855/**
856 * xmlBufBackToBuffer:

Callers 3

xmlNodeBufGetContentFunction · 0.85
htmlNodeDumpFunction · 0.85
xmlNodeDumpFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected