1 /*****************************************************************************
2 * xmlreading.h : Videolan.org's Addons xml readers helper
3 *****************************************************************************
4 * Copyright (C) 2014 VLC authors and VideoLAN
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation; either version 2.1 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
19 *****************************************************************************/
21 #define BINDNODE(name,target,type)\
22 if ( ! strcmp(p_node, name) )\
24 if ( type == TYPE_STRING ) \
25 data_pointer.u_data.ppsz = (char**)⌖\
26 else if ( type == TYPE_LONG ) \
27 data_pointer.u_data.pl = (long*)⌖\
29 data_pointer.u_data.pi = (int*)⌖\
30 data_pointer.e_type = type;\
43 TYPE_NONE, TYPE_STRING, TYPE_INTEGER, TYPE_LONG
45 } data_pointer = { {NULL}, TYPE_NONE };
48 static inline int ReadType( const char *value )
50 if ( !strcmp( value, "playlist" ) )
51 return ADDON_PLAYLIST_PARSER;
52 else if ( !strcmp( value, "skin" ) )
54 else if ( !strcmp( value, "discovery" ) )
55 return ADDON_SERVICE_DISCOVERY;
56 else if ( !strcmp( value, "extension" ) )
57 return ADDON_EXTENSION;
58 else if ( !strcmp( value, "interface" ) )
59 return ADDON_INTERFACE;
60 else if ( !strcmp( value, "meta" ) )
66 static inline const char * getTypePsz( int i_type )
70 case ADDON_PLAYLIST_PARSER:
74 case ADDON_SERVICE_DISCOVERY: