/src/vlc/include/vlc_xml.h
Line | Count | Source (jump to first uncovered line) |
1 | | /***************************************************************************** |
2 | | * vlc_xml.h: XML abstraction layer |
3 | | ***************************************************************************** |
4 | | * Copyright (C) 2004-2010 VLC authors and VideoLAN |
5 | | * |
6 | | * Author: Gildas Bazin <gbazin@videolan.org> |
7 | | * |
8 | | * This program is free software; you can redistribute it and/or modify it |
9 | | * under the terms of the GNU Lesser General Public License as published by |
10 | | * the Free Software Foundation; either version 2.1 of the License, or |
11 | | * (at your option) any later version. |
12 | | * |
13 | | * This program is distributed in the hope that it will be useful, |
14 | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | | * GNU Lesser General Public License for more details. |
17 | | * |
18 | | * You should have received a copy of the GNU Lesser General Public License |
19 | | * along with this program; if not, write to the Free Software Foundation, |
20 | | * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. |
21 | | *****************************************************************************/ |
22 | | |
23 | | #ifndef VLC_XML_H |
24 | | #define VLC_XML_H |
25 | | |
26 | | /** |
27 | | * \file |
28 | | * This file defines functions and structures to handle xml tags in vlc |
29 | | * |
30 | | */ |
31 | | |
32 | | # ifdef __cplusplus |
33 | | extern "C" { |
34 | | # endif |
35 | | |
36 | | struct xml_t |
37 | | { |
38 | | struct vlc_object_t obj; |
39 | | |
40 | | /* Module properties */ |
41 | | module_t *p_module; |
42 | | void *p_sys; |
43 | | |
44 | | void (*pf_catalog_load) ( xml_t *, const char * ); |
45 | | void (*pf_catalog_add) ( xml_t *, const char *, const char *, |
46 | | const char * ); |
47 | | }; |
48 | | |
49 | | VLC_API xml_t * xml_Create( vlc_object_t * ) VLC_USED; |
50 | 3.74k | #define xml_Create( a ) xml_Create( VLC_OBJECT(a) ) |
51 | | VLC_API void xml_Delete( xml_t * ); |
52 | | |
53 | | static inline void xml_CatalogLoad( xml_t *xml, const char *catalog ) |
54 | 0 | { |
55 | 0 | xml->pf_catalog_load( xml, catalog ); |
56 | 0 | } Unexecuted instantiation: ttml.c:xml_CatalogLoad Unexecuted instantiation: substtml.c:xml_CatalogLoad Unexecuted instantiation: libxml.c:xml_CatalogLoad Unexecuted instantiation: subsdec.c:xml_CatalogLoad Unexecuted instantiation: subsusf.c:xml_CatalogLoad Unexecuted instantiation: xml.c:xml_CatalogLoad |
57 | | |
58 | | static inline void xml_CatalogAdd( xml_t *xml, const char *type, |
59 | | const char *orig, const char *value ) |
60 | 0 | { |
61 | 0 | xml->pf_catalog_add( xml, type, orig, value ); |
62 | 0 | } Unexecuted instantiation: ttml.c:xml_CatalogAdd Unexecuted instantiation: substtml.c:xml_CatalogAdd Unexecuted instantiation: libxml.c:xml_CatalogAdd Unexecuted instantiation: subsdec.c:xml_CatalogAdd Unexecuted instantiation: subsusf.c:xml_CatalogAdd Unexecuted instantiation: xml.c:xml_CatalogAdd |
63 | | |
64 | | |
65 | | struct xml_reader_t |
66 | | { |
67 | | struct vlc_object_t obj; |
68 | | |
69 | | void *p_sys; |
70 | | stream_t *p_stream; |
71 | | module_t *p_module; |
72 | | |
73 | | int (*pf_next_node) ( xml_reader_t *, const char **, const char ** ); |
74 | | const char *(*pf_next_attr) ( xml_reader_t *, const char **, const char ** ); |
75 | | |
76 | | int (*pf_use_dtd) ( xml_reader_t * ); |
77 | | int (*pf_is_empty) ( xml_reader_t * ); |
78 | | }; |
79 | | |
80 | | VLC_API xml_reader_t * xml_ReaderCreate(vlc_object_t *, stream_t *) VLC_USED; |
81 | 28.7k | #define xml_ReaderCreate( a, s ) xml_ReaderCreate(VLC_OBJECT(a), s) |
82 | | VLC_API void xml_ReaderDelete(xml_reader_t *); |
83 | | |
84 | | static inline int xml_ReaderNextNode( xml_reader_t *reader, const char **pval ) |
85 | 0 | { |
86 | 0 | return reader->pf_next_node( reader, pval, NULL ); |
87 | 0 | } Unexecuted instantiation: ttml.c:xml_ReaderNextNode Unexecuted instantiation: substtml.c:xml_ReaderNextNode Unexecuted instantiation: libxml.c:xml_ReaderNextNode Unexecuted instantiation: subsdec.c:xml_ReaderNextNode Unexecuted instantiation: subsusf.c:xml_ReaderNextNode Unexecuted instantiation: xml.c:xml_ReaderNextNode |
88 | | |
89 | | static inline int xml_ReaderNextNodeNS( xml_reader_t *reader, |
90 | | const char **pval, |
91 | | const char **pnamespace ) |
92 | 1.42M | { |
93 | 1.42M | return reader->pf_next_node( reader, pval, pnamespace ); |
94 | 1.42M | } ttml.c:xml_ReaderNextNodeNS Line | Count | Source | 92 | 1.38M | { | 93 | 1.38M | return reader->pf_next_node( reader, pval, pnamespace ); | 94 | 1.38M | } |
substtml.c:xml_ReaderNextNodeNS Line | Count | Source | 92 | 42.2k | { | 93 | 42.2k | return reader->pf_next_node( reader, pval, pnamespace ); | 94 | 42.2k | } |
Unexecuted instantiation: libxml.c:xml_ReaderNextNodeNS Unexecuted instantiation: subsdec.c:xml_ReaderNextNodeNS Unexecuted instantiation: subsusf.c:xml_ReaderNextNodeNS Unexecuted instantiation: xml.c:xml_ReaderNextNodeNS |
95 | | |
96 | | static inline const char *xml_ReaderNextAttr( xml_reader_t *reader, |
97 | | const char **pval ) |
98 | 0 | { |
99 | 0 | return reader->pf_next_attr( reader, pval, NULL ); |
100 | 0 | } Unexecuted instantiation: ttml.c:xml_ReaderNextAttr Unexecuted instantiation: substtml.c:xml_ReaderNextAttr Unexecuted instantiation: libxml.c:xml_ReaderNextAttr Unexecuted instantiation: subsdec.c:xml_ReaderNextAttr Unexecuted instantiation: subsusf.c:xml_ReaderNextAttr Unexecuted instantiation: xml.c:xml_ReaderNextAttr |
101 | | |
102 | | static inline const char *xml_ReaderNextAttrNS( xml_reader_t *reader, |
103 | | const char **pval, |
104 | | const char **pnamespace ) |
105 | 1.89M | { |
106 | 1.89M | return reader->pf_next_attr( reader, pval, pnamespace ); |
107 | 1.89M | } ttml.c:xml_ReaderNextAttrNS Line | Count | Source | 105 | 1.89M | { | 106 | 1.89M | return reader->pf_next_attr( reader, pval, pnamespace ); | 107 | 1.89M | } |
Unexecuted instantiation: substtml.c:xml_ReaderNextAttrNS Unexecuted instantiation: libxml.c:xml_ReaderNextAttrNS Unexecuted instantiation: subsdec.c:xml_ReaderNextAttrNS Unexecuted instantiation: subsusf.c:xml_ReaderNextAttrNS Unexecuted instantiation: xml.c:xml_ReaderNextAttrNS |
108 | | |
109 | | static inline int xml_ReaderUseDTD( xml_reader_t *reader ) |
110 | 0 | { |
111 | 0 | return reader->pf_use_dtd( reader ); |
112 | 0 | } Unexecuted instantiation: ttml.c:xml_ReaderUseDTD Unexecuted instantiation: substtml.c:xml_ReaderUseDTD Unexecuted instantiation: libxml.c:xml_ReaderUseDTD Unexecuted instantiation: subsdec.c:xml_ReaderUseDTD Unexecuted instantiation: subsusf.c:xml_ReaderUseDTD Unexecuted instantiation: xml.c:xml_ReaderUseDTD |
113 | | |
114 | | static inline int xml_ReaderIsEmptyElement( xml_reader_t *reader ) |
115 | 1.38M | { |
116 | 1.38M | if(reader->pf_is_empty == NULL) |
117 | 0 | return -2; |
118 | | |
119 | 1.38M | return reader->pf_is_empty( reader ); |
120 | 1.38M | } ttml.c:xml_ReaderIsEmptyElement Line | Count | Source | 115 | 1.38M | { | 116 | 1.38M | if(reader->pf_is_empty == NULL) | 117 | 0 | return -2; | 118 | | | 119 | 1.38M | return reader->pf_is_empty( reader ); | 120 | 1.38M | } |
Unexecuted instantiation: substtml.c:xml_ReaderIsEmptyElement Unexecuted instantiation: libxml.c:xml_ReaderIsEmptyElement Unexecuted instantiation: subsdec.c:xml_ReaderIsEmptyElement Unexecuted instantiation: subsusf.c:xml_ReaderIsEmptyElement Unexecuted instantiation: xml.c:xml_ReaderIsEmptyElement |
121 | | |
122 | | enum { |
123 | | XML_READER_ERROR=-1, |
124 | | XML_READER_NONE=0, |
125 | | XML_READER_STARTELEM, |
126 | | XML_READER_ENDELEM, |
127 | | XML_READER_TEXT, |
128 | | }; |
129 | | |
130 | | # ifdef __cplusplus |
131 | | } |
132 | | # endif |
133 | | |
134 | | #endif |