00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef GUTHTHILA_H
00019 #define GUTHTHILA_H
00020
00021 #include <guththila_defines.h>
00022 #include <guththila_token.h>
00023 #include <guththila_reader.h>
00024 #include <guththila_xml_writer.h>
00025 #include <guththila_attribute.h>
00026 #include <guththila_namespace.h>
00027 #include <guththila_buffer.h>
00028 #include <guththila_stack.h>
00029 #include <guththila_error.h>
00030
00031 #include <axutil_utils.h>
00032
00033
00034
00035
00036
00037 EXTERN_C_START()
00038
00039 enum guththila_status
00040 {
00041 S_0 = 0,
00042 S_1,
00043 S_2,
00044 S_3
00045 };
00046
00047 enum guththila_UTF16_endianess
00048 {
00049 None = 1,
00050 LE,
00051 BE
00052 };
00053
00054 typedef enum guththila_type
00055 {
00056 type_file_name = 0,
00057 type_memory_buffer,
00058 type_reader,
00059 type_io
00060 } guththila_type_t;
00061
00062 enum guththila_event_types
00063 {
00064 GUTHTHILA_START_DOCUMENT =0,
00065 GUTHTHILA_END_ELEMENT,
00066 GUTHTHILA_CHARACTER,
00067 GUTHTHILA_ENTITY_REFERANCE,
00068 GUTHTHILA_COMMENT,
00069 GUTHTHILA_SPACE,
00070 GUTHTHILA_START_ELEMENT,
00071 GUTHTHILA_EMPTY_ELEMENT
00072 };
00073
00074 typedef struct guththila_s
00075 {
00076 guththila_tok_list_t tokens;
00077
00078 guththila_buffer_t buffer;
00079
00080 guththila_reader_t *reader;
00081
00082 guththila_token_t *prefix;
00083
00084 guththila_token_t *name;
00085
00086 guththila_token_t *value;
00087
00088 guththila_stack_t elem;
00089
00090 guththila_stack_t attrib;
00091
00092 guththila_stack_t namesp;
00093
00094 int status;
00095
00096 int guththila_event;
00097
00098 size_t next;
00099
00100 int last_start;
00101
00102 guththila_token_t *temp_prefix;
00103
00104 guththila_token_t *temp_name;
00105
00106 guththila_token_t *temp_tok;
00107 } guththila_t;
00108
00109
00110
00111
00112 typedef struct guththila_elem_namesp_s
00113 {
00114 guththila_namespace_t *namesp;
00115 int no;
00116 int size;
00117 } guththila_elem_namesp_t;
00118
00119
00120
00121
00122 typedef struct guththila_element_s
00123 {
00124 guththila_token_t *name;
00125
00126 guththila_token_t *prefix;
00127
00128 int is_namesp;
00129 } guththila_element_t;
00130
00131
00132 GUTHTHILA_EXPORT int GUTHTHILA_CALL
00133 guththila_init(guththila_t * m, void *reader,
00134 const axutil_env_t * env);
00135
00136
00137 GUTHTHILA_EXPORT int GUTHTHILA_CALL
00138 guththila_un_init(guththila_t * m, const axutil_env_t * env);
00139
00140
00141 typedef void(GUTHTHILA_CALL * guththila_error_func)(void *arg,
00142 const guththila_char_t *msg,
00143 guththila_error_level level,
00144 void *locator);
00145
00146
00147
00148
00149
00150
00151
00152
00153 GUTHTHILA_EXPORT int GUTHTHILA_CALL
00154 guththila_next(guththila_t * g, const axutil_env_t * env);
00155
00156
00157
00158
00159
00160
00161 GUTHTHILA_EXPORT int GUTHTHILA_CALL
00162 guththila_get_attribute_count(guththila_t * g, const axutil_env_t * env);
00163
00164
00165
00166
00167
00168
00169
00170 GUTHTHILA_EXPORT guththila_char_t * GUTHTHILA_CALL
00171 guththila_get_attribute_name(guththila_t * g, guththila_attr_t * att,
00172 const axutil_env_t * env);
00173
00174
00175
00176
00177
00178
00179
00180 GUTHTHILA_EXPORT guththila_char_t * GUTHTHILA_CALL
00181 guththila_get_attribute_value(guththila_t * g,
00182 guththila_attr_t * att,
00183 const axutil_env_t * env);
00184
00185
00186
00187
00188
00189
00190
00191 GUTHTHILA_EXPORT guththila_char_t *GUTHTHILA_CALL
00192 guththila_get_attribute_prefix(guththila_t * g,
00193 guththila_attr_t * att,
00194 const axutil_env_t * env);
00195
00196
00197
00198
00199
00200
00201 GUTHTHILA_EXPORT guththila_attr_t *GUTHTHILA_CALL
00202 guththila_get_attribute(guththila_t * g, const axutil_env_t * env);
00203
00204
00205
00206
00207
00208
00209
00210
00211 GUTHTHILA_EXPORT guththila_char_t *GUTHTHILA_CALL
00212 guththila_get_attribute_name_by_number(guththila_t * g, int index,
00213 const axutil_env_t *env);
00214
00215
00216
00217
00218
00219
00220
00221
00222 GUTHTHILA_EXPORT guththila_char_t *GUTHTHILA_CALL
00223 guththila_get_attribute_value_by_number(guththila_t * g, int index,
00224 const axutil_env_t *env);
00225
00226
00227
00228
00229
00230
00231
00232
00233 GUTHTHILA_EXPORT guththila_char_t *GUTHTHILA_CALL
00234 guththila_get_attribute_prefix_by_number(guththila_t * g, int index,
00235 const axutil_env_t *env);
00236
00237
00238
00239
00240
00241
00242 GUTHTHILA_EXPORT guththila_char_t *GUTHTHILA_CALL
00243 guththila_get_name(guththila_t * g, const axutil_env_t * env);
00244
00245
00246
00247
00248
00249
00250 GUTHTHILA_EXPORT guththila_char_t *GUTHTHILA_CALL
00251 guththila_get_prefix(guththila_t * g, const axutil_env_t * env);
00252
00253
00254
00255
00256
00257
00258 GUTHTHILA_EXPORT guththila_char_t *GUTHTHILA_CALL
00259 guththila_get_value(guththila_t * g, const axutil_env_t * env);
00260
00261
00262
00263
00264
00265
00266 GUTHTHILA_EXPORT guththila_namespace_t *GUTHTHILA_CALL
00267 guththila_get_namespace(guththila_t * g, const axutil_env_t * env);
00268
00269
00270
00271
00272
00273
00274 GUTHTHILA_EXPORT int GUTHTHILA_CALL
00275 guththila_get_namespace_count(guththila_t * g, const axutil_env_t * env);
00276
00277
00278
00279
00280
00281
00282
00283 GUTHTHILA_EXPORT guththila_char_t * GUTHTHILA_CALL
00284 guththila_get_namespace_uri(guththila_t * g, guththila_namespace_t * ns,
00285 const axutil_env_t * env);
00286
00287
00288
00289
00290
00291
00292
00293 GUTHTHILA_EXPORT guththila_char_t *GUTHTHILA_CALL
00294 guththila_get_namespace_prefix(guththila_t * p, guththila_namespace_t * ns,
00295 const axutil_env_t * env);
00296
00297
00298
00299
00300
00301
00302
00303
00304 GUTHTHILA_EXPORT guththila_char_t *GUTHTHILA_CALL
00305 guththila_get_namespace_prefix_by_number(guththila_t * g, int index,
00306 const axutil_env_t *env);
00307
00308
00309
00310
00311
00312
00313
00314
00315 GUTHTHILA_EXPORT guththila_char_t *GUTHTHILA_CALL
00316 guththila_get_namespace_uri_by_number(guththila_t * g, int index,
00317 const axutil_env_t *env);
00318
00319
00320
00321
00322
00323
00324
00325 GUTHTHILA_EXPORT guththila_char_t *GUTHTHILA_CALL
00326 guththila_get_attribute_namespace_by_number(guththila_t *g, int index,
00327 const axutil_env_t *env);
00328
00329
00330
00331
00332
00333
00334 GUTHTHILA_EXPORT guththila_char_t *GUTHTHILA_CALL
00335 guththila_get_encoding(guththila_t * p, const axutil_env_t * env);
00336
00337
00338
00339
00340
00341
00342 GUTHTHILA_EXPORT void GUTHTHILA_CALL
00343 guththila_set_error_handler(guththila_t * m, guththila_error_func,
00344 const axutil_env_t * env);
00345 EXTERN_C_END()
00346 #endif
00347