diff options
| author | [email protected] <[email protected]> | 2011-03-24 14:00:19 +0000 |
|---|---|---|
| committer | [email protected] <[email protected]> | 2011-03-24 14:00:19 +0000 |
| commit | 0e93e6809c7beac4597148edc1dc09bcdf9a2ab3 (patch) | |
| tree | 113765e7f8351d84226a3de04f13daf86ddd82f9 /components/rtgui_win/include/rtgui/rtgui_xml.h | |
| parent | 96c53b49571adadd957df804f4f5e6698c14e3b3 (diff) | |
add rtgui_win subfield,Highlight the ease of use
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1345 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components/rtgui_win/include/rtgui/rtgui_xml.h')
| -rw-r--r-- | components/rtgui_win/include/rtgui/rtgui_xml.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/components/rtgui_win/include/rtgui/rtgui_xml.h b/components/rtgui_win/include/rtgui/rtgui_xml.h new file mode 100644 index 0000000000..abdc5c79af --- /dev/null +++ b/components/rtgui_win/include/rtgui/rtgui_xml.h @@ -0,0 +1,34 @@ +#ifndef __RTGUI_XML_H__ +#define __RTGUI_XML_H__ + +#include <rtgui/rtgui.h> + +/* Types of events: start element, end element, text, attr name, attr + val and start/end document. Other events can be ignored! */ +enum { + EVENT_START = 0, /* Start tag */ + EVENT_END, /* End tag */ + EVENT_TEXT, /* Text */ + EVENT_NAME, /* Attribute name */ + EVENT_VAL, /* Attribute value */ + EVENT_END_DOC, /* End of document */ + EVENT_COPY, /* Internal only; copies to internal buffer */ + EVENT_NONE /* Internal only; should never see this event */ +}; + +/* xml structure typedef */ +typedef struct rtgui_xml rtgui_xml_t; +typedef int (*XML_handle)(rt_uint8_t event, const char* text, rt_size_t len, void* user); + +/* create a xml parser context */ +rtgui_xml_t* rtgui_xml_create(rt_size_t buffer_size, XML_handle handler, void* user); +/* destroy a xml parser context */ +void rtgui_xml_destroy(rtgui_xml_t* rtgui_xml); + +/* parse xml buffer */ +int rtgui_xml_parse(rtgui_xml_t* rtgui_xml, const char* buf, rt_size_t len); + +/* event string */ +const char* rtgui_xml_event_str(rt_uint8_t event); + +#endif |
