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 | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame^] | 14 | #include "parser.h" |
Daniel Veillard | e2d034d | 1999-07-27 19:52:06 +0000 | [diff] [blame] | 15 | #include "encoding.h" |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 16 | |
| 17 | #ifdef __cplusplus |
| 18 | extern "C" { |
| 19 | #endif |
| 20 | |
| 21 | typedef struct xmlParserInputBuffer { |
| 22 | /* Inputs */ |
| 23 | FILE *file; /* Input on file handler */ |
Daniel Veillard | e2d034d | 1999-07-27 19:52:06 +0000 | [diff] [blame] | 24 | void* gzfile; /* Input on a compressed stream */ |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 25 | int fd; /* Input on a file descriptor */ |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 26 | |
Daniel Veillard | e2d034d | 1999-07-27 19:52:06 +0000 | [diff] [blame] | 27 | xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */ |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 28 | |
| 29 | xmlBufferPtr buffer; /* Local buffer encoded in UTF-8 */ |
| 30 | |
| 31 | } xmlParserInputBuffer; |
| 32 | |
| 33 | typedef xmlParserInputBuffer *xmlParserInputBufferPtr; |
| 34 | |
Daniel Veillard | e2d034d | 1999-07-27 19:52:06 +0000 | [diff] [blame] | 35 | /* |
| 36 | * Interfaces |
| 37 | */ |
| 38 | |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame^] | 39 | xmlParserInputBufferPtr |
| 40 | xmlParserInputBufferCreateFilename (const char *filename, |
| 41 | xmlCharEncoding enc); |
| 42 | xmlParserInputBufferPtr |
| 43 | xmlParserInputBufferCreateFile (FILE *file, |
| 44 | xmlCharEncoding enc); |
| 45 | xmlParserInputBufferPtr |
| 46 | xmlParserInputBufferCreateFd (int fd, |
| 47 | xmlCharEncoding enc); |
| 48 | int xmlParserInputBufferRead (xmlParserInputBufferPtr in, |
| 49 | int len); |
| 50 | int xmlParserInputBufferGrow (xmlParserInputBufferPtr in, |
| 51 | int len); |
| 52 | void xmlFreeParserInputBuffer (xmlParserInputBufferPtr in); |
| 53 | char * xmlParserGetDirectory (const char *filename); |
Daniel Veillard | e2d034d | 1999-07-27 19:52:06 +0000 | [diff] [blame] | 54 | |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 55 | #ifdef __cplusplus |
| 56 | } |
| 57 | #endif |
| 58 | |
| 59 | #endif /* __XML_IO_H__ */ |