From f8cd1aea9e6f07bac2827da6cb15fdca8c9471e6 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Sun, 5 Dec 2004 09:11:42 +0000 Subject: [PATCH] glib/glib.symbols Implement DLL ABI stability also for 2004-12-05 Tor Lillqvist * glib/glib.symbols * glib/gwin32.[hc]: Implement DLL ABI stability also for g_win32_get_package_installation_directory()) and g_win32_get_package_installation_subdirectory(). --- ChangeLog | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ ChangeLog.pre-2-12 | 5 +++++ ChangeLog.pre-2-6 | 5 +++++ ChangeLog.pre-2-8 | 5 +++++ glib/glib.symbols | 6 +++-- glib/gwin32.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++------ glib/gwin32.h | 3 +++ 8 files changed, 89 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4b765c5..9a9fb12 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2004-12-05 Tor Lillqvist + * glib/glib.symbols + * glib/gwin32.[hc]: Implement DLL ABI stability also for + g_win32_get_package_installation_directory()) and + g_win32_get_package_installation_subdirectory(). + * glib/Makefile.am (install-libtool-import-lib): Remove the DLL binary compatibilty entries from the import library. They aren't used by newly compiled code, so no need to have them in the import diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 4b765c5..9a9fb12 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,10 @@ 2004-12-05 Tor Lillqvist + * glib/glib.symbols + * glib/gwin32.[hc]: Implement DLL ABI stability also for + g_win32_get_package_installation_directory()) and + g_win32_get_package_installation_subdirectory(). + * glib/Makefile.am (install-libtool-import-lib): Remove the DLL binary compatibilty entries from the import library. They aren't used by newly compiled code, so no need to have them in the import diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 4b765c5..9a9fb12 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,5 +1,10 @@ 2004-12-05 Tor Lillqvist + * glib/glib.symbols + * glib/gwin32.[hc]: Implement DLL ABI stability also for + g_win32_get_package_installation_directory()) and + g_win32_get_package_installation_subdirectory(). + * glib/Makefile.am (install-libtool-import-lib): Remove the DLL binary compatibilty entries from the import library. They aren't used by newly compiled code, so no need to have them in the import diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 4b765c5..9a9fb12 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,5 +1,10 @@ 2004-12-05 Tor Lillqvist + * glib/glib.symbols + * glib/gwin32.[hc]: Implement DLL ABI stability also for + g_win32_get_package_installation_directory()) and + g_win32_get_package_installation_subdirectory(). + * glib/Makefile.am (install-libtool-import-lib): Remove the DLL binary compatibilty entries from the import library. They aren't used by newly compiled code, so no need to have them in the import diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 4b765c5..9a9fb12 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,5 +1,10 @@ 2004-12-05 Tor Lillqvist + * glib/glib.symbols + * glib/gwin32.[hc]: Implement DLL ABI stability also for + g_win32_get_package_installation_directory()) and + g_win32_get_package_installation_subdirectory(). + * glib/Makefile.am (install-libtool-import-lib): Remove the DLL binary compatibilty entries from the import library. They aren't used by newly compiled code, so no need to have them in the import diff --git a/glib/glib.symbols b/glib/glib.symbols index 67c6b83..4631b77 100644 --- a/glib/glib.symbols +++ b/glib/glib.symbols @@ -909,8 +909,10 @@ g_vsprintf #ifdef G_OS_WIN32 g_win32_error_message g_win32_ftruncate -g_win32_get_package_installation_directory -g_win32_get_package_installation_subdirectory +g_win32_get_package_installation_directory PRIVATE +g_win32_get_package_installation_directory_utf8 +g_win32_get_package_installation_subdirectory PRIVATE +g_win32_get_package_installation_subdirectory_utf8 g_win32_get_windows_version g_win32_getlocale #endif diff --git a/glib/gwin32.c b/glib/gwin32.c index 96545ae..fddf549 100644 --- a/glib/gwin32.c +++ b/glib/gwin32.c @@ -1198,7 +1198,7 @@ get_package_directory_from_module (gchar *module_name) /** * g_win32_get_package_installation_directory: * @package: An identifier for a software package, or %NULL, in UTF-8 - * @dll_name: The name of a DLL that a package provides, or %NULL, in the GLib file name encoding, which is UTF-8 on Windows. + * @dll_name: The name of a DLL that a package provides, or %NULL, in UTF-8 * * Try to determine the installation directory for a software package. * Typically used by GNU software packages. @@ -1331,11 +1331,41 @@ g_win32_get_package_installation_directory (gchar *package, return result; } +#undef g_win32_get_package_installation_directory + +/* DLL ABI binary compatibility version that uses system codepage file names */ + +gchar * +g_win32_get_package_installation_directory (gchar *package, + gchar *dll_name) +{ + gchar *utf8_package = NULL, *utf8_dll_name = NULL; + gchar *utf8_retval, *retval; + + if (package != NULL) + utf8_package = g_locale_to_utf8 (package, -1, NULL, NULL, NULL); + + if (dll_name != NULL) + utf8_dll_name = g_locale_to_utf8 (dll_name, -1, NULL, NULL, NULL); + + utf8_retval = + g_win32_get_package_installation_directory_utf8 (utf8_package, + utf8_dll_name); + + retval = g_locale_from_utf8 (utf8_retval, -1, NULL, NULL, NULL); + + g_free (utf8_package); + g_free (utf8_dll_name); + g_free (utf8_retval); + + return retval; +} + /** * g_win32_get_package_installation_subdirectory: - * @package: An identifier for a software package, or %NULL. - * @dll_name: The name of a DLL that a package provides, or %NULL. - * @subdir: A subdirectory of the package installation directory. + * @package: An identifier for a software package, in UTF-8, or %NULL + * @dll_name: The name of a DLL that a package provides, in UTF-8, or %NULL + * @subdir: A subdirectory of the package installation directory, also in UTF-8 * * Returns a newly-allocated string containing the path of the * subdirectory @subdir in the return value from calling @@ -1343,9 +1373,9 @@ g_win32_get_package_installation_directory (gchar *package, * @dll_name parameters. * * Returns: a string containing the complete path to @subdir inside - * the installation directory of @package. The string is in the GLib - * file name encoding, i.e. UTF-8 on Windows. The return value should - * be freed with g_free() when no longer needed. + * the installation directory of @package. The returned string is in + * the GLib file name encoding, i.e. UTF-8 on Windows. The return + * value should be freed with g_free() when no longer needed. **/ gchar * @@ -1356,6 +1386,26 @@ g_win32_get_package_installation_subdirectory (gchar *package, gchar *prefix; gchar *dirname; + prefix = g_win32_get_package_installation_directory_utf8 (package, dll_name); + + dirname = g_build_filename (prefix, subdir, NULL); + g_free (prefix); + + return dirname; +} + +#undef g_win32_get_package_installation_subdirectory + +/* DLL ABI binary compatibility version that uses system codepage file names */ + +gchar * +g_win32_get_package_installation_subdirectory (gchar *package, + gchar *dll_name, + gchar *subdir) +{ + gchar *prefix; + gchar *dirname; + prefix = g_win32_get_package_installation_directory (package, dll_name); dirname = g_build_filename (prefix, subdir, NULL); diff --git a/glib/gwin32.h b/glib/gwin32.h index cbe0cb9..87f3240 100644 --- a/glib/gwin32.h +++ b/glib/gwin32.h @@ -86,6 +86,9 @@ gchar* g_win32_getlocale (void); */ gchar* g_win32_error_message (gint error); +#define g_win32_get_package_installation_directory g_win32_get_package_installation_directory_utf8 +#define g_win32_get_package_installation_subdirectory g_win32_get_package_installation_subdirectory_utf8 + gchar* g_win32_get_package_installation_directory (gchar *package, gchar *dll_name); -- 2.7.4