blob: a99ab23d04b38781c79bad567962d76783e396f4 [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 Veillard7f7d1111999-09-22 09:46:25 +000026 void *netIO; /* Input from a network stream */
Daniel Veillard14fff061999-06-22 21:49:07 +000027
Daniel Veillarde2d034d1999-07-27 19:52:06 +000028 xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */
Daniel Veillard14fff061999-06-22 21:49:07 +000029
30 xmlBufferPtr buffer; /* Local buffer encoded in UTF-8 */
31
32} xmlParserInputBuffer;
33
34typedef xmlParserInputBuffer *xmlParserInputBufferPtr;
35
Daniel Veillarde2d034d1999-07-27 19:52:06 +000036/*
37 * Interfaces
38 */
39
Daniel Veillardb96e6431999-08-29 21:02:19 +000040xmlParserInputBufferPtr
41 xmlParserInputBufferCreateFilename (const char *filename,
42 xmlCharEncoding enc);
43xmlParserInputBufferPtr
44 xmlParserInputBufferCreateFile (FILE *file,
45 xmlCharEncoding enc);
46xmlParserInputBufferPtr
47 xmlParserInputBufferCreateFd (int fd,
48 xmlCharEncoding enc);
49int xmlParserInputBufferRead (xmlParserInputBufferPtr in,
50 int len);
51int xmlParserInputBufferGrow (xmlParserInputBufferPtr in,
52 int len);
53void xmlFreeParserInputBuffer (xmlParserInputBufferPtr in);
54char * xmlParserGetDirectory (const char *filename);
Daniel Veillarde2d034d1999-07-27 19:52:06 +000055
Daniel Veillard14fff061999-06-22 21:49:07 +000056#ifdef __cplusplus
57}
58#endif
59
60#endif /* __XML_IO_H__ */