Simple C Expat Wrapper (SCEW)  1.1.7
writer.h
Go to the documentation of this file.
1 
46 #ifndef WRITER_H_0309110036
47 #define WRITER_H_0309110036
48 
49 #include "export.h"
50 
51 #include "tree.h"
52 #include "attribute.h"
53 #include "bool.h"
54 
55 #include <expat.h>
56 
57 #include <stddef.h>
58 
59 
60 #ifdef __cplusplus
61 extern "C" {
62 #endif /* __cplusplus */
63 
69 typedef struct scew_writer scew_writer;
70 
78 typedef struct
79 {
83  size_t (*write) (scew_writer *, XML_Char const *, size_t);
84 
88  scew_bool (*end) (scew_writer *);
89 
93  scew_bool (*error) (scew_writer *);
94 
98  scew_bool (*close) (scew_writer *);
99 
103  void (*free) (scew_writer *);
105 
106 
128 extern SCEW_API scew_writer*
129 scew_writer_create (scew_writer_hooks const *hooks, void *data);
130 
144 extern SCEW_API void* scew_writer_data (scew_writer *writer);
145 
167 extern SCEW_API size_t scew_writer_write (scew_writer *writer,
168  XML_Char const *buffer,
169  size_t char_no);
170 
186 extern SCEW_API scew_bool scew_writer_end (scew_writer *writer);
187 
204 extern SCEW_API scew_bool scew_writer_error (scew_writer *writer);
205 
225 extern SCEW_API scew_bool scew_writer_close (scew_writer *writer);
226 
239 extern SCEW_API void scew_writer_free (scew_writer *writer);
240 
241 #ifdef __cplusplus
242 }
243 #endif /* __cplusplus */
244 
245 #endif /* WRITER_H_0309110036 */
SCEW_API scew_bool scew_writer_error(scew_writer *writer)
Tells whether an error was found while sending data to the given writer.
SCEW shared library support.
SCEW tree handling routines.
This is the set of functions that are implemented by all SCEW writers.
Definition: writer.h:78
unsigned char scew_bool
This should be defined using stdbool.h when C99 is available.
Definition: bool.h:35
SCEW attribute's handling routines.
SCEW_API void * scew_writer_data(scew_writer *writer)
Returns the reference to the internal data structure being used by the given writer.
SCEW_API void scew_writer_free(scew_writer *writer)
Frees the memory allocated by the given writer.
struct scew_writer scew_writer
This is the type delcaration for SCEW writers.
Definition: writer.h:69
SCEW_API size_t scew_writer_write(scew_writer *writer, XML_Char const *buffer, size_t char_no)
Writes data from the given memory buffer to the specified writer.
SCEW boolean type declaration.
SCEW_API scew_bool scew_writer_end(scew_writer *writer)
Tells whether the given writer has reached its end.
SCEW_API scew_bool scew_writer_close(scew_writer *writer)
Closes the given writer.
SCEW_API scew_writer * scew_writer_create(scew_writer_hooks const *hooks, void *data)
Creates a new SCEW writer with the given scew_writer_hooks implementation.