* xmlBufEmpty: * @buf: the buffer * * empty a buffer. */
| 294 | * empty a buffer. |
| 295 | */ |
| 296 | void |
| 297 | xmlBufEmpty(xmlBufPtr buf) { |
| 298 | if ((buf == NULL) || (buf->error != 0)) return; |
| 299 | if (buf->content == NULL) return; |
| 300 | CHECK_COMPAT(buf) |
| 301 | buf->use = 0; |
| 302 | if ((buf->alloc == XML_BUFFER_ALLOC_IO) && |
| 303 | (buf->contentIO != NULL)) { |
| 304 | size_t start_buf = buf->content - buf->contentIO; |
| 305 | |
| 306 | buf->size += start_buf; |
| 307 | buf->content = buf->contentIO; |
| 308 | buf->content[0] = 0; |
| 309 | } else { |
| 310 | buf->content[0] = 0; |
| 311 | } |
| 312 | UPDATE_COMPAT(buf) |
| 313 | } |
| 314 | |
| 315 | /** |
| 316 | * xmlBufShrink: |
no outgoing calls
no test coverage detected