blob: bdeecc3f894ce6d15a16c4e4ae4809bac257e5da [file] [log] [blame]
Daniel Veillard14fff061999-06-22 21:49:07 +00001/*
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 Veillarde2d034d1999-07-27 19:52:06 +000014#include "encoding.h"
Daniel Veillard14fff061999-06-22 21:49:07 +000015
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20typedef struct xmlParserInputBuffer {
21 /* Inputs */
22 FILE *file; /* Input on file handler */
Daniel Veillarde2d034d1999-07-27 19:52:06 +000023 void* gzfile; /* Input on a compressed stream */
Daniel Veillard14fff061999-06-22 21:49:07 +000024 int fd; /* Input on a file descriptor */
Daniel Veillard14fff061999-06-22 21:49:07 +000025
Daniel Veillarde2d034d1999-07-27 19:52:06 +000026 xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */
Daniel Veillard14fff061999-06-22 21:49:07 +000027
28 xmlBufferPtr buffer; /* Local buffer encoded in UTF-8 */
29
30} xmlParserInputBuffer;
31
32typedef xmlParserInputBuffer *xmlParserInputBufferPtr;
33
Daniel Veillarde2d034d1999-07-27 19:52:06 +000034/*
35 * Interfaces
36 */
37
38xmlParserInputBufferPtr xmlParserInputBufferCreateFilename(const char *filename,
39 xmlCharEncoding enc);
40xmlParserInputBufferPtr xmlParserInputBufferCreateFile(FILE *file,
41 xmlCharEncoding enc);
42xmlParserInputBufferPtr xmlParserInputBufferCreateFd(int fd, xmlCharEncoding enc);
43
44int xmlParserInputBufferRead(xmlParserInputBufferPtr in, int len);
45int xmlParserInputBufferGrow(xmlParserInputBufferPtr in, int len);
46
47void xmlFreeParserInputBuffer(xmlParserInputBufferPtr in);
48
Daniel Veillard14fff061999-06-22 21:49:07 +000049#ifdef __cplusplus
50}
51#endif
52
53#endif /* __XML_IO_H__ */