mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-26 10:58:53 +02:00
glib/gutils.h Deprecate G_WIN32_DLLMAIN_FOR_DLL_NAME(),
2008-09-13 Tor Lillqvist <tml@novell.com> * glib/gutils.h * glib/gwin32.h: Deprecate G_WIN32_DLLMAIN_FOR_DLL_NAME(), g_win32_get_package_installation_directory() and g_win32_get_package_installation_subdirectory() as their documentation has warned for a while. Sorry that I forgot to do this before 2.18.0. * glib/gwin32.c (g_win32_get_package_installation_directory): Print a warning if a non-NULL package parameter is passed to this function, as that is deprecated usage, as the documentation says. svn path=/trunk/; revision=7480
This commit is contained in:
committed by
Tor Lillqvist
parent
005ce779e3
commit
e55fca9533
@@ -321,10 +321,11 @@ get_package_directory_from_module (const gchar *module_name)
|
||||
*
|
||||
* Try to determine the installation directory for a software package.
|
||||
*
|
||||
* This function will be deprecated in the future. Use
|
||||
* This function is deprecated. Use
|
||||
* g_win32_get_package_installation_directory_of_module() instead.
|
||||
*
|
||||
* The use of @package is deprecated. You should always pass %NULL.
|
||||
* The use of @package is deprecated. You should always pass %NULL. A
|
||||
* warning is printed if non-NULL is passed as @package.
|
||||
*
|
||||
* The original intended use of @package was for a short identifier of
|
||||
* the package, typically the same identifier as used for
|
||||
@@ -343,7 +344,7 @@ get_package_directory_from_module (const gchar *module_name)
|
||||
*
|
||||
* For this reason it is recommeded to always pass %NULL as
|
||||
* @package to this function, to avoid the temptation to use the
|
||||
* Registry. In version 2.18 of GLib the @package parameter
|
||||
* Registry. In version 2.20 of GLib the @package parameter
|
||||
* will be ignored and this function won't look in the Registry at all.
|
||||
*
|
||||
* If @package is %NULL, or the above value isn't found in the
|
||||
@@ -364,11 +365,14 @@ get_package_directory_from_module (const gchar *module_name)
|
||||
* @package. The string is in the GLib file name encoding,
|
||||
* i.e. UTF-8. The return value should be freed with g_free() when not
|
||||
* needed any longer. If the function fails %NULL is returned.
|
||||
*
|
||||
* @Deprecated:2.18: Pass the HMODULE of a DLL or EXE to
|
||||
* g_win32_get_package_installation_directory_of_module() instead.
|
||||
**/
|
||||
|
||||
gchar *
|
||||
g_win32_get_package_installation_directory (const gchar *package,
|
||||
const gchar *dll_name)
|
||||
gchar *
|
||||
g_win32_get_package_installation_directory_utf8 (const gchar *package,
|
||||
const gchar *dll_name)
|
||||
{
|
||||
static GHashTable *package_dirs = NULL;
|
||||
G_LOCK_DEFINE_STATIC (package_dirs);
|
||||
@@ -379,8 +383,14 @@ g_win32_get_package_installation_directory (const gchar *package,
|
||||
DWORD type;
|
||||
DWORD nbytes;
|
||||
|
||||
#if GLIB_CHECK_VERSION (2, 19, 0)
|
||||
if (package != NULL)
|
||||
g_warning ("Passing a non-NULL package to g_win32_get_package_installation_directory() is deprecated and it is ignored.");
|
||||
#else
|
||||
if (package != NULL)
|
||||
{
|
||||
g_warning ("Passing a non-NULL package to g_win32_get_package_installation_directory() is deprecated and will not work in GLib after 2.18.");
|
||||
|
||||
G_LOCK (package_dirs);
|
||||
|
||||
if (package_dirs == NULL)
|
||||
@@ -432,7 +442,7 @@ g_win32_get_package_installation_directory (const gchar *package,
|
||||
}
|
||||
G_UNLOCK (package_dirs);
|
||||
}
|
||||
|
||||
#endif
|
||||
if (dll_name != NULL)
|
||||
result = get_package_directory_from_module (dll_name);
|
||||
|
||||
@@ -444,8 +454,6 @@ g_win32_get_package_installation_directory (const gchar *package,
|
||||
|
||||
#if !defined (_WIN64)
|
||||
|
||||
#undef g_win32_get_package_installation_directory
|
||||
|
||||
/* DLL ABI binary compatibility version that uses system codepage file names */
|
||||
|
||||
gchar *
|
||||
@@ -482,8 +490,9 @@ g_win32_get_package_installation_directory (const gchar *package,
|
||||
* @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
|
||||
*
|
||||
* This function will be deprecated in the future. Use
|
||||
* g_win32_get_package_installation_directory_of_module() instead.
|
||||
* This function is deprecated. Use
|
||||
* g_win32_get_package_installation_directory_of_module() and
|
||||
* g_build_filename() instead.
|
||||
*
|
||||
* Returns a newly-allocated string containing the path of the
|
||||
* subdirectory @subdir in the return value from calling
|
||||
@@ -498,12 +507,16 @@ g_win32_get_package_installation_directory (const gchar *package,
|
||||
* the GLib file name encoding, i.e. UTF-8. The return value should be
|
||||
* freed with g_free() when no longer needed. If something goes wrong,
|
||||
* %NULL is returned.
|
||||
*
|
||||
* @Deprecated:2.18: Pass the HMODULE of a DLL or EXE to
|
||||
* g_win32_get_package_installation_directory_of_module() instead, and
|
||||
* then construct a subdirectory pathname with g_build_filename().
|
||||
**/
|
||||
|
||||
gchar *
|
||||
g_win32_get_package_installation_subdirectory (const gchar *package,
|
||||
const gchar *dll_name,
|
||||
const gchar *subdir)
|
||||
g_win32_get_package_installation_subdirectory_utf8 (const gchar *package,
|
||||
const gchar *dll_name,
|
||||
const gchar *subdir)
|
||||
{
|
||||
gchar *prefix;
|
||||
gchar *dirname;
|
||||
@@ -518,8 +531,6 @@ g_win32_get_package_installation_subdirectory (const gchar *package,
|
||||
|
||||
#if !defined (_WIN64)
|
||||
|
||||
#undef g_win32_get_package_installation_subdirectory
|
||||
|
||||
/* DLL ABI binary compatibility version that uses system codepage file names */
|
||||
|
||||
gchar *
|
||||
|
Reference in New Issue
Block a user