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
This commit is contained in:
Thomas Vander Stichele 2005-11-16 12:25:22 +00:00
parent c7d92fc08e
commit 403099819f
4 changed files with 10 additions and 136 deletions

View file

@ -1,3 +1,10 @@
2005-11-16 Thomas Vander Stichele <thomas at apestaart dot org>
* 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 <msmith@fluendo.com>
* gst/Makefile.am:

View file

@ -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 <structname>stat</structname> 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

View file

@ -7,26 +7,15 @@
#include "gst_private.h" /* for g_warning */
#include <glib.h>
#if GLIB_CHECK_VERSION (2, 6, 0)
#include <glib/gstdio.h>
#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 <glib-object.h>
GFlagsValue*
gst_flags_get_first_value (GFlagsClass *flags_class,

View file

@ -47,6 +47,7 @@
#include <libxml/xmlreader.h>
#include "glib-compat.h"
#include <glib/gstdio.h>
#define BLOCK_SIZE 1024*10