* htmlNodeDump: * @buf: the HTML buffer output * @doc: the document * @cur: the current node * * Dump an HTML node, recursive behaviour,children are printed too, * and formatting returns are added. * * Returns the number of byte written or -1 in case of error */
| 458 | * Returns the number of byte written or -1 in case of error |
| 459 | */ |
| 460 | int |
| 461 | htmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur) { |
| 462 | xmlBufPtr buffer; |
| 463 | size_t ret; |
| 464 | |
| 465 | if ((buf == NULL) || (cur == NULL)) |
| 466 | return(-1); |
| 467 | |
| 468 | xmlInitParser(); |
| 469 | buffer = xmlBufFromBuffer(buf); |
| 470 | if (buffer == NULL) |
| 471 | return(-1); |
| 472 | |
| 473 | xmlBufSetAllocationScheme(buffer, XML_BUFFER_ALLOC_DOUBLEIT); |
| 474 | ret = htmlBufNodeDumpFormat(buffer, doc, cur, 1); |
| 475 | |
| 476 | xmlBufBackToBuffer(buffer); |
| 477 | |
| 478 | if (ret > INT_MAX) |
| 479 | return(-1); |
| 480 | return((int) ret); |
| 481 | } |
| 482 | |
| 483 | /** |
| 484 | * htmlNodeDumpFileFormat: |
nothing calls this directly
no test coverage detected