Commit f6d427d7 authored by bar@bar.mysql.r18.ru's avatar bar@bar.mysql.r18.ru

User data

parent ffb82a97
......@@ -34,6 +34,7 @@ typedef struct xml_stack_st
const char *beg;
const char *cur;
const char *end;
void *user_data;
int (*enter)(struct xml_stack_st *st,const char *val, uint len);
int (*value)(struct xml_stack_st *st,const char *val, uint len);
int (*leave)(struct xml_stack_st *st,const char *val, uint len);
......@@ -46,6 +47,7 @@ int my_xml_parse(MY_XML_PARSER *st,const char *str, uint len);
void my_xml_set_value_handler(MY_XML_PARSER *st, int (*)(MY_XML_PARSER *, const char *, uint len));
void my_xml_set_enter_handler(MY_XML_PARSER *st, int (*)(MY_XML_PARSER *, const char *, uint len));
void my_xml_set_leave_handler(MY_XML_PARSER *st, int (*)(MY_XML_PARSER *, const char *, uint len));
void my_xml_set_user_data(MY_XML_PARSER *st, void *);
uint my_xml_error_pos(MY_XML_PARSER *st);
uint my_xml_error_lineno(MY_XML_PARSER *st);
......
......@@ -342,6 +342,11 @@ void my_xml_set_leave_handler(MY_XML_PARSER *p, int (*action)(MY_XML_PARSER *p,
p->leave=action;
}
void my_xml_set_user_data(MY_XML_PARSER *p, void *user_data)
{
p->user_data=user_data;
}
const char *my_xml_error_string(MY_XML_PARSER *p)
{
return p->errstr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment