annotate asxparser.h @ 11555:2a84e9145fa3

native RV20
author gabucino
date Thu, 04 Dec 2003 10:17:52 +0000
parents 1f6ae3d15f19
children 75327b24e06f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4043
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
1
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
2
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
3 typedef struct _ASX_Parser_t ASX_Parser_t;
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
4
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
5 typedef struct {
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
6 char* buffer;
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
7 int line;
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
8 } ASX_LineSave_t;
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
9
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
10 struct _ASX_Parser_t {
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
11 int line; // Curent line
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
12 ASX_LineSave_t *ret_stack;
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
13 int ret_stack_size;
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
14 char* last_body;
4309
35b412015c39 Implementation of entryref
albeu
parents: 4043
diff changeset
15 int deep;
4043
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
16 };
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
17
8170
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
18 ASX_Parser_t*
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
19 asx_parser_new(void);
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
20
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
21 void
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
22 asx_parser_free(ASX_Parser_t* parser);
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
23
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
24 /*
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
25 * Return -1 on error, 0 when nothing is found, 1 on sucess
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
26 */
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
27 int
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
28 asx_get_element(ASX_Parser_t* parser,char** _buffer,
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
29 char** _element,char** _body,char*** _attribs);
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
30
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
31 int
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
32 asx_parse_attribs(ASX_Parser_t* parser,char* buffer,char*** _attribs);
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
33
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
34 /////// Attribs utils
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
35
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
36 char*
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
37 asx_get_attrib(char* attrib,char** attribs);
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
38
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
39 int
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
40 asx_attrib_to_enum(char* val,char** valid_vals);
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
41
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
42 #define asx_free_attribs(a) asx_list_free((void***)&a,free)
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
43
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
44 ////// List utils
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
45
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
46 typedef void (*ASX_FreeFunc)(void* arg);
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
47
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
48 void
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
49 asx_list_free(void* list_ptr,ASX_FreeFunc free_func);