From 403099819f8470dec7598f2c99b4e90c5580ffdf Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Wed, 16 Nov 2005 12:25:22 +0000 Subject: [PATCH] gst/: remove functions copied from GLib 2.6 Original commit message from CVS: * gst/glib-compat.c: (gst_flags_get_first_value): * gst/glib-compat.h: * gst/gstregistryxml.c: remove functions copied from GLib 2.6 --- ChangeLog | 7 +++ gst/glib-compat.c | 123 ------------------------------------------- gst/glib-compat.h | 15 +----- gst/gstregistryxml.c | 1 + 4 files changed, 10 insertions(+), 136 deletions(-) diff --git a/ChangeLog b/ChangeLog index e6ab3c1207..8aee3bb486 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-11-16 Thomas Vander Stichele + + * gst/glib-compat.c: (gst_flags_get_first_value): + * gst/glib-compat.h: + * gst/gstregistryxml.c: + remove functions copied from GLib 2.6 + 2005-11-16 Michael Smith * gst/Makefile.am: diff --git a/gst/glib-compat.c b/gst/glib-compat.c index 1100d8bd70..9272a5f966 100644 --- a/gst/glib-compat.c +++ b/gst/glib-compat.c @@ -142,129 +142,6 @@ g_mkdir_with_parents (const gchar * pathname, int mode) #endif -#if !GLIB_CHECK_VERSION (2, 6, 0) -/** - * g_mkdir: - * @filename: a pathname in the GLib file name encoding (UTF-8 on Windows) - * @mode: permissions to use for the newly created directory - * - * A wrapper for the POSIX mkdir() function. The mkdir() function - * attempts to create a directory with the given name and permissions. - * - * See the C library manual for more details about mkdir(). - * - * Returns: 0 if the directory was successfully created, -1 if an error - * occurred - * - * Since: 2.6 - */ -int -g_mkdir (const gchar * filename, int mode) -{ -#ifdef G_OS_WIN32 - if (G_WIN32_HAVE_WIDECHAR_API ()) { - wchar_t *wfilename = g_utf8_to_utf16 (filename, -1, NULL, NULL, NULL); - int retval; - int save_errno; - - if (wfilename == NULL) { - errno = EINVAL; - return -1; - } - - retval = _wmkdir (wfilename); - save_errno = errno; - - g_free (wfilename); - - errno = save_errno; - return retval; - } else { - gchar *cp_filename = g_locale_from_utf8 (filename, -1, NULL, NULL, NULL); - int retval; - int save_errno; - - if (cp_filename == NULL) { - errno = EINVAL; - return -1; - } - - retval = mkdir (cp_filename); - save_errno = errno; - - g_free (cp_filename); - - errno = save_errno; - return retval; - } -#else - return mkdir (filename, mode); -#endif -} -#endif - -#if !GLIB_CHECK_VERSION (2, 6, 0) -/** - * g_stat: - * @filename: a pathname in the GLib file name encoding (UTF-8 on Windows) - * @buf: a pointer to a stat struct, which - * will be filled with the file information - * - * A wrapper for the POSIX stat() function. The stat() function - * returns information about a file. - * - * See the C library manual for more details about stat(). - * - * Returns: 0 if the information was successfully retrieved, -1 if an error - * occurred - * - * Since: 2.6 - */ -int -g_stat (const gchar * filename, struct stat *buf) -{ -#ifdef G_OS_WIN32 - if (G_WIN32_HAVE_WIDECHAR_API ()) { - wchar_t *wfilename = g_utf8_to_utf16 (filename, -1, NULL, NULL, NULL); - int retval; - int save_errno; - - if (wfilename == NULL) { - errno = EINVAL; - return -1; - } - - retval = _wstat (wfilename, (struct _stat *) buf); - save_errno = errno; - - g_free (wfilename); - - errno = save_errno; - return retval; - } else { - gchar *cp_filename = g_locale_from_utf8 (filename, -1, NULL, NULL, NULL); - int retval; - int save_errno; - - if (cp_filename == NULL) { - errno = EINVAL; - return -1; - } - - retval = stat (cp_filename, buf); - save_errno = errno; - - g_free (cp_filename); - - errno = save_errno; - return retval; - } -#else - return stat (filename, buf); -#endif -} -#endif - /* This version is copied from GLib 2.8. * In GLib 2.6, it didn't check for a flag value being NULL, hence it * hits an infinite loop in our flags serialize function diff --git a/gst/glib-compat.h b/gst/glib-compat.h index fa439ed719..2658ad74e0 100644 --- a/gst/glib-compat.h +++ b/gst/glib-compat.h @@ -7,26 +7,15 @@ #include "gst_private.h" /* for g_warning */ #include -#if GLIB_CHECK_VERSION (2, 6, 0) -#include -#endif G_BEGIN_DECLS +/* copies */ #if !GLIB_CHECK_VERSION (2, 8, 0) int g_mkdir_with_parents (const gchar *pathname, int mode); #endif -#if !GLIB_CHECK_VERSION (2, 6, 0) -int g_mkdir (const gchar *filename, int mode); -#endif - -#if !GLIB_CHECK_VERSION (2, 6, 0) -struct stat; - -int g_stat (const gchar *filename, struct stat *buf); -#endif - +/* adaptations */ #include GFlagsValue* gst_flags_get_first_value (GFlagsClass *flags_class, diff --git a/gst/gstregistryxml.c b/gst/gstregistryxml.c index c44a4f4bba..745e3f5719 100644 --- a/gst/gstregistryxml.c +++ b/gst/gstregistryxml.c @@ -47,6 +47,7 @@ #include #include "glib-compat.h" +#include #define BLOCK_SIZE 1024*10