annotate asxparser.h @ 30429:c1a3f1bbba26

Add license header to all top-level files missing them.
author diego
date Sat, 30 Jan 2010 23:24:23 +0000
parents 0f1b5b68af32
children dad8e0eb182a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
30429
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29263
diff changeset
1 /*
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29263
diff changeset
2 * This file is part of MPlayer.
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29263
diff changeset
3 *
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29263
diff changeset
4 * MPlayer is free software; you can redistribute it and/or modify
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29263
diff changeset
5 * it under the terms of the GNU General Public License as published by
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29263
diff changeset
6 * the Free Software Foundation; either version 2 of the License, or
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29263
diff changeset
7 * (at your option) any later version.
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29263
diff changeset
8 *
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29263
diff changeset
9 * MPlayer is distributed in the hope that it will be useful,
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29263
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29263
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29263
diff changeset
12 * GNU General Public License for more details.
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29263
diff changeset
13 *
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29263
diff changeset
14 * You should have received a copy of the GNU General Public License along
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29263
diff changeset
15 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29263
diff changeset
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29263
diff changeset
17 */
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29263
diff changeset
18
26029
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25607
diff changeset
19 #ifndef MPLAYER_ASXPARSER_H
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25607
diff changeset
20 #define MPLAYER_ASXPARSER_H
4043
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
21
25607
9d0b189ce1b2 Fix illegal identifiers: Names starting with __ or _ and uppercase are reserved
diego
parents: 25553
diff changeset
22 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
23
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
24 typedef struct {
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
25 char* buffer;
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
26 int line;
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
27 } ASX_LineSave_t;
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
28
25607
9d0b189ce1b2 Fix illegal identifiers: Names starting with __ or _ and uppercase are reserved
diego
parents: 25553
diff changeset
29 struct ASX_Parser_t {
4043
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
30 int line; // Curent line
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
31 ASX_LineSave_t *ret_stack;
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
32 int ret_stack_size;
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
33 char* last_body;
4309
35b412015c39 Implementation of entryref
albeu
parents: 4043
diff changeset
34 int deep;
4043
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
35 };
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26029
diff changeset
36
8170
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
37 ASX_Parser_t*
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
38 asx_parser_new(void);
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 void
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
41 asx_parser_free(ASX_Parser_t* parser);
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
42
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 * 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
45 */
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
46 int
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
47 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
48 char** _element,char** _body,char*** _attribs);
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
49
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
50 int
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
51 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
52
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
53 /////// Attribs utils
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
54
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
55 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
56 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
57
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
58 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
59 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
60
23609
ec2bfbd0d647 Get rid of a completely useless cast
reimar
parents: 19104
diff changeset
61 #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
62
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
63 ////// List utils
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
64
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
65 typedef void (*ASX_FreeFunc)(void* arg);
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
66
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
67 void
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
68 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
69
26029
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25607
diff changeset
70 #endif /* MPLAYER_ASXPARSER_H */