|
GnuCash 2.4.99
|
00001 /******************************************************************** 00002 * sixtp-stack.h * 00003 * Copyright 2001 Gnumatic, Inc. * 00004 * * 00005 * This program is free software; you can redistribute it and/or * 00006 * modify it under the terms of the GNU General Public License as * 00007 * published by the Free Software Foundation; either version 2 of * 00008 * the License, or (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License* 00016 * along with this program; if not, contact: * 00017 * * 00018 * Free Software Foundation Voice: +1-617-542-5942 * 00019 * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 * 00020 * Boston, MA 02110-1301, USA gnu@gnu.org * 00021 * * 00022 ********************************************************************/ 00023 00024 #ifndef SIXTP_STACK_H 00025 #define SIXTP_STACK_H 00026 00027 #include <glib.h> 00028 00029 #include "sixtp.h" 00030 00031 typedef struct sixtp_stack_frame 00032 { 00033 sixtp *parser; 00034 gchar *tag; 00035 gpointer data_for_children; 00036 GSList *data_from_children; /* in reverse chronological order */ 00037 gpointer frame_data; 00038 00039 /* Line and column [of the start tag]; set during parsing. */ 00040 int line; 00041 int col; 00042 } sixtp_stack_frame; 00043 00044 struct _sixtp_parser_context_struct 00045 { 00046 xmlSAXHandler handler; 00047 sixtp_sax_data data; 00048 sixtp_stack_frame *top_frame; 00049 gpointer top_frame_data; 00050 }; 00051 typedef struct _sixtp_parser_context_struct sixtp_parser_context; 00052 00053 void sixtp_stack_frame_destroy(sixtp_stack_frame *sf); 00054 00055 void sixtp_stack_frame_print(sixtp_stack_frame *sf, gint indent, FILE *f); 00056 00057 GSList* sixtp_pop_and_destroy_frame(GSList *frame_stack); 00058 00059 void sixtp_print_frame_stack(GSList *stack, FILE *f); 00060 00061 sixtp_stack_frame* sixtp_stack_frame_new(sixtp* next_parser, char *tag); 00062 00063 sixtp_parser_context* sixtp_context_new(sixtp *initial_parser, 00064 gpointer global_data, 00065 gpointer top_level_data); 00066 void sixtp_context_destroy(sixtp_parser_context* context); 00067 void sixtp_context_run_end_handler(sixtp_parser_context* ctxt); 00068 00069 #endif /* _SIXTP_STACK_H_ */
1.7.4