* xmlParserInputBufferCreateFd: * @fd: a file descriptor number * @enc: the charset encoding if known (deprecated) * * Create a buffered parser input for the progressive parsing for the input * from a file descriptor * * The encoding argument is deprecated and should be set to * XML_CHAR_ENCODING_NONE. The encoding can be changed with * xmlSwitchEncoding or xmlSwitchEncodingName later o
| 1906 | * Returns the new parser input or NULL |
| 1907 | */ |
| 1908 | xmlParserInputBufferPtr |
| 1909 | xmlParserInputBufferCreateFd(int fd, xmlCharEncoding enc) { |
| 1910 | xmlParserInputBufferPtr ret; |
| 1911 | |
| 1912 | if (fd < 0) return(NULL); |
| 1913 | |
| 1914 | ret = xmlAllocParserInputBuffer(enc); |
| 1915 | if (ret != NULL) { |
| 1916 | ret->context = (void *) (ptrdiff_t) fd; |
| 1917 | ret->readcallback = xmlFdRead; |
| 1918 | } |
| 1919 | |
| 1920 | return(ret); |
| 1921 | } |
| 1922 | |
| 1923 | typedef struct { |
| 1924 | char *mem; |
no test coverage detected