Blame gio/giomodule.h

Packit ae235b
/* GIO - GLib Input, Output and Streaming Library
Packit ae235b
 *
Packit ae235b
 * Copyright (C) 2006-2007 Red Hat, Inc.
Packit ae235b
 *
Packit ae235b
 * This library is free software; you can redistribute it and/or
Packit ae235b
 * modify it under the terms of the GNU Lesser General Public
Packit ae235b
 * License as published by the Free Software Foundation; either
Packit ae235b
 * version 2.1 of the License, or (at your option) any later version.
Packit ae235b
 *
Packit ae235b
 * This library is distributed in the hope that it will be useful,
Packit ae235b
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit ae235b
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit ae235b
 * Lesser General Public License for more details.
Packit ae235b
 *
Packit ae235b
 * You should have received a copy of the GNU Lesser General
Packit ae235b
 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
Packit ae235b
 *
Packit ae235b
 * Author: Alexander Larsson <alexl@redhat.com>
Packit ae235b
 */
Packit ae235b
Packit ae235b
#ifndef __G_IO_MODULE_H__
Packit ae235b
#define __G_IO_MODULE_H__
Packit ae235b
Packit ae235b
#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
Packit ae235b
#error "Only <gio/gio.h> can be included directly."
Packit ae235b
#endif
Packit ae235b
Packit ae235b
#include <gio/giotypes.h>
Packit ae235b
#include <gmodule.h>
Packit ae235b
Packit ae235b
G_BEGIN_DECLS
Packit ae235b
Packit ae235b
typedef struct _GIOModuleScope GIOModuleScope;
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_2_30
Packit ae235b
GIOModuleScope *   g_io_module_scope_new     (GIOModuleScopeFlags  flags);
Packit ae235b
GLIB_AVAILABLE_IN_2_30
Packit ae235b
void               g_io_module_scope_free    (GIOModuleScope      *scope);
Packit ae235b
GLIB_AVAILABLE_IN_2_30
Packit ae235b
void               g_io_module_scope_block   (GIOModuleScope      *scope,
Packit ae235b
                                              const gchar         *basename);
Packit ae235b
Packit ae235b
#define G_IO_TYPE_MODULE         (g_io_module_get_type ())
Packit ae235b
#define G_IO_MODULE(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), G_IO_TYPE_MODULE, GIOModule))
Packit ae235b
#define G_IO_MODULE_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), G_IO_TYPE_MODULE, GIOModuleClass))
Packit ae235b
#define G_IO_IS_MODULE(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_IO_TYPE_MODULE))
Packit ae235b
#define G_IO_IS_MODULE_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), G_IO_TYPE_MODULE))
Packit ae235b
#define G_IO_MODULE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_IO_TYPE_MODULE, GIOModuleClass))
Packit ae235b
Packit ae235b
/**
Packit ae235b
 * GIOModule:
Packit ae235b
 *
Packit ae235b
 * Opaque module base class for extending GIO.
Packit ae235b
 **/
Packit ae235b
typedef struct _GIOModuleClass GIOModuleClass;
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
GType              g_io_module_get_type                       (void) G_GNUC_CONST;
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
GIOModule         *g_io_module_new                            (const gchar       *filename);
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void               g_io_modules_scan_all_in_directory         (const char        *dirname);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
GList             *g_io_modules_load_all_in_directory         (const gchar       *dirname);
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_2_30
Packit ae235b
void               g_io_modules_scan_all_in_directory_with_scope   (const gchar       *dirname,
Packit ae235b
                                                                    GIOModuleScope    *scope);
Packit ae235b
GLIB_AVAILABLE_IN_2_30
Packit ae235b
GList             *g_io_modules_load_all_in_directory_with_scope   (const gchar       *dirname,
Packit ae235b
                                                                    GIOModuleScope    *scope);
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
GIOExtensionPoint *g_io_extension_point_register              (const char        *name);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
GIOExtensionPoint *g_io_extension_point_lookup                (const char        *name);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void               g_io_extension_point_set_required_type     (GIOExtensionPoint *extension_point,
Packit ae235b
							       GType              type);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
GType              g_io_extension_point_get_required_type     (GIOExtensionPoint *extension_point);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
GList             *g_io_extension_point_get_extensions        (GIOExtensionPoint *extension_point);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
GIOExtension *     g_io_extension_point_get_extension_by_name (GIOExtensionPoint *extension_point,
Packit ae235b
							       const char        *name);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
