annotate asxparser.h @ 29269:4d9de809b174

Add a hack to detect when we are writing into a Windows pipe since the fseek incorrectly does not fail like it should. This ensures we will not incorrectly append the file header at the end. Based on patch by Zhou Zongyi [zhouzongyi at pset.suntec.net]
author reimar
date Sat, 16 May 2009 13:59:53 +0000
parents 0f1b5b68af32
children c1a3f1bbba26
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
26029
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25607
diff changeset
1 #ifndef MPLAYER_ASXPARSER_H
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25607
diff changeset
2 #define MPLAYER_ASXPARSER_H
4043
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
3
25607
9d0b189ce1b2 Fix illegal identifiers: Names starting with __ or _ and uppercase are reserved
diego
parents: 25553
diff changeset
4 typedef struct ASX_Parser_t ASX_Parser_t;
4043
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
5
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
6 typedef struct {
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
7 char* buffer;
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
8 int line;
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
9 } ASX_LineSave_t;
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
10
25607
9d0b189ce1b2 Fix illegal identifiers: Names starting with __ or _ and uppercase are reserved
diego
parents: 25553
diff changeset
11 struct ASX_Parser_t {
4043
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
12 int line; // Curent line
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
13 ASX_LineSave_t *ret_stack;
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
14 int ret_stack_size;
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
15 char* last_body;
4309
35b412015c39 Implementation of entryref
albeu
parents: 4043
diff changeset
16 int deep;
4043
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
17 };
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26029
diff changeset
18
8170
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
19 ASX_Parser_t*
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
20 asx_parser_new(void);
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
21
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
22 void
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
23 asx_parser_free(ASX_Parser_t* parser);
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 /*
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
26 * 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
27 */
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
28 int
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
29 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
30 char** _element,char** _body,char*** _attribs);
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
31
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
32 int
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
33 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
34
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
35 /////// Attribs utils
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
36
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
37 char*
19104
2ec2301183cd marks several read-only string parameters which aren't modified inside the called function as const. Patch by Stefan Huehner, stefan AT huehner-org
reynaldo
parents: 19053
diff changeset
38 asx_get_attrib(const char* attrib,char** attribs);
8170
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
39
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
40 int
19053
75327b24e06f marks several string parameters as const, as they are not modified inside the function, Patch by Stefan Huehner, stefan AT huehner-org
reynaldo
parents: 8170
diff changeset
41 asx_attrib_to_enum(const char* val,char** valid_vals);
8170
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
42
23609
ec2bfbd0d647 Get rid of a completely useless cast
reimar
parents: 19104
diff changeset
43 #define asx_free_attribs(a) asx_list_free(&a,free)
8170
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
44
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
45 ////// List utils
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
46
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
47 typedef void (*ASX_FreeFunc)(void* arg);
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
48
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
49 void
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
50 asx_list_free(void* list_ptr,ASX_FreeFunc free_func);
25553
6ac1ece1f9fe Add multiple inclusion guards to all header files that lack them.
diego
parents: 23609
diff changeset
51
26029
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25607
diff changeset
52 #endif /* MPLAYER_ASXPARSER_H */