mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-30 22:43:14 +03:00
- speedup of IS_CHAR like macros, significant overall improvement
- More interfaces for new I/O functions: xmlNewIOInputStream, xmlParserInputBufferCreateIO, xmlCreateIOParserCtxt - added I/O test to xmllint Daniel
This commit is contained in:
29
xmlIO.c
29
xmlIO.c
@ -635,6 +635,35 @@ xmlParserInputBufferCreateFd(int fd, xmlCharEncoding enc) {
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlParserInputBufferCreateIO:
|
||||
* @ioread: an I/O read function
|
||||
* @ioclose: an I/O close function
|
||||
* @ioctx: an I/O handler
|
||||
* @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
|
||||
*/
|
||||
xmlParserInputBufferPtr
|
||||
xmlParserInputBufferCreateIO(xmlInputReadCallback ioread,
|
||||
xmlInputCloseCallback ioclose, void *ioctx, xmlCharEncoding enc) {
|
||||
xmlParserInputBufferPtr ret;
|
||||
|
||||
if (ioread == NULL) return(NULL);
|
||||
|
||||
ret = xmlAllocParserInputBuffer(enc);
|
||||
if (ret != NULL) {
|
||||
ret->context = (void *) ioctx;
|
||||
ret->readcallback = ioread;
|
||||
ret->closecallback = ioclose;
|
||||
}
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlParserInputBufferPush:
|
||||
* @in: a buffered parser input
|
||||
|
Reference in New Issue
Block a user