X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=include%2Fvlc_xml.h;h=3bb8312b7a73ede0763763f3672785f80ac576e3;hb=73c7b4a1c052f145a4452fc3217465b5bbc808b7;hp=83d2e67f00c49fb05b42c2a3fad0b5e508f4bc14;hpb=0e17b717feed5b870b4fd1707399bf1e3688e7fe;p=vlc diff --git a/include/vlc_xml.h b/include/vlc_xml.h index 83d2e67f00..3bb8312b7a 100644 --- a/include/vlc_xml.h +++ b/include/vlc_xml.h @@ -1,24 +1,24 @@ /***************************************************************************** -* xml.h: XML abstraction layer -***************************************************************************** -* Copyright (C) 2004-2010 the VideoLAN team -* -* Author: Gildas Bazin -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. -*****************************************************************************/ + * vlc_xml.h: XML abstraction layer + ***************************************************************************** + * Copyright (C) 2004-2010 VLC authors and VideoLAN + * + * Author: Gildas Bazin + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. + *****************************************************************************/ #ifndef VLC_XML_H #define VLC_XML_H @@ -46,9 +46,9 @@ struct xml_t const char * ); }; -VLC_EXPORT( xml_t *, xml_Create, ( vlc_object_t * ) LIBVLC_USED ); +VLC_API xml_t * xml_Create( vlc_object_t * ) VLC_USED; #define xml_Create( a ) xml_Create( VLC_OBJECT(a) ) -VLC_EXPORT( void, xml_Delete, ( xml_t * ) ); +VLC_API void xml_Delete( xml_t * ); static inline void xml_CatalogLoad( xml_t *xml, const char *catalog ) { @@ -74,12 +74,13 @@ struct xml_reader_t const char *(*pf_next_attr) ( xml_reader_t *, const char ** ); int (*pf_use_dtd) ( xml_reader_t * ); + int (*pf_is_empty) ( xml_reader_t * ); }; -VLC_EXPORT( xml_reader_t *, xml_ReaderCreate, (vlc_object_t *, stream_t *) LIBVLC_USED ); +VLC_API xml_reader_t * xml_ReaderCreate(vlc_object_t *, stream_t *) VLC_USED; #define xml_ReaderCreate( a, s ) xml_ReaderCreate(VLC_OBJECT(a), s) -VLC_EXPORT( void, xml_ReaderDelete, (xml_reader_t *) ); -VLC_EXPORT( xml_reader_t *, xml_ReaderReset, (xml_reader_t *, stream_t *) LIBVLC_USED ); +VLC_API void xml_ReaderDelete(xml_reader_t *); +VLC_API xml_reader_t * xml_ReaderReset(xml_reader_t *, stream_t *) VLC_USED; static inline int xml_ReaderNextNode( xml_reader_t *reader, const char **pval ) { @@ -97,6 +98,14 @@ static inline int xml_ReaderUseDTD( xml_reader_t *reader ) return reader->pf_use_dtd( reader ); } +static inline int xml_ReaderIsEmptyElement( xml_reader_t *reader ) +{ + if(reader->pf_is_empty == NULL) + return -2; + + return reader->pf_is_empty( reader ); +} + enum { XML_READER_NONE=0, XML_READER_STARTELEM,