GIOExtension *     g_io_extension_point_implement             (const char        *extension_point_name,
Packit ae235b
							       GType              type,
Packit ae235b
							       const char        *extension_name,
Packit ae235b
							       gint               priority);
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
GType              g_io_extension_get_type                    (GIOExtension      *extension);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
const char *       g_io_extension_get_name                    (GIOExtension      *extension);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
gint               g_io_extension_get_priority                (GIOExtension      *extension);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
GTypeClass*        g_io_extension_ref_class                   (GIOExtension      *extension);
Packit ae235b
Packit ae235b
Packit ae235b
/* API for the modules to implement */
Packit ae235b
Packit ae235b
/**
Packit ae235b
 * g_io_module_load:
Packit ae235b
 * @module: a #GIOModule.
Packit ae235b
 *
Packit ae235b
 * Required API for GIO modules to implement.
Packit ae235b
 *
Packit ae235b
 * This function is run after the module has been loaded into GIO,
Packit ae235b
 * to initialize the module. Typically, this function will call
Packit ae235b
 * g_io_extension_point_implement().
Packit ae235b
 *
Packit ae235b
 * Since 2.56, this function should be named `g_io_<modulename>_load`, where
Packit ae235b
 * `modulename` is the plugin’s filename with the `lib` or `libgio` prefix and
Packit ae235b
 * everything after the first dot removed, and with `-` replaced with `_`
Packit ae235b
 * throughout. For example, `libgiognutls-helper.so` becomes `gnutls_helper`.
Packit ae235b
 * Using the new symbol names avoids name clashes when building modules
Packit ae235b
 * statically. The old symbol names continue to be supported, but cannot be used
Packit ae235b
 * for static builds.
Packit ae235b
 **/
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void   g_io_module_load   (GIOModule *module);
Packit ae235b
Packit ae235b
/**
Packit ae235b
 * g_io_module_unload:
Packit ae235b
 * @module: a #GIOModule.
Packit ae235b
 *
Packit ae235b
 * Required API for GIO modules to implement.
Packit ae235b
 *
Packit ae235b
 * This function is run when the module is being unloaded from GIO,
Packit ae235b
 * to finalize the module.
Packit ae235b
 *
Packit ae235b
 * Since 2.56, this function should be named `g_io_<modulename>_unload`, where
Packit ae235b
 * `modulename` is the plugin’s filename with the `lib` or `libgio` prefix and
Packit ae235b
 * everything after the first dot removed, and with `-` replaced with `_`
Packit ae235b
 * throughout. For example, `libgiognutls-helper.so` becomes `gnutls_helper`.
Packit ae235b
 * Using the new symbol names avoids name clashes when building modules
Packit ae235b
 * statically. The old symbol names continue to be supported, but cannot be used
Packit ae235b
 * for static builds.
Packit ae235b
 **/
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void   g_io_module_unload (GIOModule *module);
Packit ae235b
Packit ae235b
/**
Packit ae235b
 * g_io_module_query:
Packit ae235b
 *
Packit ae235b
 * Optional API for GIO modules to implement.
Packit ae235b
 *
Packit ae235b
 * Should return a list of all the extension points that may be
Packit ae235b
 * implemented in this module.
Packit ae235b
 *
Packit ae235b
 * This method will not be called in normal use, however it may be
Packit ae235b
 * called when probing existing modules and recording which extension
Packit ae235b
 * points that this model is used for. This means we won't have to
Packit ae235b
 * load and initialize this module unless its needed.
Packit ae235b
 *
Packit ae235b
 * If this function is not implemented by the module the module will
Packit ae235b
 * always be loaded, initialized and then unloaded on application
Packit ae235b
 * startup so that it can register its extension points during init.
Packit ae235b
 *
Packit ae235b
 * Note that a module need not actually implement all the extension
Packit ae235b
 * points that g_io_module_query() returns, since the exact list of
Packit ae235b
 * extension may depend on runtime issues. However all extension
Packit ae235b
 * points actually implemented must be returned by g_io_module_query()
Packit ae235b
 * (if defined).
Packit ae235b
 *
Packit ae235b
 * When installing a module that implements g_io_module_query() you must
Packit ae235b
 * run gio-querymodules in order to build the cache files required for
Packit ae235b
 * lazy loading.
Packit ae235b
 *
Packit ae235b
 * Since 2.56, this function should be named `g_io_<modulename>_query`, where
Packit ae235b
 * `modulename` is the plugin’s filename with the `lib` or `libgio` prefix and
Packit ae235b
 * everything after the first dot removed, and with `-` replaced with `_`
Packit ae235b
 * throughout. For example, `libgiognutls-helper.so` becomes `gnutls_helper`.
Packit ae235b
 * Using the new symbol names avoids name clashes when building modules
Packit ae235b
 * statically. The old symbol names continue to be supported, but cannot be used
Packit ae235b
 * for static builds.
Packit ae235b
 *
Packit ae235b
 * Returns: (transfer full): A %NULL-terminated array of strings,
Packit ae235b
 *     listing the supported extension points of the module. The array
Packit ae235b
 *     must be suitable for freeing with g_strfreev().
Packit ae235b
 *
Packit ae235b
 * Since: 2.24
Packit ae235b
 **/
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
char **g_io_module_query (void);
Packit ae235b
Packit ae235b
G_END_DECLS
Packit ae235b
Packit ae235b
#endif /* __G_IO_MODULE_H__ */