Simple C Expat Wrapper (SCEW)  1.1.7
reader.h
Go to the documentation of this file.
1 
46 #ifndef READER_H_0811231336
47 #define READER_H_0811231336
48 
49 #include "export.h"
50 
51 #include "bool.h"
52 
53 #include <expat.h>
54 
55 #include <stddef.h>
56 
57 #ifdef __cplusplus
58 extern "C" {
59 #endif /* __cplusplus */
60 
66 typedef struct scew_reader scew_reader;
67 
75 typedef struct
76 {
80  size_t (*read) (scew_reader *, XML_Char *, size_t);
81 
85  scew_bool (*end) (scew_reader *);
86 
90  scew_bool (*error) (scew_reader *);
91 
95  scew_bool (*close) (scew_reader *);
96 
100  void (*free) (scew_reader *);
102 
124 extern SCEW_API scew_reader*
125 scew_reader_create (scew_reader_hooks const *hooks, void *data);
126 
140 extern SCEW_API void* scew_reader_data (scew_reader *reader);
141 
163 extern SCEW_API size_t scew_reader_read (scew_reader *reader,
164  XML_Char *buffer,
165  size_t char_no);
166 
182 extern SCEW_API scew_bool scew_reader_end (scew_reader *reader);
183 
200 extern SCEW_API scew_bool scew_reader_error (scew_reader *reader);
201 
221 extern SCEW_API scew_bool scew_reader_close (scew_reader *reader);
222 
233 extern SCEW_API void scew_reader_free (scew_reader *reader);
234 
235 #ifdef __cplusplus
236 }
237 #endif /* __cplusplus */
238 
239 #endif /* READER_H_0811231336 */
SCEW_API void scew_reader_free(scew_reader *reader)
Frees the memory allocated by the given reader.
This is the set of functions that are implemented by all SCEW reader sources.
Definition: reader.h:75
SCEW_API void * scew_reader_data(scew_reader *reader)
Returns the reference to the internal data structure being used by the given reader.
SCEW shared library support.
unsigned char scew_bool
This should be defined using stdbool.h when C99 is available.
Definition: bool.h:35
SCEW_API scew_bool scew_reader_close(scew_reader *reader)
Closes the given reader.
SCEW_API scew_reader * scew_reader_create(scew_reader_hooks const *hooks, void *data)
Creates a new SCEW reader with the given scew_reader_hooks implementation.
struct scew_reader scew_reader
This is the type delcaration for SCEW readers.
Definition: reader.h:66
SCEW_API size_t scew_reader_read(scew_reader *reader, XML_Char *buffer, size_t char_no)
Reads data from the given reader in store it in the specified buffer.
SCEW boolean type declaration.
SCEW_API scew_bool scew_reader_error(scew_reader *reader)
Tells whether an error was found while reading from the given reader.
SCEW_API scew_bool scew_reader_end(scew_reader *reader)
Tells whether the given reader has reached its end.