]> git.sesse.net Git - vlc/blob - include/vlc_xml.h
Replace vlc_bool_t by bool, VLC_TRUE by true and VLC_FALSE by false.
[vlc] / include / vlc_xml.h
1 /*****************************************************************************
2  * xml.h: XML abstraction layer
3  *****************************************************************************
4  * Copyright (C) 2004 the VideoLAN team
5  * $Id$
6  *
7  * Author: Gildas Bazin <gbazin@videolan.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 #if !defined( __LIBVLC__ )
25   #error You are not libvlc or one of its plugins. You cannot include this file
26 #endif
27
28 #ifndef _VLC_XML_H
29 #define _VLC_XML_H
30
31 # ifdef __cplusplus
32 extern "C" {
33 # endif
34
35 struct xml_t
36 {
37     VLC_COMMON_MEMBERS
38
39     /* Module properties */
40     module_t  *p_module;
41     xml_sys_t *p_sys;
42
43     xml_reader_t * (*pf_reader_create) ( xml_t *, stream_t * );
44     void (*pf_reader_delete) ( xml_reader_t * );
45
46     void (*pf_catalog_load) ( xml_t *, const char * );
47     void (*pf_catalog_add) ( xml_t *, const char *, const char *,
48                                const char * );
49 };
50
51 #define xml_Create( a ) __xml_Create( VLC_OBJECT(a) )
52 VLC_EXPORT( xml_t *, __xml_Create, ( vlc_object_t * ) );
53 VLC_EXPORT( void, xml_Delete, ( xml_t * ) );
54
55 #define xml_ReaderCreate( a, b ) a->pf_reader_create( a, b )
56 #define xml_ReaderDelete( a, b ) a->pf_reader_delete( b )
57 #define xml_CatalogLoad( a, b ) a->pf_catalog_load( a, b )
58 #define xml_CatalogAdd( a, b, c, d ) a->pf_catalog_add( a, b, c, d )
59
60 struct xml_reader_t
61 {
62     xml_t *p_xml;
63     xml_reader_sys_t *p_sys;
64
65     int (*pf_read) ( xml_reader_t * );
66     int (*pf_node_type) ( xml_reader_t * );
67     char * (*pf_name) ( xml_reader_t * );
68     char * (*pf_value) ( xml_reader_t * );
69     int (*pf_next_attr) ( xml_reader_t * );
70
71     int (*pf_use_dtd) ( xml_reader_t *, bool );
72 };
73
74 #define xml_ReaderRead( a ) a->pf_read( a )
75 #define xml_ReaderNodeType( a ) a->pf_node_type( a )
76 #define xml_ReaderName( a ) a->pf_name( a )
77 #define xml_ReaderValue( a ) a->pf_value( a )
78 #define xml_ReaderNextAttr( a ) a->pf_next_attr( a )
79 #define xml_ReaderUseDTD( a, b ) a->pf_use_dtd( a, b )
80
81 #define XML_READER_NONE 0
82 #define XML_READER_STARTELEM 1
83 #define XML_READER_ENDELEM 2
84 #define XML_READER_TEXT 3
85
86 # ifdef __cplusplus
87 }
88 # endif
89
90 #endif