2007-11-26 17:13:05 +01:00
|
|
|
/* GIO - GLib Input, Output and Streaming Library
|
|
|
|
*
|
|
|
|
* Copyright (C) 2006-2007 Red Hat, Inc.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General
|
|
|
|
* Public License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
* Author: Alexander Larsson <alexl@redhat.com>
|
|
|
|
*/
|
|
|
|
|
2008-06-22 17:10:51 +02:00
|
|
|
#include "config.h"
|
2007-11-26 17:13:05 +01:00
|
|
|
|
2008-01-28 20:43:10 +01:00
|
|
|
#include <string.h>
|
|
|
|
|
2007-11-26 17:13:05 +01:00
|
|
|
#include "giomodule.h"
|
2007-12-05 12:05:49 +01:00
|
|
|
#include "giomodule-priv.h"
|
2007-12-19 17:08:55 +01:00
|
|
|
#include "glocalfilemonitor.h"
|
|
|
|
#include "glocaldirectorymonitor.h"
|
|
|
|
#include "gnativevolumemonitor.h"
|
2010-05-07 21:55:54 +02:00
|
|
|
#include "gproxyresolver.h"
|
2010-08-10 21:24:37 +02:00
|
|
|
#include "gproxy.h"
|
2010-12-05 15:34:26 +01:00
|
|
|
#include "gsettingsbackendinternal.h"
|
2010-05-25 22:02:42 +02:00
|
|
|
#include "gsocks4proxy.h"
|
|
|
|
#include "gsocks4aproxy.h"
|
2010-04-29 21:22:55 +02:00
|
|
|
#include "gsocks5proxy.h"
|
2009-12-21 20:50:32 +01:00
|
|
|
#include "gtlsbackend.h"
|
2007-12-19 17:08:55 +01:00
|
|
|
#include "gvfs.h"
|
2010-08-12 17:10:23 +02:00
|
|
|
#ifdef G_OS_WIN32
|
|
|
|
#include "gregistrysettingsbackend.h"
|
|
|
|
#endif
|
2010-01-12 11:36:12 +01:00
|
|
|
#include <glib/gstdio.h>
|
2007-11-28 13:39:07 +01:00
|
|
|
|
2010-11-09 13:19:19 +01:00
|
|
|
#undef G_DISABLE_DEPRECATED
|
|
|
|
|
|
|
|
#ifdef G_OS_UNIX
|
|
|
|
#include "gdesktopappinfo.h"
|
|
|
|
#endif
|
|
|
|
|
2007-11-27 15:00:13 +01:00
|
|
|
/**
|
|
|
|
* SECTION:giomodule
|
|
|
|
* @short_description: Loadable GIO Modules
|
2008-02-21 19:20:17 +01:00
|
|
|
* @include: gio/gio.h
|
2007-11-27 15:00:13 +01:00
|
|
|
*
|
|
|
|
* Provides an interface and default functions for loading and unloading
|
2008-02-11 08:12:56 +01:00
|
|
|
* modules. This is used internally to make GIO extensible, but can also
|
|
|
|
* be used by others to implement module loading.
|
2007-11-27 15:00:13 +01:00
|
|
|
*
|
|
|
|
**/
|
|
|
|
|
2008-02-11 08:12:56 +01:00
|
|
|
/**
|
|
|
|
* SECTION:extensionpoints
|
|
|
|
* @short_description: Extension Points
|
|
|
|
* @include: gio.h
|
2008-07-16 08:30:12 +02:00
|
|
|
* @see_also: <link linkend="extending-gio">Extending GIO</link>
|
2008-02-11 08:12:56 +01:00
|
|
|
*
|
|
|
|
* #GIOExtensionPoint provides a mechanism for modules to extend the
|
|
|
|
* functionality of the library or application that loaded it in an
|
|
|
|
* organized fashion.
|
|
|
|
*
|
|
|
|
* An extension point is identified by a name, and it may optionally
|
|
|
|
* require that any implementation must by of a certain type (or derived
|
|
|
|
* thereof). Use g_io_extension_point_register() to register an
|
|
|
|
* extension point, and g_io_extension_point_set_required_type() to
|
|
|
|
* set a required type.
|
|
|
|
*
|
|
|
|
* A module can implement an extension point by specifying the #GType
|
|
|
|
* that implements the functionality. Additionally, each implementation
|
|
|
|
* of an extension point has a name, and a priority. Use
|
|
|
|
* g_io_extension_point_implement() to implement an extension point.
|
|
|
|
*
|
|
|
|
* |[
|
|
|
|
* GIOExtensionPoint *ep;
|
|
|
|
*
|
|
|
|
* /* Register an extension point */
|
|
|
|
* ep = g_io_extension_point_register ("my-extension-point");
|
|
|
|
* g_io_extension_point_set_required_type (ep, MY_TYPE_EXAMPLE);
|
|
|
|
* ]|
|
|
|
|
*
|
|
|
|
* |[
|
|
|
|
* /* Implement an extension point */
|
|
|
|
* G_DEFINE_TYPE (MyExampleImpl, my_example_impl, MY_TYPE_EXAMPLE);
|
|
|
|
* g_io_extension_point_implement ("my-extension-point",
|
|
|
|
* my_example_impl_get_type (),
|
|
|
|
* "my-example",
|
|
|
|
* 10);
|
|
|
|
* ]|
|
|
|
|
*
|
|
|
|
* It is up to the code that registered the extension point how
|
|
|
|
* it uses the implementations that have been associated with it.
|
|
|
|
* Depending on the use case, it may use all implementations, or
|
|
|
|
* only the one with the highest priority, or pick a specific
|
2010-04-18 21:55:14 +02:00
|
|
|
* one by name.
|
|
|
|
*
|
|
|
|
* To avoid opening all modules just to find out what extension
|
|
|
|
* points they implement, GIO makes use of a caching mechanism,
|
|
|
|
* see <link linkend="gio-querymodules">gio-querymodules</link>.
|
|
|
|
* You are expected to run this command after installing a
|
|
|
|
* GIO module.
|
2008-02-11 08:12:56 +01:00
|
|
|
*/
|
2007-11-26 17:13:05 +01:00
|
|
|
struct _GIOModule {
|
|
|
|
GTypeModule parent_instance;
|
2010-01-12 11:36:12 +01:00
|
|
|
|
2007-11-26 17:13:05 +01:00
|
|
|
gchar *filename;
|
|
|
|
GModule *library;
|
2010-01-12 11:36:12 +01:00
|
|
|
gboolean initialized; /* The module was loaded at least once */
|
|
|
|
|
2007-11-26 17:13:05 +01:00
|
|
|
void (* load) (GIOModule *module);
|
|
|
|
void (* unload) (GIOModule *module);
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _GIOModuleClass
|
|
|
|
{
|
|
|
|
GTypeModuleClass parent_class;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
static void g_io_module_finalize (GObject *object);
|
|
|
|
static gboolean g_io_module_load_module (GTypeModule *gmodule);
|
|
|
|
static void g_io_module_unload_module (GTypeModule *gmodule);
|
|
|
|
|
2010-01-12 11:36:12 +01:00
|
|
|
struct _GIOExtension {
|
|
|
|
char *name;
|
|
|
|
GType type;
|
|
|
|
gint priority;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _GIOExtensionPoint {
|
|
|
|
GType required_type;
|
|
|
|
char *name;
|
|
|
|
GList *extensions;
|
|
|
|
GList *lazy_load_modules;
|
|
|
|
};
|
|
|
|
|
|
|
|
static GHashTable *extension_points = NULL;
|
|
|
|
G_LOCK_DEFINE_STATIC(extension_points);
|
|
|
|
|
2007-11-26 17:13:05 +01:00
|
|
|
G_DEFINE_TYPE (GIOModule, g_io_module, G_TYPE_TYPE_MODULE);
|
|
|
|
|
|
|
|
static void
|
|
|
|
g_io_module_class_init (GIOModuleClass *class)
|
|
|
|
{
|
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (class);
|
|
|
|
GTypeModuleClass *type_module_class = G_TYPE_MODULE_CLASS (class);
|
|
|
|
|
|
|
|
object_class->finalize = g_io_module_finalize;
|
|
|
|
|
|
|
|
type_module_class->load = g_io_module_load_module;
|
|
|
|
type_module_class->unload = g_io_module_unload_module;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
g_io_module_init (GIOModule *module)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
g_io_module_finalize (GObject *object)
|
|
|
|
{
|
|
|
|
GIOModule *module = G_IO_MODULE (object);
|
|
|
|
|
|
|
|
g_free (module->filename);
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (g_io_module_parent_class)->finalize (object);
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
g_io_module_load_module (GTypeModule *gmodule)
|
|
|
|
{
|
|
|
|
GIOModule *module = G_IO_MODULE (gmodule);
|
|
|
|
|
|
|
|
if (!module->filename)
|
|
|
|
{
|
|
|
|
g_warning ("GIOModule path not set");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
module->library = g_module_open (module->filename, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
|
|
|
|
|
|
|
|
if (!module->library)
|
|
|
|
{
|
|
|
|
g_printerr ("%s\n", g_module_error ());
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Make sure that the loaded library contains the required methods */
|
|
|
|
if (! g_module_symbol (module->library,
|
|
|
|
"g_io_module_load",
|
2007-12-19 14:18:34 +01:00
|
|
|
(gpointer) &module->load) ||
|
2007-11-26 17:13:05 +01:00
|
|
|
! g_module_symbol (module->library,
|
|
|
|
"g_io_module_unload",
|
2007-12-19 14:18:34 +01:00
|
|
|
(gpointer) &module->unload))
|
2007-11-26 17:13:05 +01:00
|
|
|
{
|
|
|
|
g_printerr ("%s\n", g_module_error ());
|
|
|
|
g_module_close (module->library);
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Initialize the loaded module */
|
|
|
|
module->load (module);
|
2010-01-12 11:36:12 +01:00
|
|
|
module->initialized = TRUE;
|
2007-11-26 17:13:05 +01:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
g_io_module_unload_module (GTypeModule *gmodule)
|
|
|
|
{
|
|
|
|
GIOModule *module = G_IO_MODULE (gmodule);
|
|
|
|
|
|
|
|
module->unload (module);
|
|
|
|
|
|
|
|
g_module_close (module->library);
|
|
|
|
module->library = NULL;
|
|
|
|
|
|
|
|
module->load = NULL;
|
|
|
|
module->unload = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* g_io_module_new:
|
2007-12-05 12:05:49 +01:00
|
|
|
* @filename: filename of the shared library module.
|
2007-11-26 17:13:05 +01:00
|
|
|
*
|
2007-12-05 12:05:49 +01:00
|
|
|
* Creates a new GIOModule that will load the specific
|
|
|
|
* shared library when in use.
|
2007-11-27 15:00:13 +01:00
|
|
|
*
|
|
|
|
* Returns: a #GIOModule from given @filename,
|
2007-11-26 17:13:05 +01:00
|
|
|
* or %NULL on error.
|
|
|
|
**/
|
|
|
|
GIOModule *
|
|
|
|
g_io_module_new (const gchar *filename)
|
|
|
|
{
|
|
|
|
GIOModule *module;
|
|
|
|
|
|
|
|
g_return_val_if_fail (filename != NULL, NULL);
|
|
|
|
|
|
|
|
module = g_object_new (G_IO_TYPE_MODULE, NULL);
|
|
|
|
module->filename = g_strdup (filename);
|
|
|
|
|
|
|
|
return module;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
is_valid_module_name (const gchar *basename)
|
|
|
|
{
|
|
|
|
#if !defined(G_OS_WIN32) && !defined(G_WITH_CYGWIN)
|
|
|
|
return
|
|
|
|
g_str_has_prefix (basename, "lib") &&
|
|
|
|
g_str_has_suffix (basename, ".so");
|
|
|
|
#else
|
|
|
|
return g_str_has_suffix (basename, ".dll");
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2010-01-12 11:36:12 +01:00
|
|
|
/**
|
|
|
|
* g_io_modules_scan_all_in_directory:
|
|
|
|
* @dirname: pathname for a directory containing modules to scan.
|
|
|
|
*
|
|
|
|
* Scans all the modules in the specified directory, ensuring that
|
|
|
|
* any extension point implemented by a module is registered.
|
|
|
|
*
|
|
|
|
* This may not actually load and initialize all the types in each
|
|
|
|
* module, some modules may be lazily loaded and initialized when
|
|
|
|
* an extension point it implementes is used with e.g.
|
|
|
|
* g_io_extension_point_get_extensions() or
|
|
|
|
* g_io_extension_point_get_extension_by_name().
|
|
|
|
*
|
|
|
|
* If you need to guarantee that all types are loaded in all the modules,
|
2010-11-29 15:36:07 +01:00
|
|
|
* use g_io_modules_load_all_in_directory().
|
2010-01-12 11:36:12 +01:00
|
|
|
*
|
|
|
|
* Since: 2.24
|
|
|
|
**/
|
|
|
|
void
|
|
|
|
g_io_modules_scan_all_in_directory (const char *dirname)
|
|
|
|
{
|
|
|
|
const gchar *name;
|
|
|
|
char *filename;
|
|
|
|
GDir *dir;
|
2010-03-21 19:04:18 +01:00
|
|
|
GStatBuf statbuf;
|
2010-01-12 11:36:12 +01:00
|
|
|
char *data;
|
|
|
|
time_t cache_mtime;
|
|
|
|
GHashTable *cache;
|
|
|
|
|
|
|
|
if (!g_module_supported ())
|
|
|
|
return;
|
|
|
|
|
|
|
|
dir = g_dir_open (dirname, 0, NULL);
|
|
|
|
if (!dir)
|
|
|
|
return;
|
|
|
|
|
|
|
|
filename = g_build_filename (dirname, "giomodule.cache", NULL);
|
|
|
|
|
|
|
|
cache = g_hash_table_new_full (g_str_hash, g_str_equal,
|
|
|
|
g_free, (GDestroyNotify)g_strfreev);
|
|
|
|
|
|
|
|
cache_mtime = 0;
|
|
|
|
if (g_stat (filename, &statbuf) == 0 &&
|
|
|
|
g_file_get_contents (filename, &data, NULL, NULL))
|
|
|
|
{
|
|
|
|
char **lines;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
/* Cache mtime is the time the cache file was created, any file
|
|
|
|
* that has a ctime before this was created then and not modified
|
|
|
|
* since then (userspace can't change ctime). Its possible to change
|
|
|
|
* the ctime forward without changing the file content, by e.g.
|
|
|
|
* chmoding the file, but this is uncommon and will only cause us
|
|
|
|
* to not use the cache so will not cause bugs.
|
|
|
|
*/
|
|
|
|
cache_mtime = statbuf.st_mtime;
|
|
|
|
|
|
|
|
lines = g_strsplit (data, "\n", -1);
|
|
|
|
g_free (data);
|
|
|
|
|
|
|
|
for (i = 0; lines[i] != NULL; i++)
|
|
|
|
{
|
|
|
|
char *line = lines[i];
|
|
|
|
char *file;
|
|
|
|
char *colon;
|
|
|
|
char **extension_points;
|
|
|
|
|
|
|
|
if (line[0] == '#')
|
|
|
|
continue;
|
|
|
|
|
|
|
|
colon = strchr (line, ':');
|
|
|
|
if (colon == NULL || line == colon)
|
|
|
|
continue; /* Invalid line, ignore */
|
|
|
|
|
|
|
|
*colon = 0; /* terminate filename */
|
2010-03-07 23:42:25 +01:00
|
|
|
file = g_strdup (line);
|
2010-01-12 11:36:12 +01:00
|
|
|
colon++; /* after colon */
|
|
|
|
|
|
|
|
while (g_ascii_isspace (*colon))
|
|
|
|
colon++;
|
|
|
|
|
|
|
|
extension_points = g_strsplit (colon, ",", -1);
|
2010-03-07 23:42:25 +01:00
|
|
|
g_hash_table_insert (cache, file, extension_points);
|
2010-01-12 11:36:12 +01:00
|
|
|
}
|
|
|
|
g_strfreev (lines);
|
|
|
|
}
|
|
|
|
|
|
|
|
while ((name = g_dir_read_name (dir)))
|
|
|
|
{
|
|
|
|
if (is_valid_module_name (name))
|
|
|
|
{
|
|
|
|
GIOExtensionPoint *extension_point;
|
|
|
|
GIOModule *module;
|
|
|
|
gchar *path;
|
|
|
|
char **extension_points;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
path = g_build_filename (dirname, name, NULL);
|
|
|
|
module = g_io_module_new (path);
|
|
|
|
|
|
|
|
extension_points = g_hash_table_lookup (cache, name);
|
|
|
|
if (extension_points != NULL &&
|
|
|
|
g_stat (path, &statbuf) == 0 &&
|
|
|
|
statbuf.st_ctime <= cache_mtime)
|
|
|
|
{
|
|
|
|
/* Lazy load/init the library when first required */
|
|
|
|
for (i = 0; extension_points[i] != NULL; i++)
|
|
|
|
{
|
|
|
|
extension_point =
|
|
|
|
g_io_extension_point_register (extension_points[i]);
|
|
|
|
extension_point->lazy_load_modules =
|
|
|
|
g_list_prepend (extension_point->lazy_load_modules,
|
|
|
|
module);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Try to load and init types */
|
|
|
|
if (g_type_module_use (G_TYPE_MODULE (module)))
|
|
|
|
g_type_module_unuse (G_TYPE_MODULE (module)); /* Unload */
|
|
|
|
else
|
|
|
|
{ /* Failure to load */
|
|
|
|
g_printerr ("Failed to load module: %s\n", path);
|
|
|
|
g_object_unref (module);
|
|
|
|
g_free (path);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
g_free (path);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
g_dir_close (dir);
|
|
|
|
|
|
|
|
g_hash_table_destroy (cache);
|
2010-02-05 02:14:20 +01:00
|
|
|
|
|
|
|
g_free (filename);
|
2010-01-12 11:36:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-12-05 12:05:49 +01:00
|
|
|
/**
|
|
|
|
* g_io_modules_load_all_in_directory:
|
|
|
|
* @dirname: pathname for a directory containing modules to load.
|
2008-02-25 15:04:38 +01:00
|
|
|
*
|
|
|
|
* Loads all the modules in the specified directory.
|
|
|
|
*
|
2010-01-12 11:36:12 +01:00
|
|
|
* If don't require all modules to be initialized (and thus registering
|
|
|
|
* all gtypes) then you can use g_io_modules_scan_all_in_directory()
|
|
|
|
* which allows delayed/lazy loading of modules.
|
|
|
|
*
|
2010-09-24 20:51:26 +02:00
|
|
|
* Returns: (element-type GIOModule) (transfer full): a list of #GIOModules loaded
|
|
|
|
* from the directory,
|
2007-12-19 17:08:55 +01:00
|
|
|
* All the modules are loaded into memory, if you want to
|
|
|
|
* unload them (enabling on-demand loading) you must call
|
|
|
|
* g_type_module_unuse() on all the modules. Free the list
|
|
|
|
* with g_list_free().
|
2007-12-05 12:05:49 +01:00
|
|
|
**/
|
|
|
|
GList *
|
|
|
|
g_io_modules_load_all_in_directory (const char *dirname)
|
2007-11-26 17:13:05 +01:00
|
|
|
{
|
|
|
|
const gchar *name;
|
|
|
|
GDir *dir;
|
|
|
|
GList *modules;
|
|
|
|
|
|
|
|
if (!g_module_supported ())
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
dir = g_dir_open (dirname, 0, NULL);
|
|
|
|
if (!dir)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
modules = NULL;
|
|
|
|
while ((name = g_dir_read_name (dir)))
|
|
|
|
{
|
|
|
|
if (is_valid_module_name (name))
|
|
|
|
{
|
|
|
|
GIOModule *module;
|
|
|
|
gchar *path;
|
|
|
|
|
|
|
|
path = g_build_filename (dirname, name, NULL);
|
|
|
|
module = g_io_module_new (path);
|
|
|
|
|
|
|
|
if (!g_type_module_use (G_TYPE_MODULE (module)))
|
|
|
|
{
|
|
|
|
g_printerr ("Failed to load module: %s\n", path);
|
|
|
|
g_object_unref (module);
|
|
|
|
g_free (path);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_free (path);
|
|
|
|
|
|
|
|
modules = g_list_prepend (modules, module);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
g_dir_close (dir);
|
|
|
|
|
|
|
|
return modules;
|
|
|
|
}
|
|
|
|
|
2009-03-02 04:50:09 +01:00
|
|
|
G_LOCK_DEFINE_STATIC (registered_extensions);
|
2007-11-26 17:13:05 +01:00
|
|
|
G_LOCK_DEFINE_STATIC (loaded_dirs);
|
|
|
|
|
2008-03-14 09:58:24 +01:00
|
|
|
extern GType _g_fen_directory_monitor_get_type (void);
|
|
|
|
extern GType _g_fen_file_monitor_get_type (void);
|
2007-12-19 17:08:55 +01:00
|
|
|
extern GType _g_inotify_directory_monitor_get_type (void);
|
|
|
|
extern GType _g_inotify_file_monitor_get_type (void);
|
|
|
|
extern GType _g_unix_volume_monitor_get_type (void);
|
|
|
|
extern GType _g_local_vfs_get_type (void);
|
|
|
|
|
2008-06-17 23:40:04 +02:00
|
|
|
extern GType _g_win32_volume_monitor_get_type (void);
|
2008-03-12 20:09:11 +01:00
|
|
|
extern GType g_win32_directory_monitor_get_type (void);
|
2008-08-13 01:09:04 +02:00
|
|
|
extern GType _g_winhttp_vfs_get_type (void);
|
2008-03-12 20:09:11 +01:00
|
|
|
|
2010-05-07 21:55:54 +02:00
|
|
|
extern GType _g_dummy_proxy_resolver_get_type (void);
|
2009-12-21 20:50:32 +01:00
|
|
|
extern GType _g_dummy_tls_backend_get_type (void);
|
2010-05-07 21:55:54 +02:00
|
|
|
|
2009-10-11 23:18:48 +02:00
|
|
|
#ifdef G_PLATFORM_WIN32
|
|
|
|
|
|
|
|
#include <windows.h>
|
|
|
|
|
|
|
|
static HMODULE gio_dll = NULL;
|
|
|
|
|
|
|
|
#ifdef DLL_EXPORT
|
|
|
|
|
|
|
|
BOOL WINAPI
|
|
|
|
DllMain (HINSTANCE hinstDLL,
|
|
|
|
DWORD fdwReason,
|
|
|
|
LPVOID lpvReserved)
|
|
|
|
{
|
|
|
|
if (fdwReason == DLL_PROCESS_ATTACH)
|
|
|
|
gio_dll = hinstDLL;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#undef GIO_MODULE_DIR
|
|
|
|
|
|
|
|
/* GIO_MODULE_DIR is used only in code called just once,
|
|
|
|
* so no problem leaking this
|
|
|
|
*/
|
|
|
|
#define GIO_MODULE_DIR \
|
|
|
|
g_build_filename (g_win32_get_package_installation_directory_of_module (gio_dll), \
|
|
|
|
"lib/gio/modules", \
|
|
|
|
NULL)
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2007-11-26 17:13:05 +01:00
|
|
|
void
|
2009-02-27 16:22:11 +01:00
|
|
|
_g_io_modules_ensure_extension_points_registered (void)
|
2007-11-26 17:13:05 +01:00
|
|
|
{
|
2009-02-27 16:22:11 +01:00
|
|
|
static gboolean registered_extensions = FALSE;
|
2008-01-28 20:43:10 +01:00
|
|
|
GIOExtensionPoint *ep;
|
2007-12-19 17:08:55 +01:00
|
|
|
|
2009-03-02 04:50:09 +01:00
|
|
|
G_LOCK (registered_extensions);
|
2009-02-27 16:22:11 +01:00
|
|
|
|
|
|
|
if (!registered_extensions)
|
2007-11-26 17:13:05 +01:00
|
|
|
{
|
2009-02-27 16:22:11 +01:00
|
|
|
registered_extensions = TRUE;
|
|
|
|
|
2010-11-09 13:19:19 +01:00
|
|
|
#ifdef G_OS_UNIX
|
|
|
|
#if !GLIB_CHECK_VERSION (3, 0, 0)
|
|
|
|
ep = g_io_extension_point_register (G_DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME);
|
|
|
|
g_io_extension_point_set_required_type (ep, G_TYPE_DESKTOP_APP_INFO_LOOKUP);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2008-01-28 20:43:10 +01:00
|
|
|
ep = g_io_extension_point_register (G_LOCAL_DIRECTORY_MONITOR_EXTENSION_POINT_NAME);
|
|
|
|
g_io_extension_point_set_required_type (ep, G_TYPE_LOCAL_DIRECTORY_MONITOR);
|
|
|
|
|
|
|
|
ep = g_io_extension_point_register (G_LOCAL_FILE_MONITOR_EXTENSION_POINT_NAME);
|
|
|
|
g_io_extension_point_set_required_type (ep, G_TYPE_LOCAL_FILE_MONITOR);
|
2009-02-27 16:22:11 +01:00
|
|
|
|
2008-01-28 20:43:10 +01:00
|
|
|
ep = g_io_extension_point_register (G_VOLUME_MONITOR_EXTENSION_POINT_NAME);
|
|
|
|
g_io_extension_point_set_required_type (ep, G_TYPE_VOLUME_MONITOR);
|
|
|
|
|
|
|
|
ep = g_io_extension_point_register (G_NATIVE_VOLUME_MONITOR_EXTENSION_POINT_NAME);
|
|
|
|
g_io_extension_point_set_required_type (ep, G_TYPE_NATIVE_VOLUME_MONITOR);
|
|
|
|
|
|
|
|
ep = g_io_extension_point_register (G_VFS_EXTENSION_POINT_NAME);
|
|
|
|
g_io_extension_point_set_required_type (ep, G_TYPE_VFS);
|
2009-08-28 05:40:16 +02:00
|
|
|
|
|
|
|
ep = g_io_extension_point_register ("gsettings-backend");
|
|
|
|
g_io_extension_point_set_required_type (ep, G_TYPE_OBJECT);
|
2010-05-07 21:55:54 +02:00
|
|
|
|
|
|
|
ep = g_io_extension_point_register (G_PROXY_RESOLVER_EXTENSION_POINT_NAME);
|
|
|
|
g_io_extension_point_set_required_type (ep, G_TYPE_PROXY_RESOLVER);
|
2010-08-10 21:24:37 +02:00
|
|
|
|
|
|
|
ep = g_io_extension_point_register (G_PROXY_EXTENSION_POINT_NAME);
|
|
|
|
g_io_extension_point_set_required_type (ep, G_TYPE_PROXY);
|
2009-12-21 20:50:32 +01:00
|
|
|
|
|
|
|
ep = g_io_extension_point_register (G_TLS_BACKEND_EXTENSION_POINT_NAME);
|
|
|
|
g_io_extension_point_set_required_type (ep, G_TYPE_TLS_BACKEND);
|
2009-02-27 16:22:11 +01:00
|
|
|
}
|
|
|
|
|
2009-03-02 04:50:09 +01:00
|
|
|
G_UNLOCK (registered_extensions);
|
2009-02-27 16:22:11 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_g_io_modules_ensure_loaded (void)
|
|
|
|
{
|
|
|
|
static gboolean loaded_dirs = FALSE;
|
|
|
|
const char *module_path;
|
|
|
|
|
|
|
|
_g_io_modules_ensure_extension_points_registered ();
|
|
|
|
|
|
|
|
G_LOCK (loaded_dirs);
|
|
|
|
|
|
|
|
if (!loaded_dirs)
|
|
|
|
{
|
|
|
|
loaded_dirs = TRUE;
|
|
|
|
|
2010-01-12 11:57:17 +01:00
|
|
|
g_io_modules_scan_all_in_directory (GIO_MODULE_DIR);
|
2007-12-19 17:08:55 +01:00
|
|
|
|
2008-03-28 15:31:09 +01:00
|
|
|
module_path = g_getenv ("GIO_EXTRA_MODULES");
|
|
|
|
|
|
|
|
if (module_path)
|
2010-01-12 11:57:17 +01:00
|
|
|
{
|
|
|
|
gchar **paths;
|
|
|
|
int i;
|
2008-03-28 15:31:09 +01:00
|
|
|
|
2010-01-12 11:57:17 +01:00
|
|
|
paths = g_strsplit (module_path, ":", 0);
|
|
|
|
|
|
|
|
for (i = 0; paths[i] != NULL; i++)
|
|
|
|
g_io_modules_scan_all_in_directory (paths[i]);
|
|
|
|
|
|
|
|
g_strfreev (paths);
|
|
|
|
}
|
2008-03-28 15:31:09 +01:00
|
|
|
|
2007-12-19 17:08:55 +01:00
|
|
|
/* Initialize types from built-in "modules" */
|
2010-12-05 15:34:26 +01:00
|
|
|
g_null_settings_backend_get_type ();
|
2010-04-17 07:02:57 +02:00
|
|
|
g_memory_settings_backend_get_type ();
|
2007-12-19 17:08:55 +01:00
|
|
|
#if defined(HAVE_SYS_INOTIFY_H) || defined(HAVE_LINUX_INOTIFY_H)
|
|
|
|
_g_inotify_directory_monitor_get_type ();
|
|
|
|
_g_inotify_file_monitor_get_type ();
|
2008-03-14 10:45:44 +01:00
|
|
|
#endif
|
|
|
|
#if defined(HAVE_FEN)
|
2008-03-14 09:58:24 +01:00
|
|
|
_g_fen_directory_monitor_get_type ();
|
|
|
|
_g_fen_file_monitor_get_type ();
|
2008-03-12 20:09:11 +01:00
|
|
|
#endif
|
2008-03-14 10:45:44 +01:00
|
|
|
#ifdef G_OS_WIN32
|
2008-06-17 23:40:04 +02:00
|
|
|
_g_win32_volume_monitor_get_type ();
|
2008-03-14 10:45:44 +01:00
|
|
|
g_win32_directory_monitor_get_type ();
|
2010-08-12 17:10:23 +02:00
|
|
|
g_registry_backend_get_type ();
|
2008-03-14 10:45:44 +01:00
|
|
|
#endif
|
2007-12-19 17:08:55 +01:00
|
|
|
#ifdef G_OS_UNIX
|
|
|
|
_g_unix_volume_monitor_get_type ();
|
2008-08-13 01:09:04 +02:00
|
|
|
#endif
|
|
|
|
#ifdef G_OS_WIN32
|
|
|
|
_g_winhttp_vfs_get_type ();
|
2007-12-19 17:08:55 +01:00
|
|
|
#endif
|
|
|
|
_g_local_vfs_get_type ();
|
2010-05-07 21:55:54 +02:00
|
|
|
_g_dummy_proxy_resolver_get_type ();
|
2010-05-25 22:02:42 +02:00
|
|
|
_g_socks4a_proxy_get_type ();
|
|
|
|
_g_socks4_proxy_get_type ();
|
2010-04-29 21:22:55 +02:00
|
|
|
_g_socks5_proxy_get_type ();
|
2009-12-21 20:50:32 +01:00
|
|
|
_g_dummy_tls_backend_get_type ();
|
2007-11-26 17:13:05 +01:00
|
|
|
}
|
2007-12-19 17:08:55 +01:00
|
|
|
|
2007-11-26 17:13:05 +01:00
|
|
|
G_UNLOCK (loaded_dirs);
|
|
|
|
}
|
2007-11-28 13:39:07 +01:00
|
|
|
|
2008-01-28 20:43:10 +01:00
|
|
|
static void
|
|
|
|
g_io_extension_point_free (GIOExtensionPoint *ep)
|
|
|
|
{
|
|
|
|
g_free (ep->name);
|
|
|
|
g_free (ep);
|
|
|
|
}
|
|
|
|
|
2008-02-11 08:12:56 +01:00
|
|
|
/**
|
|
|
|
* g_io_extension_point_register:
|
|
|
|
* @name: The name of the extension point
|
|
|
|
*
|
|
|
|
* Registers an extension point.
|
|
|
|
*
|
|
|
|
* Returns: the new #GIOExtensionPoint. This object is owned by GIO
|
|
|
|
* and should not be freed
|
|
|
|
*/
|
2008-01-28 20:43:10 +01:00
|
|
|
GIOExtensionPoint *
|
|
|
|
g_io_extension_point_register (const char *name)
|
|
|
|
{
|
|
|
|
GIOExtensionPoint *ep;
|
|
|
|
|
|
|
|
G_LOCK (extension_points);
|
|
|
|
if (extension_points == NULL)
|
|
|
|
extension_points = g_hash_table_new_full (g_str_hash,
|
|
|
|
g_str_equal,
|
|
|
|
NULL,
|
|
|
|
(GDestroyNotify)g_io_extension_point_free);
|
|
|
|
|
2010-01-12 11:36:12 +01:00
|
|
|
ep = g_hash_table_lookup (extension_points, name);
|
|
|
|
if (ep != NULL)
|
2008-01-28 20:43:10 +01:00
|
|
|
{
|
|
|
|
G_UNLOCK (extension_points);
|
2010-01-12 11:36:12 +01:00
|
|
|
return ep;
|
2008-01-28 20:43:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
ep = g_new0 (GIOExtensionPoint, 1);
|
|
|
|
ep->name = g_strdup (name);
|
|
|
|
|
|
|
|
g_hash_table_insert (extension_points, ep->name, ep);
|
|
|
|
|
|
|
|
G_UNLOCK (extension_points);
|
|
|
|
|
|
|
|
return ep;
|
|
|
|
}
|
|
|
|
|
2008-02-11 08:12:56 +01:00
|
|
|
/**
|
|
|
|
* g_io_extension_point_lookup:
|
|
|
|
* @name: the name of the extension point
|
|
|
|
*
|
|
|
|
* Looks up an existing extension point.
|
|
|
|
*
|
|
|
|
* Returns: the #GIOExtensionPoint, or %NULL if there is no
|
|
|
|
* registered extension point with the given name
|
|
|
|
*/
|
2008-01-28 20:43:10 +01:00
|
|
|
GIOExtensionPoint *
|
|
|
|
g_io_extension_point_lookup (const char *name)
|
|
|
|
{
|
|
|
|
GIOExtensionPoint *ep;
|
|
|
|
|
|
|
|
G_LOCK (extension_points);
|
|
|
|
ep = NULL;
|
|
|
|
if (extension_points != NULL)
|
|
|
|
ep = g_hash_table_lookup (extension_points, name);
|
|
|
|
|
|
|
|
G_UNLOCK (extension_points);
|
|
|
|
|
|
|
|
return ep;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2008-02-11 08:12:56 +01:00
|
|
|
/**
|
|
|
|
* g_io_extension_point_set_required_type:
|
|
|
|
* @extension_point: a #GIOExtensionPoint
|
|
|
|
* @type: the #GType to require
|
|
|
|
*
|
|
|
|
* Sets the required type for @extension_point to @type.
|
|
|
|
* All implementations must henceforth have this type.
|
|
|
|
*/
|
2008-01-28 20:43:10 +01:00
|
|
|
void
|
|
|
|
g_io_extension_point_set_required_type (GIOExtensionPoint *extension_point,
|
|
|
|
GType type)
|
|
|
|
{
|
|
|
|
extension_point->required_type = type;
|
|
|
|
}
|
|
|
|
|
2008-02-11 08:12:56 +01:00
|
|
|
/**
|
|
|
|
* g_io_extension_point_get_required_type:
|
|
|
|
* @extension_point: a #GIOExtensionPoint
|
|
|
|
*
|
|
|
|
* Gets the required type for @extension_point.
|
|
|
|
*
|
|
|
|
* Returns: the #GType that all implementations must have,
|
|
|
|
* or #G_TYPE_INVALID if the extension point has no required type
|
|
|
|
*/
|
2008-01-28 20:43:10 +01:00
|
|
|
GType
|
|
|
|
g_io_extension_point_get_required_type (GIOExtensionPoint *extension_point)
|
|
|
|
{
|
|
|
|
return extension_point->required_type;
|
|
|
|
}
|
|
|
|
|
2010-01-12 11:36:12 +01:00
|
|
|
void
|
|
|
|
lazy_load_modules (GIOExtensionPoint *extension_point)
|
|
|
|
{
|
|
|
|
GIOModule *module;
|
|
|
|
GList *l;
|
|
|
|
|
|
|
|
for (l = extension_point->lazy_load_modules; l != NULL; l = l->next)
|
|
|
|
{
|
|
|
|
module = l->data;
|
|
|
|
|
|
|
|
if (!module->initialized)
|
|
|
|
{
|
|
|
|
if (g_type_module_use (G_TYPE_MODULE (module)))
|
|
|
|
g_type_module_unuse (G_TYPE_MODULE (module)); /* Unload */
|
|
|
|
else
|
|
|
|
g_printerr ("Failed to load module: %s\n",
|
|
|
|
module->filename);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-02-11 08:12:56 +01:00
|
|
|
/**
|
|
|
|
* g_io_extension_point_get_extensions:
|
|
|
|
* @extension_point: a #GIOExtensionPoint
|
|
|
|
*
|
|
|
|
* Gets a list of all extensions that implement this extension point.
|
|
|
|
* The list is sorted by priority, beginning with the highest priority.
|
2010-07-26 17:21:14 +02:00
|
|
|
*
|
|
|
|
* Returns: (element-type GIOExtension) (transfer none): a #GList of
|
|
|
|
* #GIOExtension<!-- -->s. The list is owned by GIO and should not be
|
|
|
|
* modified.
|
2008-02-11 08:12:56 +01:00
|
|
|
*/
|
2008-01-28 20:43:10 +01:00
|
|
|
GList *
|
|
|
|
g_io_extension_point_get_extensions (GIOExtensionPoint *extension_point)
|
|
|
|
{
|
2010-01-12 11:36:12 +01:00
|
|
|
lazy_load_modules (extension_point);
|
2008-01-28 20:43:10 +01:00
|
|
|
return extension_point->extensions;
|
|
|
|
}
|
|
|
|
|
2008-02-11 08:12:56 +01:00
|
|
|
/**
|
|
|
|
* g_io_extension_point_get_extension_by_name:
|
|
|
|
* @extension_point: a #GIOExtensionPoint
|
|
|
|
* @name: the name of the extension to get
|
|
|
|
*
|
|
|
|
* Finds a #GIOExtension for an extension point by name.
|
|
|
|
*
|
2010-09-24 23:24:41 +02:00
|
|
|
* Returns: (transfer none): the #GIOExtension for @extension_point that has the
|
2008-02-11 08:12:56 +01:00
|
|
|
* given name, or %NULL if there is no extension with that name
|
|
|
|
*/
|
2008-01-28 20:43:10 +01:00
|
|
|
GIOExtension *
|
|
|
|
g_io_extension_point_get_extension_by_name (GIOExtensionPoint *extension_point,
|
|
|
|
const char *name)
|
|
|
|
{
|
|
|
|
GList *l;
|
|
|
|
|
2010-01-12 11:36:12 +01:00
|
|
|
lazy_load_modules (extension_point);
|
2008-01-28 20:43:10 +01:00
|
|
|
for (l = extension_point->extensions; l != NULL; l = l->next)
|
|
|
|
{
|
|
|
|
GIOExtension *e = l->data;
|
|
|
|
|
|
|
|
if (e->name != NULL &&
|
|
|
|
strcmp (e->name, name) == 0)
|
|
|
|
return e;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
extension_prio_compare (gconstpointer a,
|
|
|
|
gconstpointer b)
|
|
|
|
{
|
|
|
|
const GIOExtension *extension_a = a, *extension_b = b;
|
|
|
|
|
2010-09-04 01:03:34 +02:00
|
|
|
if (extension_a->priority > extension_b->priority)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
if (extension_b->priority > extension_a->priority)
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
return 0;
|
2008-01-28 20:43:10 +01:00
|
|
|
}
|
|
|
|
|
2008-02-11 08:12:56 +01:00
|
|
|
/**
|
|
|
|
* g_io_extension_point_implement:
|
|
|
|
* @extension_point_name: the name of the extension point
|
|
|
|
* @type: the #GType to register as extension
|
|
|
|
* @extension_name: the name for the extension
|
|
|
|
* @priority: the priority for the extension
|
|
|
|
*
|
|
|
|
* Registers @type as extension for the extension point with name
|
|
|
|
* @extension_point_name.
|
|
|
|
*
|
|
|
|
* If @type has already been registered as an extension for this
|
|
|
|
* extension point, the existing #GIOExtension object is returned.
|
|
|
|
*
|
|
|
|
* Returns: a #GIOExtension object for #GType
|
|
|
|
*/
|
2008-01-28 20:43:10 +01:00
|
|
|
GIOExtension *
|
|
|
|
g_io_extension_point_implement (const char *extension_point_name,
|
2008-02-11 08:12:56 +01:00
|
|
|
GType type,
|
2008-01-28 20:43:10 +01:00
|
|
|
const char *extension_name,
|
2008-02-11 08:12:56 +01:00
|
|
|
gint priority)
|
2008-01-28 20:43:10 +01:00
|
|
|
{
|
|
|
|
GIOExtensionPoint *extension_point;
|
|
|
|
GIOExtension *extension;
|
|
|
|
GList *l;
|
|
|
|
|
|
|
|
g_return_val_if_fail (extension_point_name != NULL, NULL);
|
|
|
|
|
|
|
|
extension_point = g_io_extension_point_lookup (extension_point_name);
|
|
|
|
if (extension_point == NULL)
|
|
|
|
{
|
|
|
|
g_warning ("Tried to implement non-registered extension point %s", extension_point_name);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (extension_point->required_type != 0 &&
|
|
|
|
!g_type_is_a (type, extension_point->required_type))
|
|
|
|
{
|
|
|
|
g_warning ("Tried to register an extension of the type %s to extension point %s. "
|
|
|
|
"Expected type is %s.",
|
|
|
|
g_type_name (type),
|
|
|
|
extension_point_name,
|
|
|
|
g_type_name (extension_point->required_type));
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2009-02-23 05:30:06 +01:00
|
|
|
/* It's safe to register the same type multiple times */
|
2008-01-28 20:43:10 +01:00
|
|
|
for (l = extension_point->extensions; l != NULL; l = l->next)
|
|
|
|
{
|
|
|
|
extension = l->data;
|
|
|
|
if (extension->type == type)
|
|
|
|
return extension;
|
|
|
|
}
|
|
|
|
|
|
|
|
extension = g_slice_new0 (GIOExtension);
|
|
|
|
extension->type = type;
|
|
|
|
extension->name = g_strdup (extension_name);
|
|
|
|
extension->priority = priority;
|
|
|
|
|
|
|
|
extension_point->extensions = g_list_insert_sorted (extension_point->extensions,
|
|
|
|
extension, extension_prio_compare);
|
|
|
|
|
|
|
|
return extension;
|
|
|
|
}
|
|
|
|
|
2008-02-11 08:12:56 +01:00
|
|
|
/**
|
|
|
|
* g_io_extension_ref_class:
|
|
|
|
* @extension: a #GIOExtension
|
|
|
|
*
|
|
|
|
* Gets a reference to the class for the type that is
|
|
|
|
* associated with @extension.
|
|
|
|
*
|
2010-09-24 23:24:41 +02:00
|
|
|
* Returns: (transfer full): the #GTypeClass for the type of @extension
|
2008-02-11 08:12:56 +01:00
|
|
|
*/
|
2008-01-28 20:43:10 +01:00
|
|
|
GTypeClass *
|
|
|
|
g_io_extension_ref_class (GIOExtension *extension)
|
|
|
|
{
|
|
|
|
return g_type_class_ref (extension->type);
|
|
|
|
}
|
|
|
|
|
2008-02-11 08:12:56 +01:00
|
|
|
/**
|
|
|
|
* g_io_extension_get_type:
|
|
|
|
* @extension: a #GIOExtension
|
|
|
|
*
|
|
|
|
* Gets the type associated with @extension.
|
|
|
|
*
|
|
|
|
* Returns: the type of @extension
|
|
|
|
*/
|
2008-01-28 20:43:10 +01:00
|
|
|
GType
|
|
|
|
g_io_extension_get_type (GIOExtension *extension)
|
|
|
|
{
|
|
|
|
return extension->type;
|
|
|
|
}
|
|
|
|
|
2008-02-11 08:12:56 +01:00
|
|
|
/**
|
|
|
|
* g_io_extension_get_name:
|
|
|
|
* @extension: a #GIOExtension
|
|
|
|
*
|
|
|
|
* Gets the name under which @extension was registered.
|
|
|
|
*
|
|
|
|
* Note that the same type may be registered as extension
|
|
|
|
* for multiple extension points, under different names.
|
|
|
|
*
|
|
|
|
* Returns: the name of @extension.
|
|
|
|
*/
|
2008-01-28 20:43:10 +01:00
|
|
|
const char *
|
|
|
|
g_io_extension_get_name (GIOExtension *extension)
|
|
|
|
{
|
|
|
|
return extension->name;
|
|
|
|
}
|
|
|
|
|
2008-02-11 08:12:56 +01:00
|
|
|
/**
|
|
|
|
* g_io_extension_get_priority:
|
|
|
|
* @extension: a #GIOExtension
|
|
|
|
*
|
|
|
|
* Gets the priority with which @extension was registered.
|
|
|
|
*
|
|
|
|
* Returns: the priority of @extension
|
|
|
|
*/
|
2008-01-28 20:43:10 +01:00
|
|
|
gint
|
|
|
|
g_io_extension_get_priority (GIOExtension *extension)
|
|
|
|
{
|
|
|
|
return extension->priority;
|
|
|
|
}
|