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

Function xmlAllocOutputBuffer

ThirdParty/libxml2/vtklibxml2/xmlIO.c:1390–1427  ·  view source on GitHub ↗

* xmlAllocOutputBuffer: * @encoder: the encoding converter or NULL * * Create a buffered parser output * * Returns the new parser output or NULL */

Source from the content-addressed store, hash-verified

1388 * Returns the new parser output or NULL
1389 */
1390xmlOutputBufferPtr
1391xmlAllocOutputBuffer(xmlCharEncodingHandlerPtr encoder) {
1392 xmlOutputBufferPtr ret;
1393
1394 ret = (xmlOutputBufferPtr) xmlMalloc(sizeof(xmlOutputBuffer));
1395 if (ret == NULL) {
1396 return(NULL);
1397 }
1398 memset(ret, 0, sizeof(xmlOutputBuffer));
1399 ret->buffer = xmlBufCreate();
1400 if (ret->buffer == NULL) {
1401 xmlFree(ret);
1402 return(NULL);
1403 }
1404 xmlBufSetAllocationScheme(ret->buffer, XML_BUFFER_ALLOC_IO);
1405
1406 ret->encoder = encoder;
1407 if (encoder != NULL) {
1408 ret->conv = xmlBufCreateSize(4000);
1409 if (ret->conv == NULL) {
1410 xmlBufFree(ret->buffer);
1411 xmlFree(ret);
1412 return(NULL);
1413 }
1414
1415 /*
1416 * This call is designed to initiate the encoder state
1417 */
1418 xmlCharEncOutput(ret, 1);
1419 } else
1420 ret->conv = NULL;
1421 ret->writecallback = NULL;
1422 ret->closecallback = NULL;
1423 ret->context = NULL;
1424 ret->written = 0;
1425
1426 return(ret);
1427}
1428
1429/**
1430 * xmlAllocOutputBufferInternal:

Callers 4

xmlC14NDocDumpMemoryFunction · 0.85

Calls 5

xmlBufCreateFunction · 0.85
xmlBufCreateSizeFunction · 0.85
xmlBufFreeFunction · 0.85
xmlCharEncOutputFunction · 0.85

Tested by

no test coverage detected