* xmlBufCreate: * * routine to create an XML buffer. * returns the new structure. */
| 117 | * returns the new structure. |
| 118 | */ |
| 119 | xmlBufPtr |
| 120 | xmlBufCreate(void) { |
| 121 | xmlBufPtr ret; |
| 122 | |
| 123 | ret = (xmlBufPtr) xmlMalloc(sizeof(xmlBuf)); |
| 124 | if (ret == NULL) |
| 125 | return(NULL); |
| 126 | ret->use = 0; |
| 127 | ret->error = 0; |
| 128 | ret->buffer = NULL; |
| 129 | ret->size = xmlDefaultBufferSize; |
| 130 | UPDATE_COMPAT(ret); |
| 131 | ret->alloc = xmlBufferAllocScheme; |
| 132 | ret->content = (xmlChar *) xmlMallocAtomic(ret->size); |
| 133 | if (ret->content == NULL) { |
| 134 | xmlFree(ret); |
| 135 | return(NULL); |
| 136 | } |
| 137 | ret->content[0] = 0; |
| 138 | ret->contentIO = NULL; |
| 139 | return(ret); |
| 140 | } |
| 141 | |
| 142 | /** |
| 143 | * xmlBufCreateSize: |
no outgoing calls
no test coverage detected