Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef VLC_XML_H
00024 #define VLC_XML_H
00025
00026
00027
00028
00029
00030
00031
00032 # ifdef __cplusplus
00033 extern "C" {
00034 # endif
00035
00036 struct xml_t
00037 {
00038 VLC_COMMON_MEMBERS
00039
00040
00041 module_t *p_module;
00042 xml_sys_t *p_sys;
00043
00044 void (*pf_catalog_load) ( xml_t *, const char * );
00045 void (*pf_catalog_add) ( xml_t *, const char *, const char *,
00046 const char * );
00047 };
00048
00049 VLC_API xml_t * xml_Create( vlc_object_t * ) VLC_USED;
00050 #define xml_Create( a ) xml_Create( VLC_OBJECT(a) )
00051 VLC_API void xml_Delete( xml_t * );
00052
00053 static inline void xml_CatalogLoad( xml_t *xml, const char *catalog )
00054 {
00055 xml->pf_catalog_load( xml, catalog );
00056 }
00057
00058 static inline void xml_CatalogAdd( xml_t *xml, const char *type,
00059 const char *orig, const char *value )
00060 {
00061 xml->pf_catalog_add( xml, type, orig, value );
00062 }
00063
00064
00065 struct xml_reader_t
00066 {
00067 VLC_COMMON_MEMBERS
00068
00069 xml_reader_sys_t *p_sys;
00070 stream_t *p_stream;
00071 module_t *p_module;
00072
00073 int (*pf_next_node) ( xml_reader_t *, const char ** );
00074 const char *(*pf_next_attr) ( xml_reader_t *, const char ** );
00075
00076 int (*pf_use_dtd) ( xml_reader_t * );
00077 int (*pf_is_empty) ( xml_reader_t * );
00078 };
00079
00080 VLC_API xml_reader_t * xml_ReaderCreate(vlc_object_t *, stream_t *) VLC_USED;
00081 #define xml_ReaderCreate( a, s ) xml_ReaderCreate(VLC_OBJECT(a), s)
00082 VLC_API void xml_ReaderDelete(xml_reader_t *);
00083 VLC_API xml_reader_t * xml_ReaderReset(xml_reader_t *, stream_t *) VLC_USED;
00084
00085 static inline int xml_ReaderNextNode( xml_reader_t *reader, const char **pval )
00086 {
00087 return reader->pf_next_node( reader, pval );
00088 }
00089
00090 static inline const char *xml_ReaderNextAttr( xml_reader_t *reader,
00091 const char **pval )
00092 {
00093 return reader->pf_next_attr( reader, pval );
00094 }
00095
00096 static inline int xml_ReaderUseDTD( xml_reader_t *reader )
00097 {
00098 return reader->pf_use_dtd( reader );
00099 }
00100
00101 static inline int xml_ReaderIsEmptyElement( xml_reader_t *reader )
00102 {
00103 if(reader->pf_is_empty == NULL)
00104 return -2;
00105
00106 return reader->pf_is_empty( reader );
00107 }
00108
00109 enum {
00110 XML_READER_NONE=0,
00111 XML_READER_STARTELEM,
00112 XML_READER_ENDELEM,
00113 XML_READER_TEXT,
00114 };
00115
00116 # ifdef __cplusplus
00117 }
00118 # endif
00119
00120 #endif