* xmlOutputBufferCreateFd: * @fd: a file descriptor number * @encoder: the encoding converter or NULL * * Create a buffered output for the progressive saving * to a file descriptor * * Returns the new parser output or NULL */
| 2132 | * Returns the new parser output or NULL |
| 2133 | */ |
| 2134 | xmlOutputBufferPtr |
| 2135 | xmlOutputBufferCreateFd(int fd, xmlCharEncodingHandlerPtr encoder) { |
| 2136 | xmlOutputBufferPtr ret; |
| 2137 | |
| 2138 | if (fd < 0) return(NULL); |
| 2139 | |
| 2140 | ret = xmlAllocOutputBufferInternal(encoder); |
| 2141 | if (ret != NULL) { |
| 2142 | ret->context = (void *) (ptrdiff_t) fd; |
| 2143 | ret->writecallback = xmlFdWrite; |
| 2144 | ret->closecallback = NULL; |
| 2145 | } |
| 2146 | |
| 2147 | return(ret); |
| 2148 | } |
| 2149 | #endif /* LIBXML_OUTPUT_ENABLED */ |
| 2150 | |
| 2151 | /** |
no test coverage detected