| 2062 | */ |
| 2063 | |
| 2064 | xmlSaveCtxtPtr |
| 2065 | xmlSaveToBuffer(xmlBufferPtr buffer, const char *encoding, int options) |
| 2066 | { |
| 2067 | xmlSaveCtxtPtr ret; |
| 2068 | |
| 2069 | ret = xmlNewSaveCtxt(encoding, options); |
| 2070 | if (ret == NULL) return(NULL); |
| 2071 | ret->buf = xmlOutputBufferCreateBuffer(buffer, ret->handler); |
| 2072 | if (ret->buf == NULL) { |
| 2073 | xmlCharEncCloseFunc(ret->handler); |
| 2074 | xmlFreeSaveCtxt(ret); |
| 2075 | return(NULL); |
| 2076 | } |
| 2077 | return(ret); |
| 2078 | } |
| 2079 | |
| 2080 | /** |
| 2081 | * xmlSaveToIO: |
no test coverage detected