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