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

Function xmlBufSetAllocationScheme

ThirdParty/libxml2/vtklibxml2/buf.c:240–266  ·  view source on GitHub ↗

* xmlBufSetAllocationScheme: * @buf: the buffer to tune * @scheme: allocation scheme to use * * Sets the allocation scheme for this buffer * * returns 0 in case of success and -1 in case of failure */

Source from the content-addressed store, hash-verified

238 * returns 0 in case of success and -1 in case of failure
239 */
240int
241xmlBufSetAllocationScheme(xmlBufPtr buf,
242 xmlBufferAllocationScheme scheme) {
243 if ((buf == NULL) || (buf->error != 0)) {
244 return(-1);
245 }
246 if (buf->alloc == XML_BUFFER_ALLOC_IO)
247 return(-1);
248 if ((scheme == XML_BUFFER_ALLOC_DOUBLEIT) ||
249 (scheme == XML_BUFFER_ALLOC_EXACT) ||
250 (scheme == XML_BUFFER_ALLOC_HYBRID) ||
251 (scheme == XML_BUFFER_ALLOC_BOUNDED)) {
252 buf->alloc = scheme;
253 if (buf->buffer)
254 buf->buffer->alloc = scheme;
255 return(0);
256 }
257 /*
258 * Switching a buffer ALLOC_IO has the side effect of initializing
259 * the contentIO field with the current content
260 */
261 if (scheme == XML_BUFFER_ALLOC_IO) {
262 buf->alloc = XML_BUFFER_ALLOC_IO;
263 buf->contentIO = buf->content;
264 }
265 return(-1);
266}
267
268/**
269 * xmlBufFree:

Callers 11

xmlTextReaderReadStringFunction · 0.85
xmlNewTextReaderFunction · 0.85
xmlTextReaderConstValueFunction · 0.85
xmlTextReaderSetupFunction · 0.85
xmlNodeGetContentFunction · 0.85
htmlNodeDumpFunction · 0.85
xmlBufNodeDumpFunction · 0.85
xmlAllocOutputBufferFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected