~ubuntu-dev/mplayer/ubuntu-feisty

« back to all changes in this revision

Viewing changes to asxparser.h

  • Committer: Reinhard Tartler
  • Date: 2006-07-08 08:45:33 UTC
  • Revision ID: siretart@tauware.de-20060708084533-dbc155bde7122e78
imported mplayer_0.99+1.0pre7try2+cvs20060117

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
 
 
3
typedef struct _ASX_Parser_t ASX_Parser_t;
 
4
 
 
5
typedef struct {
 
6
  char* buffer;
 
7
  int line;
 
8
} ASX_LineSave_t;
 
9
 
 
10
struct _ASX_Parser_t {
 
11
  int line; // Curent line
 
12
  ASX_LineSave_t *ret_stack;
 
13
  int ret_stack_size;
 
14
  char* last_body;
 
15
  int deep;
 
16
};
 
17
  
 
18
ASX_Parser_t*
 
19
asx_parser_new(void);
 
20
 
 
21
void
 
22
asx_parser_free(ASX_Parser_t* parser);
 
23
 
 
24
/*
 
25
 * Return -1 on error, 0 when nothing is found, 1 on sucess
 
26
 */
 
27
int
 
28
asx_get_element(ASX_Parser_t* parser,char** _buffer,
 
29
                char** _element,char** _body,char*** _attribs);
 
30
 
 
31
int
 
32
asx_parse_attribs(ASX_Parser_t* parser,char* buffer,char*** _attribs);
 
33
 
 
34
/////// Attribs utils
 
35
 
 
36
char*
 
37
asx_get_attrib(char* attrib,char** attribs);
 
38
 
 
39
int
 
40
asx_attrib_to_enum(char* val,char** valid_vals);
 
41
 
 
42
#define asx_free_attribs(a) asx_list_free((void***)&a,free)
 
43
 
 
44
////// List utils
 
45
 
 
46
typedef void (*ASX_FreeFunc)(void* arg);
 
47
 
 
48
void
 
49
asx_list_free(void* list_ptr,ASX_FreeFunc free_func);