blob: 01bf14c7d9adfd7884cb2be8e68a1e01474fb4fc [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 Veillardb96e6431999-08-29 21:02:19 +000014#include "parser.h"
Daniel Veillarde2d034d1999-07-27 19:52:06 +000015#include "encoding.h"
Daniel Veillard14fff061999-06-22 21:49:07 +000016
17#ifdef __cplusplus
18extern "C" {
19#endif
20
21typedef struct xmlParserInputBuffer {
22 /* Inputs */
23 FILE *file; /* Input on file handler */
Daniel Veillarde2d034d1999-07-27 19:52:06 +000024 void* gzfile; /* Input on a compressed stream */
Daniel Veillard14fff061999-06-22 21:49:07 +000025 int fd; /* Input on a file descriptor */
Daniel Veillard14fff061999-06-22 21:49:07 +000026
Daniel Veillarde2d034d1999-07-27 19:52:06 +000027 xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */
Daniel Veillard14fff061999-06-22 21:49:07 +000028
29 xmlBufferPtr buffer; /* Local buffer encoded in UTF-8 */
30
31} xmlParserInputBuffer;
32
33typedef xmlParserInputBuffer *xmlParserInputBufferPtr;
34
Daniel Veillarde2d034d1999-07-27 19:52:06 +000035/*
36 * Interfaces
37 */
38
Daniel Veillardb96e6431999-08-29 21:02:19 +000039xmlParserInputBufferPtr
40 xmlParserInputBufferCreateFilename (const char *filename,
41 xmlCharEncoding enc);
42xmlParserInputBufferPtr
43 xmlParserInputBufferCreateFile (FILE *file,
44 xmlCharEncoding enc);
45xmlParserInputBufferPtr
46 xmlParserInputBufferCreateFd (int fd,
47 xmlCharEncoding enc);
48int xmlParserInputBufferRead (xmlParserInputBufferPtr in,
49 int len);
50int xmlParserInputBufferGrow (xmlParserInputBufferPtr in,
51 int len);
52void xmlFreeParserInputBuffer (xmlParserInputBufferPtr in);
53char * xmlParserGetDirectory (const char *filename);
Daniel Veillarde2d034d1999-07-27 19:52:06 +000054
Daniel Veillard14fff061999-06-22 21:49:07 +000055#ifdef __cplusplus
56}
57#endif
58
59#endif /* __XML_IO_H__ */