* xmlMemSetup: * @freeFunc: the free() function to use * @mallocFunc: the malloc() function to use * @reallocFunc: the realloc() function to use * @strdupFunc: the strdup() function to use * * Override the default memory access functions with a new set * This has to be called before any other libxml routines ! * * Should this be blocked if there was already some allocations * done ? *
| 462 | * Returns 0 on success |
| 463 | */ |
| 464 | int |
| 465 | xmlMemSetup(xmlFreeFunc freeFunc, xmlMallocFunc mallocFunc, |
| 466 | xmlReallocFunc reallocFunc, xmlStrdupFunc strdupFunc) { |
| 467 | if (freeFunc == NULL) |
| 468 | return(-1); |
| 469 | if (mallocFunc == NULL) |
| 470 | return(-1); |
| 471 | if (reallocFunc == NULL) |
| 472 | return(-1); |
| 473 | if (strdupFunc == NULL) |
| 474 | return(-1); |
| 475 | xmlFree = freeFunc; |
| 476 | xmlMalloc = mallocFunc; |
| 477 | xmlMallocAtomic = mallocFunc; |
| 478 | xmlRealloc = reallocFunc; |
| 479 | xmlMemStrdup = strdupFunc; |
| 480 | return(0); |
| 481 | } |
| 482 | |
| 483 | /** |
| 484 | * xmlMemGet: |
no outgoing calls