* xmlCopyError: * @from: a source error * @to: a target error * * Save the original error to the new place. * * Returns 0 in case of success and -1 in case of error. */
| 1017 | * Returns 0 in case of success and -1 in case of error. |
| 1018 | */ |
| 1019 | int |
| 1020 | xmlCopyError(const xmlError *from, xmlErrorPtr to) { |
| 1021 | const char *fmt = NULL; |
| 1022 | |
| 1023 | if ((from == NULL) || (to == NULL)) |
| 1024 | return(-1); |
| 1025 | |
| 1026 | if (from->message != NULL) |
| 1027 | fmt = "%s"; |
| 1028 | |
| 1029 | return(xmlSetError(to, from->ctxt, from->node, |
| 1030 | from->domain, from->code, from->level, |
| 1031 | from->file, from->line, |
| 1032 | from->str1, from->str2, from->str3, |
| 1033 | from->int1, from->int2, |
| 1034 | fmt, from->message)); |
| 1035 | } |
| 1036 | |
| 1037 | /** |
| 1038 | * xmlErrString: |