view asxparser.h @ 17216:0fd3e0cc4fd0

1.1180: [does not apply] 1.1179: Removing obsolete, and until recently, misdocumented option -verbose. 1.1178: make -o mandatory and add a warning when the extension does not match the container format, patch by Reynaldo Pinochet 1.1177: Another examples showing how to play raw YUV video samples 1.1176: Make -really-quiet a common option. 1.1175: Fix -v/-verbose description. 1.1174: 10l: \ needs to be escaped in roff. 1.1173: 1/4l 1.1172: Formatting fix 1.1171: Give an example about how to use the famous cqif video samples
author ranma
date Sat, 17 Dec 2005 20:02:47 +0000
parents 1f6ae3d15f19
children 75327b24e06f
line wrap: on
line source



typedef struct _ASX_Parser_t ASX_Parser_t;

typedef struct {
  char* buffer;
  int line;
} ASX_LineSave_t;

struct _ASX_Parser_t {
  int line; // Curent line
  ASX_LineSave_t *ret_stack;
  int ret_stack_size;
  char* last_body;
  int deep;
};
  
ASX_Parser_t*
asx_parser_new(void);

void
asx_parser_free(ASX_Parser_t* parser);

/*
 * Return -1 on error, 0 when nothing is found, 1 on sucess
 */
int
asx_get_element(ASX_Parser_t* parser,char** _buffer,
		char** _element,char** _body,char*** _attribs);

int
asx_parse_attribs(ASX_Parser_t* parser,char* buffer,char*** _attribs);

/////// Attribs utils

char*
asx_get_attrib(char* attrib,char** attribs);

int
asx_attrib_to_enum(char* val,char** valid_vals);

#define asx_free_attribs(a) asx_list_free((void***)&a,free)

////// List utils

typedef void (*ASX_FreeFunc)(void* arg);

void
asx_list_free(void* list_ptr,ASX_FreeFunc free_func);