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

Function xmlBufferCreateSize

ThirdParty/libxml2/vtklibxml2/tree.c:7137–7160  ·  view source on GitHub ↗

* xmlBufferCreateSize: * @size: initial size of buffer * * routine to create an XML buffer. * returns the new structure. */

Source from the content-addressed store, hash-verified

7135 * returns the new structure.
7136 */
7137xmlBufferPtr
7138xmlBufferCreateSize(size_t size) {
7139 xmlBufferPtr ret;
7140
7141 if (size >= UINT_MAX)
7142 return(NULL);
7143 ret = (xmlBufferPtr) xmlMalloc(sizeof(xmlBuffer));
7144 if (ret == NULL)
7145 return(NULL);
7146 ret->use = 0;
7147 ret->alloc = xmlBufferAllocScheme;
7148 ret->size = (size ? size + 1 : 0); /* +1 for ending null */
7149 if (ret->size){
7150 ret->content = (xmlChar *) xmlMallocAtomic(ret->size);
7151 if (ret->content == NULL) {
7152 xmlFree(ret);
7153 return(NULL);
7154 }
7155 ret->content[0] = 0;
7156 } else
7157 ret->content = NULL;
7158 ret->contentIO = NULL;
7159 return(ret);
7160}
7161
7162/**
7163 * xmlBufferDetach:

Callers 2

xmlBufferCreateStaticFunction · 0.85
launchTestsFunction · 0.85

Calls

no outgoing calls

Tested by 1

launchTestsFunction · 0.68