Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 1 | /* |
| 2 | * xmlIO.h : interface for the I/O interfaces used by the parser |
| 3 | * |
| 4 | * See Copyright for the status of this software. |
| 5 | * |
| 6 | * Daniel.Veillard@w3.org |
| 7 | */ |
| 8 | |
| 9 | #ifndef __XML_IO_H__ |
| 10 | #define __XML_IO_H__ |
| 11 | |
| 12 | #include <stdio.h> |
| 13 | #include "tree.h" |
Daniel Veillard | e2d034d | 1999-07-27 19:52:06 +0000 | [diff] [blame^] | 14 | #include "encoding.h" |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 15 | |
| 16 | #ifdef __cplusplus |
| 17 | extern "C" { |
| 18 | #endif |
| 19 | |
| 20 | typedef struct xmlParserInputBuffer { |
| 21 | /* Inputs */ |
| 22 | FILE *file; /* Input on file handler */ |
Daniel Veillard | e2d034d | 1999-07-27 19:52:06 +0000 | [diff] [blame^] | 23 | void* gzfile; /* Input on a compressed stream */ |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 24 | int fd; /* Input on a file descriptor */ |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 25 | |
Daniel Veillard | e2d034d | 1999-07-27 19:52:06 +0000 | [diff] [blame^] | 26 | xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */ |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 27 | |
| 28 | xmlBufferPtr buffer; /* Local buffer encoded in UTF-8 */ |
| 29 | |
| 30 | } xmlParserInputBuffer; |
| 31 | |
| 32 | typedef xmlParserInputBuffer *xmlParserInputBufferPtr; |
| 33 | |
Daniel Veillard | e2d034d | 1999-07-27 19:52:06 +0000 | [diff] [blame^] | 34 | /* |
| 35 | * Interfaces |
| 36 | */ |
| 37 | |
| 38 | xmlParserInputBufferPtr xmlParserInputBufferCreateFilename(const char *filename, |
| 39 | xmlCharEncoding enc); |
| 40 | xmlParserInputBufferPtr xmlParserInputBufferCreateFile(FILE *file, |
| 41 | xmlCharEncoding enc); |
| 42 | xmlParserInputBufferPtr xmlParserInputBufferCreateFd(int fd, xmlCharEncoding enc); |
| 43 | |
| 44 | int xmlParserInputBufferRead(xmlParserInputBufferPtr in, int len); |
| 45 | int xmlParserInputBufferGrow(xmlParserInputBufferPtr in, int len); |
| 46 | |
| 47 | void xmlFreeParserInputBuffer(xmlParserInputBufferPtr in); |
| 48 | |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 49 | #ifdef __cplusplus |
| 50 | } |
| 51 | #endif |
| 52 | |
| 53 | #endif /* __XML_IO_H__ */ |