[Rawstudio-commit] r2032 - trunk/src
Anders Brander
anders at brander.dk
Mon Sep 29 01:13:05 CEST 2008
Author: abrander
Date: 2008-09-29 01:13:05 +0200 (Mon, 29 Sep 2008)
New Revision: 2032
Modified:
trunk/src/rawstudio.c
trunk/src/rawstudio.h
Log:
Removed local g_mkdir_with_parents() and g_access().
Modified: trunk/src/rawstudio.c
===================================================================
--- trunk/src/rawstudio.c 2008-09-28 23:09:45 UTC (rev 2031)
+++ trunk/src/rawstudio.c 2008-09-28 23:13:05 UTC (rev 2032)
@@ -1064,108 +1064,3 @@
/* This is so fucking evil, but Rawstudio will deadlock in some GTK atexit() function from time to time :-/ */
_exit(0);
}
-
-#if !GLIB_CHECK_VERSION(2,8,0)
-
-/* Include our own g_mkdir_with_parents() in case of old glib.
-Copied almost verbatim from glib-2.10.0/glib/gfileutils.c */
-int
-g_mkdir_with_parents (const gchar *pathname,
- int mode)
-{
- gchar *fn, *p;
-
- if (pathname == NULL || *pathname == '\0')
- {
- return -1;
- }
-
- fn = g_strdup (pathname);
-
- if (g_path_is_absolute (fn))
- p = (gchar *) g_path_skip_root (fn);
- else
- p = fn;
-
- do
- {
- while (*p && !G_IS_DIR_SEPARATOR (*p))
- p++;
-
- if (!*p)
- p = NULL;
- else
- *p = '\0';
-
- if (!g_file_test (fn, G_FILE_TEST_EXISTS))
- {
- if (g_mkdir (fn, mode) == -1)
- {
- g_free (fn);
- return -1;
- }
- }
- else if (!g_file_test (fn, G_FILE_TEST_IS_DIR))
- {
- g_free (fn);
- return -1;
- }
- if (p)
- {
- *p++ = G_DIR_SEPARATOR;
- while (*p && G_IS_DIR_SEPARATOR (*p))
- p++;
- }
- }
- while (p);
-
- g_free (fn);
-
- return 0;
-}
-
-/* Include our own g_access() in case of old glib.
-Copied almost verbatim from glib-2.12.13/glib/gstdio.h */
-int
-g_access (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;
-
- if (wfilename == NULL)
- {
- return -1;
- }
-
- retval = _waccess (wfilename, mode);
-
- g_free (wfilename);
-
- return retval;
- }
- else
- {
- gchar *cp_filename = g_locale_from_utf8 (filename, -1, NULL, NULL, NULL);
- int retval;
-
- if (cp_filename == NULL)
- {
- return -1;
- }
-
- retval = access (cp_filename, mode);
-
- g_free (cp_filename);
-
- return retval;
- }
-#else
- return access (filename, mode);
-#endif
-}
-
-#endif
Modified: trunk/src/rawstudio.h
===================================================================
--- trunk/src/rawstudio.h 2008-09-28 23:09:45 UTC (rev 2031)
+++ trunk/src/rawstudio.h 2008-09-28 23:13:05 UTC (rev 2032)
@@ -291,10 +291,6 @@
void rs_rect_mirror(RS_RECT *in, RS_RECT *out, gint w, gint h);
void rs_rect_rotate(RS_RECT *in, RS_RECT *out, gint w, gint h, gint quarterturns);
extern inline void rs_rect_from_gdkrectangle(GdkRectangle *in, RS_RECT *out);
-#if !GLIB_CHECK_VERSION(2,8,0)
-int g_mkdir_with_parents (const gchar *pathname, int mode);
-int g_access (const gchar *filename, int mode);
-#endif
/* Contains a list of supported filetypes */
extern RS_FILETYPE *filetypes;
More information about the Rawstudio-commit
mailing list