Eneboo - Documentación para desarrolladores
|
00001 /* Copyright (C) 2000 MySQL AB 00002 00003 This program is free software; you can redistribute it and/or modify 00004 it under the terms of the GNU General Public License as published by 00005 the Free Software Foundation; version 2 of the License. 00006 00007 This program is distributed in the hope that it will be useful, 00008 but WITHOUT ANY WARRANTY; without even the implied warranty of 00009 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00010 GNU General Public License for more details. 00011 00012 You should have received a copy of the GNU General Public License 00013 along with this program; if not, write to the Free Software 00014 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ 00015 00016 00017 #ifndef _my_xml_h 00018 #define _my_xml_h 00019 00020 #ifdef __cplusplus 00021 extern "C" { 00022 #endif 00023 00024 00025 #define MY_XML_OK 0 00026 #define MY_XML_ERROR 1 00027 00028 typedef struct xml_stack_st 00029 { 00030 char errstr[128]; 00031 char attr[128]; 00032 char *attrend; 00033 const char *beg; 00034 const char *cur; 00035 const char *end; 00036 void *user_data; 00037 int (*enter)(struct xml_stack_st *st,const char *val, uint len); 00038 int (*value)(struct xml_stack_st *st,const char *val, uint len); 00039 int (*leave_xml)(struct xml_stack_st *st,const char *val, uint len); 00040 } MY_XML_PARSER; 00041 00042 void my_xml_parser_create(MY_XML_PARSER *st); 00043 void my_xml_parser_free(MY_XML_PARSER *st); 00044 int my_xml_parse(MY_XML_PARSER *st,const char *str, uint len); 00045 00046 void my_xml_set_value_handler(MY_XML_PARSER *st, int (*)(MY_XML_PARSER *, 00047 const char *, 00048 uint len)); 00049 void my_xml_set_enter_handler(MY_XML_PARSER *st, int (*)(MY_XML_PARSER *, 00050 const char *, 00051 uint len)); 00052 void my_xml_set_leave_handler(MY_XML_PARSER *st, int (*)(MY_XML_PARSER *, 00053 const char *, 00054 uint len)); 00055 void my_xml_set_user_data(MY_XML_PARSER *st, void *); 00056 00057 uint my_xml_error_pos(MY_XML_PARSER *st); 00058 uint my_xml_error_lineno(MY_XML_PARSER *st); 00059 00060 const char *my_xml_error_string(MY_XML_PARSER *st); 00061 00062 #ifdef __cplusplus 00063 } 00064 #endif 00065 00066 #endif /* _my_xml_h */