* xmlParserInputBufferCreateFd: * @fd: a file descriptor number * @enc: the charset encoding if known * * Create a buffered parser input for the progressive parsing for the input * from a file descriptor * * Returns the new parser input or NULL */
| 2692 | * Returns the new parser input or NULL |
| 2693 | */ |
| 2694 | xmlParserInputBufferPtr |
| 2695 | xmlParserInputBufferCreateFd(int fd, xmlCharEncoding enc) { |
| 2696 | xmlParserInputBufferPtr ret; |
| 2697 | |
| 2698 | if (fd < 0) return(NULL); |
| 2699 | |
| 2700 | ret = xmlAllocParserInputBuffer(enc); |
| 2701 | if (ret != NULL) { |
| 2702 | ret->context = (void *) (long) fd; |
| 2703 | ret->readcallback = xmlFdRead; |
| 2704 | ret->closecallback = xmlFdClose; |
| 2705 | } |
| 2706 | |
| 2707 | return(ret); |
| 2708 | } |
| 2709 | |
| 2710 | /** |
| 2711 | * xmlParserInputBufferCreateMem: |