1 /*
2    ScheduleXML.h
3    Copyright (C) 2006  Bret Logan
4 
5    This program is free software; you can redistribute it and/or modify
6    it under the terms of the GNU General Public License as published by
7    the Free Software Foundation; either version 2 of the License, or
8    (at your option) any later version.
9 
10    This program is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    GNU General Public License for more details.
14 
15    You should have received a copy of the GNU General Public License
16    along with this program; if not, write to the Free Software
17    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  */
19 #ifndef _SCHEDULE_XML_
20 #define _SCHEDULE_XML_
21 
22 //Set to 1 to abort parsing:
23 extern int ParserXML_AbortFlag;
24 
25 ///////////////////////////////////
26 //sets user's internal local functing that parser can call:
27 void SetUserParserXMLHandler (void (*NewUserParserXMLHandler) (const gchar * Element,   //always a valid string
28                                                                const gchar * Attribute, //beware: this will equal NULL if there is no Attribute associated with this Element
29                                                                const gchar * Value));   //beware: this will equal NULL to announce end of Element to user
30 //initiates parsing:
31 int ParserXML_parse_file_xml (const gchar * filename);
32 int ParserXML_parse_gchararray_xml (const gchar * contents, int length);
33 
34 ///////////////////////////////////
35 //the rest are internal use; they can generall be ignored:
36 void ParserXML_start_element_handler (GMarkupParseContext * context,
37                                       const gchar * element_name,
38                                       const gchar ** attribute_names,
39                                       const gchar ** attribute_values,
40                                       gpointer user_data, GError ** error);
41 void ParserXML_end_element_handler (GMarkupParseContext * context,
42                                     const gchar * element_name,
43                                     gpointer user_data, GError ** error);
44 void ParserXML_error_handler (GMarkupParseContext * context,
45                               GError * error, gpointer user_data);
46 void ParserXML_passthrough_handler (GMarkupParseContext * context,
47                                     const gchar * passthrough_text,
48                                     gsize text_len,
49                                     gpointer user_data, GError ** error);
50 void ParserXML_text_handler (GMarkupParseContext * context,
51                              const gchar * text,
52                              gsize text_len,
53                              gpointer user_data, GError ** error);
54 void DefaultParserXMLHandler (const gchar * CurrentElement,
55                               const gchar * Attribute, const gchar * Value);
56 //make this "main" for standalone:
57 int ParserXML_main (int argc, char *argv[]);
58 #endif
59