#ifndef __SDP_XML_H__ #define __SDP_XML_H__ #include #include #include typedef struct _sdp_xml_data sdp_xml_data_t; struct _sdp_xml_data { char *text; /* Pointer to the current buffer */ int size; /* Size of the current buffer */ sdp_data_t *data; /* The current item being built */ sdp_xml_data_t *next; /* Next item on the stack */ char type; /* 0 = Text or Hexadecimal */ }; typedef struct { XML_Parser parser; /* Parser object being used */ sdp_record_t *sdprec; /* SDP Record being built */ sdp_xml_data_t *stack_head; /* Top of the stack of attributes */ int attrId; /* Id of the most recently processed attribute */ } sdp_xml_context; sdp_xml_context *sdp_xml_init_context (void); int sdp_xml_parse_chunk(sdp_xml_context * context, const char *data, int size, int final); sdp_record_t *sdp_xml_get_record(sdp_xml_context * context); void sdp_xml_free_context(sdp_xml_context * context); void convert_sdp_record_to_xml(sdp_record_t * rec, void *userData, void (*appendFunc) (void *, const char *)); #endif