add spdif example from beandog
[mplayer/glamo.git] / asxparser.h
blob9763b699027137c4a819512b4b669f9a108f910c
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;
19 ASX_Parser_t*
20 asx_parser_new(void);
22 void
23 asx_parser_free(ASX_Parser_t* parser);
26 * Return -1 on error, 0 when nothing is found, 1 on sucess
28 int
29 asx_get_element(ASX_Parser_t* parser,char** _buffer,
30 char** _element,char** _body,char*** _attribs);
32 int
33 asx_parse_attribs(ASX_Parser_t* parser,char* buffer,char*** _attribs);
35 /////// Attribs utils
37 char*
38 asx_get_attrib(const char* attrib,char** attribs);
40 int
41 asx_attrib_to_enum(const char* val,char** valid_vals);
43 #define asx_free_attribs(a) asx_list_free(&a,free)
45 ////// List utils
47 typedef void (*ASX_FreeFunc)(void* arg);
49 void
50 asx_list_free(void* list_ptr,ASX_FreeFunc free_func);
52 #endif /* MPLAYER_ASXPARSER_H */