* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include <vlc/vlc.h>
#include "vlc_xml.h"
#include <ctype.h>
#include <stdarg.h>
-#include <stdio.h>
#undef XTAG_DEBUG
static XTag *xtag_new_parse( const char *, int );
static char *xtag_get_name( XTag * );
+#if 0
static char *xtag_get_pcdata( XTag * );
static char *xtag_get_attribute( XTag *, char * );
+#endif
static XTag *xtag_first_child( XTag *, char * );
static XTag *xtag_next_child( XTag *, char * );
static XTag *xtag_free( XTag * );
*****************************************************************************/
static void Close( vlc_object_t *p_this )
{
+ VLC_UNUSED(p_this);
return;
}
*****************************************************************************/
static void CatalogLoad( xml_t *p_xml, const char *psz_filename )
{
+ VLC_UNUSED(psz_filename);
msg_Dbg( p_xml, "catalog support not implemented" );
}
static void CatalogAdd( xml_t *p_xml, const char *psz_arg1,
const char *psz_arg2, const char *psz_filename )
{
+ VLC_UNUSED(p_xml); VLC_UNUSED(psz_arg1); VLC_UNUSED(psz_arg2);
+ VLC_UNUSED(psz_filename);
}
/*****************************************************************************
i_pos += i_size;
i_buffer += i_size;
p_new = realloc( p_buffer, i_buffer );
- if (!p_new) {
+ if( !p_new )
+ {
msg_Err( p_xml, "out of memory" );
free( p_buffer );
return NULL;
static int ReaderUseDTD ( xml_reader_t *p_reader, vlc_bool_t b_use )
{
+ VLC_UNUSED(p_reader); VLC_UNUSED(b_use);
return VLC_EGENERIC;
}
if( last->next == NULL ) break;
if( last ) last->next = l;
- l->prev = last;
+ l->prev = last;
return list;
}
char *name;
char *pcdata;
char *s;
- int xi;
+ int xi;
if( !parser->valid ) return NULL;
/* if this starts a comment tag, skip until end */
if( (parser->end - parser->start) > 7 &&
- xtag_cin( s[0], X_OPENTAG ) && xtag_cin( s[1], X_EMARK ) &&
+ xtag_cin( s[0], X_OPENTAG ) && xtag_cin( s[1], X_EMARK ) &&
xtag_cin( s[2], X_DASH ) && xtag_cin( s[3], X_DASH ) )
{
parser->start = s = &s[4];
/* ignore processing instructions '<?' ... '?>' */
if( (parser->end - parser->start) > 4 &&
- xtag_cin( s[0], X_OPENTAG ) && xtag_cin( s[1], X_QMARK ) )
+ xtag_cin( s[0], X_OPENTAG ) && xtag_cin( s[1], X_QMARK ) )
{
parser->start = s = &s[2];
while ((xi = xtag_index( parser, X_QMARK )) >= 0) {
/* ignore doctype '<!DOCTYPE' ... '>' */
if ( (parser->end - parser->start) > 8 &&
- !strncmp( s, "<!DOCTYPE", 9 ) ) {
+ !strncmp( s, "<!DOCTYPE", 9 ) ) {
xi = xtag_index( parser, X_CLOSETAG );
if ( xi > 0 ) {
parser->start = s = &s[xi+1];
return NULL;
/* parse CDATA content */
- if ( (parser->end - parser->start) > 8 &&
- !strncmp( s, "<![CDATA[", 9 ) ) {
+ if ( (parser->end - parser->start) > 8 &&
+ !strncmp( s, "<![CDATA[", 9 ) ) {
parser->start = s = &s[9];
while (parser->end - s > 2) {
if (strncmp( s, "]]>", 3 ) == 0) {
if( xtag == NULL ) return NULL;
- if( xtag->name ) free( xtag->name );
- if( xtag->pcdata ) free( xtag->pcdata );
+ free( xtag->name );
+ free( xtag->pcdata );
for( l = xtag->attributes; l; l = l->next )
{
if( (attr = (XAttribute *)l->data) != NULL )
{
- if( attr->name ) free( attr->name );
- if( attr->value ) free( attr->value );
+ free( attr->name );
+ free( attr->value );
free( attr );
}
}
{
#ifdef XTAG_DEBUG
printf ("empty buffer");
-#endif
+#endif
return NULL;
}
else parser.end = (char *)&s[n];
return xtag ? xtag->name : NULL;
}
+#if 0
static char *xtag_get_pcdata( XTag *xtag )
{
XList *l;
return NULL;
}
+#endif
static XTag *xtag_first_child( XTag *xtag, char *name )
{
int len, to_copy, total = 0;
va_start( ap, n );
-
+
for( s = va_arg( ap, char * ); s; s = va_arg( ap, char *) )
{
len = strlen (s);
for( l = xtag->attributes; l; l = l->next )
{
attr = (XAttribute *)l->data;
-
+
nn = xtag_snprints( buf, n, " ", attr->name, "=\"", attr->value,
"\"", NULL);
FORWARD( nn );