diff options
Diffstat (limited to 'src/xine-utils')
| -rw-r--r-- | src/xine-utils/.hgignore (renamed from src/xine-utils/.cvsignore) | 0 | ||||
| -rw-r--r-- | src/xine-utils/Makefile.am | 2 | ||||
| -rw-r--r-- | src/xine-utils/array.c | 6 | ||||
| -rw-r--r-- | src/xine-utils/array.h | 6 | ||||
| -rw-r--r-- | src/xine-utils/attributes.h | 12 | ||||
| -rw-r--r-- | src/xine-utils/list.h | 4 | ||||
| -rw-r--r-- | src/xine-utils/memcpy.c | 2 | ||||
| -rw-r--r-- | src/xine-utils/xineutils.h | 7 | ||||
| -rw-r--r-- | src/xine-utils/xmllexer.c | 35 | ||||
| -rw-r--r-- | src/xine-utils/xmllexer.h | 31 | ||||
| -rw-r--r-- | src/xine-utils/xmlparser.c | 41 | ||||
| -rw-r--r-- | src/xine-utils/xmlparser.h | 34 |
12 files changed, 108 insertions, 72 deletions
diff --git a/src/xine-utils/.cvsignore b/src/xine-utils/.hgignore index 7d926a554..7d926a554 100644 --- a/src/xine-utils/.cvsignore +++ b/src/xine-utils/.hgignore diff --git a/src/xine-utils/Makefile.am b/src/xine-utils/Makefile.am index 7406abf86..95de06b9e 100644 --- a/src/xine-utils/Makefile.am +++ b/src/xine-utils/Makefile.am @@ -32,7 +32,7 @@ libxineutils_la_SOURCES = $(pppc_files) \ pool.c \ ring_buffer.c -include_HEADERS = \ +xineinclude_HEADERS = \ attributes.h \ compat.h \ xine_buffer.h \ diff --git a/src/xine-utils/array.c b/src/xine-utils/array.c index 4fcecbb4b..ed529515b 100644 --- a/src/xine-utils/array.c +++ b/src/xine-utils/array.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: array.c,v 1.3 2006/09/26 05:19:49 dgp85 Exp $ + * $Id: array.c,v 1.4 2007/02/03 16:31:55 dsalt Exp $ * */ #ifdef HAVE_CONFIG_H @@ -78,7 +78,7 @@ void xine_array_delete(xine_array_t *array) { free(array); } -size_t xine_array_size(xine_array_t *array) { +size_t xine_array_size(const xine_array_t *array) { return array->size; } @@ -116,7 +116,7 @@ void xine_array_remove(xine_array_t *array, unsigned int position) { } } -void *xine_array_get(xine_array_t *array, unsigned int position) { +void *xine_array_get(const xine_array_t *array, unsigned int position) { if (position < array->size) return array->chunk[position]; else diff --git a/src/xine-utils/array.h b/src/xine-utils/array.h index 45fc7b137..80b7d3c9b 100644 --- a/src/xine-utils/array.h +++ b/src/xine-utils/array.h @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: array.h,v 1.2 2006/09/26 05:19:49 dgp85 Exp $ + * $Id: array.h,v 1.3 2007/02/03 16:31:55 dsalt Exp $ * * Array that can grow automatically when you add elements. * Inserting an element in the middle of the array implies memory moves. @@ -35,7 +35,7 @@ xine_array_t *xine_array_new(size_t initial_size) XINE_PROTECTED; void xine_array_delete(xine_array_t *array) XINE_PROTECTED; /* Returns the number of element stored in the array */ -size_t xine_array_size(xine_array_t *array) XINE_PROTECTED; +size_t xine_array_size(const xine_array_t *array) XINE_PROTECTED; /* Removes all elements from an array */ void xine_array_clear(xine_array_t *array) XINE_PROTECTED; @@ -50,7 +50,7 @@ void xine_array_insert(xine_array_t *array, unsigned int position, void *value) void xine_array_remove(xine_array_t *array, unsigned int position) XINE_PROTECTED; /* Get the element at the position specified */ -void *xine_array_get(xine_array_t *array, unsigned int position) XINE_PROTECTED; +void *xine_array_get(const xine_array_t *array, unsigned int position) XINE_PROTECTED; /* Set the element at the position specified */ void xine_array_set(xine_array_t *array, unsigned int position, void *value) XINE_PROTECTED; diff --git a/src/xine-utils/attributes.h b/src/xine-utils/attributes.h index dd70d4309..4d22226ac 100644 --- a/src/xine-utils/attributes.h +++ b/src/xine-utils/attributes.h @@ -47,8 +47,10 @@ #endif /* Export protected only for libxine functions */ -#if defined(XINE_LIBRARY_COMPILE) && defined(SUPPORT_ATTRIBUTE_VISIBILITY) +#if defined(XINE_LIBRARY_COMPILE) && defined(SUPPORT_ATTRIBUTE_VISIBILITY_PROTECTED) # define XINE_PROTECTED __attribute__((visibility("protected"))) +#elif defined(XINE_LIBRARY_COMPILE) && defined(SUPPORT_ATTRIBUTE_VISIBILITY_DEFAULT) +# define XINE_PROTECTED __attribute__((visibility("default"))) #else # define XINE_PROTECTED #endif @@ -59,4 +61,12 @@ # define XINE_SENTINEL #endif +#ifndef __attr_unused +# ifdef SUPPORT_ATTRIBUTE_UNUSED +# define __attr_unused __attribute__((unused)) +# else +# define __attr_unused +# endif +#endif + #endif /* ATTRIBUTE_H_ */ diff --git a/src/xine-utils/list.h b/src/xine-utils/list.h index 9b9506a84..8273d30f1 100644 --- a/src/xine-utils/list.h +++ b/src/xine-utils/list.h @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: list.h,v 1.4 2006/09/26 05:19:49 dgp85 Exp $ + * $Id: list.h,v 1.5 2007/02/19 23:34:32 dgp85 Exp $ * * Doubly-linked linked list. * @@ -33,7 +33,7 @@ * xine_list_iterator_t ite = xine_list_front(list); * while (ite) { * _useful code here_ - * ite = xine_list_iterator_next(ite); + * ite = xine_list_next(list, ite); * } * * The list elements are managed using memory chunks and a free list. The first diff --git a/src/xine-utils/memcpy.c b/src/xine-utils/memcpy.c index 15301f108..539f4c8dd 100644 --- a/src/xine-utils/memcpy.c +++ b/src/xine-utils/memcpy.c @@ -461,7 +461,7 @@ void xine_probe_fast_memcpy(xine_t *xine) char *buf1, *buf2; int i, j, best; int config_flags = -1; - static char *memcpy_methods[] = { + static const char *memcpy_methods[] = { "probe", "libc", #if (defined(ARCH_X86) || defined(ARCH_X86_64)) && !defined(_MSC_VER) "kernel", "mmx", "mmxext", "sse", diff --git a/src/xine-utils/xineutils.h b/src/xine-utils/xineutils.h index 15f771da0..03c5f689a 100644 --- a/src/xine-utils/xineutils.h +++ b/src/xine-utils/xineutils.h @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xineutils.h,v 1.105 2006/10/16 22:18:24 valtri Exp $ + * $Id: xineutils.h,v 1.107 2006/12/25 15:16:33 dgp85 Exp $ * */ #ifndef XINEUTILS_H @@ -847,6 +847,7 @@ void xine_hexdump (const char *buf, int length) XINE_PROTECTED; do { \ LONG_LOG_MODULE_STRING \ printf(fmt, ##args); \ + fflush(stdout); \ } while(0) #else /* __GNUC__ */ #ifdef _MSC_VER @@ -854,12 +855,14 @@ void xine_hexdump (const char *buf, int length) XINE_PROTECTED; do { \ LONG_LOG_MODULE_STRING \ printf("%s", fmtargs); \ + fflush(stdout); \ } while(0) #else /* _MSC_VER */ - #define lprintf(fmt, ...) \ + #define lprintf(...) \ do { \ LONG_LOG_MODULE_STRING \ printf(__VA_ARGS__); \ + fflush(stdout); \ } while(0) #endif /* _MSC_VER */ #endif /* __GNUC__ */ diff --git a/src/xine-utils/xmllexer.c b/src/xine-utils/xmllexer.c index cc112b64a..575c37611 100644 --- a/src/xine-utils/xmllexer.c +++ b/src/xine-utils/xmllexer.c @@ -1,23 +1,24 @@ /* - * Copyright (C) 2002-2003 the xine project + * Copyright (C) 2002-2003,2007 the xine project * * This file is part of xine, a free video player. * - * xine 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. - * - * xine 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. + * The xine-lib XML parser is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. * - * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * The xine-lib XML parser 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 + * Library General Public License for more details. * - * $Id: xmllexer.c,v 1.12 2006/06/20 00:35:08 dgp85 Exp $ + * You should have received a copy of the GNU Library General Public + * License along with the Gnome Library; see the file COPYING.LIB. If not, + * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * $Id: xmllexer.c,v 1.13 2007/03/04 16:19:12 hadess Exp $ * */ @@ -27,11 +28,17 @@ #define LOG */ +#ifdef XINE_COMPILE #include "xineutils.h" +#else +#define lprintf(...) +#define xine_xmalloc malloc +#endif #include "xmllexer.h" #include <stdio.h> #include <ctype.h> #include <string.h> +#include <stdlib.h> /* private constants*/ #define NORMAL 0 /* normal lex mode */ diff --git a/src/xine-utils/xmllexer.h b/src/xine-utils/xmllexer.h index bd69204ff..5a217fcd8 100644 --- a/src/xine-utils/xmllexer.h +++ b/src/xine-utils/xmllexer.h @@ -1,23 +1,24 @@ /* - * Copyright (C) 2002-2003 the xine project + * Copyright (C) 2002-2003,2007 the xine project * * This file is part of xine, a free video player. * - * xine 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. + * The xine-lib XML parser is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. * - * xine 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. + * The xine-lib XML parser 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 + * Library 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * You should have received a copy of the GNU Library General Public + * License along with the Gnome Library; see the file COPYING.LIB. If not, + * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. * - * $Id: xmllexer.h,v 1.7 2006/09/26 05:19:49 dgp85 Exp $ + * $Id: xmllexer.h,v 1.8 2007/03/04 16:19:12 hadess Exp $ * */ @@ -25,6 +26,10 @@ #ifndef XML_LEXER_H #define XML_LEXER_H +#ifndef XINE_PROTECTED +#define XINE_PROTECTED +#endif + /* public constants */ #define T_ERROR -1 /* lexer error */ #define T_EOF 0 /* end of file */ diff --git a/src/xine-utils/xmlparser.c b/src/xine-utils/xmlparser.c index 2e8c84ae0..47096705a 100644 --- a/src/xine-utils/xmlparser.c +++ b/src/xine-utils/xmlparser.c @@ -1,24 +1,24 @@ /* - * Copyright (C) 2002-2003 the xine project + * Copyright (C) 2002-2003,2007 the xine project * * This file is part of xine, a free video player. - * This file is part of gxine, a free video player. * - * xine 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. + * The xine-lib XML parser is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. * - * xine 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. + * The xine-lib XML parser 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 + * Library 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * You should have received a copy of the GNU Library General Public + * License along with the Gnome Library; see the file COPYING.LIB. If not, + * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. * - * $Id: xmlparser.c,v 1.15 2006/02/14 02:25:01 dsalt Exp $ + * $Id: xmlparser.c,v 1.16 2007/03/04 16:19:12 hadess Exp $ * */ @@ -35,7 +35,12 @@ #define LOG */ +#ifdef XINE_COMPILE #include "xineutils.h" +#else +#define lprintf(...) +#define xine_xmalloc malloc +#endif #include "xmllexer.h" #include "xmlparser.h" @@ -466,7 +471,7 @@ int xml_parser_build_tree(xml_node_t **root_node) { return res; } -char *xml_parser_get_property (const xml_node_t *node, const char *name) { +const char *xml_parser_get_property (const xml_node_t *node, const char *name) { xml_property_t *prop; @@ -489,8 +494,8 @@ char *xml_parser_get_property (const xml_node_t *node, const char *name) { int xml_parser_get_property_int (const xml_node_t *node, const char *name, int def_value) { - char *v; - int ret; + const char *v; + int ret; v = xml_parser_get_property (node, name); @@ -506,7 +511,7 @@ int xml_parser_get_property_int (const xml_node_t *node, const char *name, int xml_parser_get_property_bool (const xml_node_t *node, const char *name, int def_value) { - char *v; + const char *v; v = xml_parser_get_property (node, name); diff --git a/src/xine-utils/xmlparser.h b/src/xine-utils/xmlparser.h index a19c81ec3..f202ca28d 100644 --- a/src/xine-utils/xmlparser.h +++ b/src/xine-utils/xmlparser.h @@ -1,28 +1,34 @@ /* - * Copyright (C) 2002-2003 the xine project + * Copyright (C) 2002-2003,2007 the xine project * * This file is part of xine, a free video player. * - * xine 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. + * The xine-lib XML parser is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. * - * xine 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. + * The xine-lib XML parser 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 + * Library 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * You should have received a copy of the GNU Library General Public + * License along with the Gnome Library; see the file COPYING.LIB. If not, + * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. * - * $Id: xmlparser.h,v 1.5 2006/09/26 05:19:49 dgp85 Exp $ + * $Id: xmlparser.h,v 1.6 2007/03/04 16:19:12 hadess Exp $ * */ + #ifndef XML_PARSER_H #define XML_PARSER_H +#ifndef XINE_PROTECTED +#define XINE_PROTECTED +#endif + /* parser modes */ #define XML_PARSER_CASE_INSENSITIVE 0 #define XML_PARSER_CASE_SENSITIVE 1 @@ -54,7 +60,7 @@ int xml_parser_build_tree(xml_node_t **root_node) XINE_PROTECTED; void xml_parser_free_tree(xml_node_t *root_node) XINE_PROTECTED; -char *xml_parser_get_property (const xml_node_t *node, const char *name) XINE_PROTECTED; +const char *xml_parser_get_property (const xml_node_t *node, const char *name) XINE_PROTECTED; int xml_parser_get_property_int (const xml_node_t *node, const char *name, int def_value) XINE_PROTECTED; int xml_parser_get_property_bool (const xml_node_t *node, const char *name, |
