34 #include "gnc-xml-helper.h" 38 typedef void (*countCallbackFn) (
sixtp_gdv2* gd,
const char* type);
48 int commodities_total;
49 int commodities_loaded;
51 int transactions_total;
52 int transactions_loaded;
57 int schedXactions_total;
58 int schedXactions_loaded;
68 countCallbackFn countCallback;
74 typedef gboolean (*sixtp_start_handler) (GSList* sibling_data,
77 gpointer* data_for_children,
82 typedef gboolean (*sixtp_before_child_handler) (gpointer data_for_children,
83 GSList* data_from_children,
89 const gchar* child_tag);
91 typedef gboolean (*sixtp_after_child_handler) (gpointer data_for_children,
92 GSList* data_from_children,
98 const gchar* child_tag,
99 sixtp_child_result* child_result);
101 typedef gboolean (*sixtp_end_handler) (gpointer data_for_children,
102 GSList* data_from_children,
103 GSList* sibling_data,
104 gpointer parent_data,
105 gpointer global_data,
109 typedef gboolean (*sixtp_characters_handler) (GSList* sibling_data,
110 gpointer parent_data,
111 gpointer global_data,
116 typedef void (*sixtp_result_handler) (sixtp_child_result* result);
118 typedef void (*sixtp_fail_handler) (gpointer data_for_children,
119 GSList* data_from_children,
120 GSList* sibling_data,
121 gpointer parent_data,
122 gpointer global_data,
126 typedef void (*sixtp_push_handler) (xmlParserCtxtPtr xml_context,
132 sixtp_start_handler start_handler;
133 sixtp_before_child_handler before_child;
134 sixtp_after_child_handler after_child;
135 sixtp_end_handler end_handler;
136 sixtp_characters_handler characters_handler;
138 sixtp_fail_handler fail_handler;
141 sixtp_result_handler cleanup_result;
142 sixtp_result_handler cleanup_chars;
144 sixtp_result_handler result_fail_handler;
147 sixtp_result_handler chars_fail_handler;
151 GHashTable* child_parsers;
156 SIXTP_NO_MORE_HANDLERS,
158 SIXTP_START_HANDLER_ID,
159 SIXTP_BEFORE_CHILD_HANDLER_ID,
160 SIXTP_AFTER_CHILD_HANDLER_ID,
161 SIXTP_END_HANDLER_ID,
162 SIXTP_CHARACTERS_HANDLER_ID,
164 SIXTP_FAIL_HANDLER_ID,
166 SIXTP_CLEANUP_RESULT_ID,
167 SIXTP_CLEANUP_CHARS_ID,
169 SIXTP_RESULT_FAIL_ID,
172 } sixtp_handler_type;
175 #define SIXTP_MAGIC_CATCHER "&MAGIX&" 179 SIXTP_CHILD_RESULT_CHARS,
180 SIXTP_CHILD_RESULT_NODE
181 } sixtp_child_result_type;
185 sixtp_child_result_type type;
188 gboolean should_cleanup;
189 sixtp_result_handler cleanup_handler;
190 sixtp_result_handler fail_handler;
197 gpointer global_data;
198 xmlParserCtxtPtr saxParserCtxt;
199 sixtp* bad_xml_parser;
202 gboolean is_child_result_from_node_named (sixtp_child_result* cr,
204 void sixtp_child_free_data (sixtp_child_result* result);
205 void sixtp_child_result_destroy (sixtp_child_result* r);
206 void sixtp_child_result_print (sixtp_child_result* cr, FILE* f);
208 void sixtp_sax_start_handler (
void* user_data,
const xmlChar* name,
209 const xmlChar** attrs);
210 void sixtp_sax_characters_handler (
void* user_data,
const xmlChar* text,
212 void sixtp_sax_end_handler (
void* user_data,
const xmlChar* name);
214 sixtp* sixtp_new (
void);
215 void sixtp_destroy (
sixtp* sp);
218 xmlEntityPtr sixtp_sax_get_entity_handler (
void* user_data,
219 const xmlChar* name);
221 gboolean sixtp_parse_file (
sixtp*
sixtp,
const char* filename,
222 gpointer data_for_top_level, gpointer global_data,
223 gpointer* parse_result);
224 gboolean sixtp_parse_fd (
sixtp*
sixtp, FILE* fd,
225 gpointer data_for_top_level, gpointer global_data,
226 gpointer* parse_result);
227 gboolean sixtp_parse_buffer (
sixtp*
sixtp,
char* bufp,
int bufsz,
228 gpointer data_for_top_level, gpointer global_data,
229 gpointer* parse_result);
230 gboolean sixtp_parse_push (
sixtp*
sixtp, sixtp_push_handler push_handler,
231 gpointer push_user_data, gpointer data_for_top_level,
232 gpointer global_data, gpointer* parse_result);
234 void sixtp_set_start (
sixtp* parser, sixtp_start_handler start_handler);
235 void sixtp_set_before_child (
sixtp* parser,
236 sixtp_before_child_handler handler);
237 void sixtp_set_after_child (
sixtp* parser, sixtp_after_child_handler handler);
238 void sixtp_set_end (
sixtp* parser, sixtp_end_handler end_handler);
239 void sixtp_set_chars (
sixtp* parser, sixtp_characters_handler char_handler);
240 void sixtp_set_cleanup_result (
sixtp* parser, sixtp_result_handler handler);
241 void sixtp_set_cleanup_chars (
sixtp* parser, sixtp_result_handler handler);
242 void sixtp_set_fail (
sixtp* parser, sixtp_fail_handler handler);
243 void sixtp_set_result_fail (
sixtp* parser, sixtp_result_handler handler);
244 void sixtp_set_chars_fail (
sixtp* parser, sixtp_result_handler handler);
246 sixtp* sixtp_set_any (
sixtp* tochange, gboolean cleanup, ...);
247 sixtp* sixtp_add_some_sub_parsers (
sixtp* tochange, gboolean cleanup, ...);
249 gboolean sixtp_add_sub_parser (
sixtp* parser,
const gchar* tag,
252 QofBookFileType gnc_is_our_xml_file (
const char* filename,
253 gboolean* with_encoding);
255 QofBookFileType gnc_is_our_first_xml_chunk (
char* chunk,
256 gboolean* with_encoding);
258 void sixtp_run_callback (
sixtp_gdv2* data,
const char* type);
All type declarations for the whole Gnucash engine.
void(* QofBePercentageFunc)(const char *message, double percent)
DOCUMENT ME!
load and save data to files