demux_mkv: use new EBML parser for attachment parsing
[mplayer/kovensky.git] / asxparser.h
blob7b148a77757fbf668a15252377c79b1a44c1b668
1 #ifndef MPLAYER_ASXPARSER_H
2 #define MPLAYER_ASXPARSER_H
4 typedef struct ASX_Parser_t ASX_Parser_t;
6 typedef struct {
7 char* buffer;
8 int line;
9 } ASX_LineSave_t;
11 struct ASX_Parser_t {
12 int line; // Curent line
13 ASX_LineSave_t *ret_stack;
14 int ret_stack_size;
15 char* last_body;
16 int deep;
17 struct m_config *mconfig;
20 struct m_config;
21 ASX_Parser_t*
22 asx_parser_new(struct m_config *mconfig);
24 void
25 asx_parser_free(ASX_Parser_t* parser);
28 * Return -1 on error, 0 when nothing is found, 1 on sucess
30 int
31 asx_get_element(ASX_Parser_t* parser,char** _buffer,
32 char** _element,char** _body,char*** _attribs);
34 int
35 asx_parse_attribs(ASX_Parser_t* parser,char* buffer,char*** _attribs);
37 /////// Attribs utils
39 char*
40 asx_get_attrib(const char* attrib,char** attribs);
42 int
43 asx_attrib_to_enum(const char* val,char** valid_vals);
45 #define asx_free_attribs(a) asx_list_free(&a,free)
47 ////// List utils
49 typedef void (*ASX_FreeFunc)(void* arg);
51 void
52 asx_list_free(void* list_ptr,ASX_FreeFunc free_func);
54 #endif /* MPLAYER_ASXPARSER_H */