* htmlSaveErr: * @code: the error number * @node: the location of the error. * @extra: extra information * * Handle an out of memory condition */
| 344 | * Handle an out of memory condition |
| 345 | */ |
| 346 | static void |
| 347 | htmlSaveErr(int code, xmlNodePtr node, const char *extra) |
| 348 | { |
| 349 | const char *msg = NULL; |
| 350 | int res; |
| 351 | |
| 352 | switch(code) { |
| 353 | case XML_SAVE_NOT_UTF8: |
| 354 | msg = "string is not in UTF-8\n"; |
| 355 | break; |
| 356 | case XML_SAVE_CHAR_INVALID: |
| 357 | msg = "invalid character value\n"; |
| 358 | break; |
| 359 | case XML_SAVE_UNKNOWN_ENCODING: |
| 360 | msg = "unknown encoding %s\n"; |
| 361 | break; |
| 362 | case XML_SAVE_NO_DOCTYPE: |
| 363 | msg = "HTML has no DOCTYPE\n"; |
| 364 | break; |
| 365 | default: |
| 366 | msg = "unexpected error number\n"; |
| 367 | } |
| 368 | |
| 369 | res = __xmlRaiseError(NULL, NULL, NULL, NULL, node, |
| 370 | XML_FROM_OUTPUT, code, XML_ERR_ERROR, NULL, 0, |
| 371 | extra, NULL, NULL, 0, 0, |
| 372 | msg, extra); |
| 373 | if (res < 0) |
| 374 | xmlRaiseMemoryError(NULL, NULL, NULL, XML_FROM_OUTPUT, NULL); |
| 375 | } |
| 376 | |
| 377 | /************************************************************************ |
| 378 | * * |
no test coverage detected