Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:57

0001 /* GIO - GLib Input, Output and Streaming Library
0002  *
0003  * Copyright (C) 2006-2007 Red Hat, Inc.
0004  *
0005  * SPDX-License-Identifier: LGPL-2.1-or-later
0006  *
0007  * This library is free software; you can redistribute it and/or
0008  * modify it under the terms of the GNU Lesser General Public
0009  * License as published by the Free Software Foundation; either
0010  * version 2.1 of the License, or (at your option) any later version.
0011  *
0012  * This library is distributed in the hope that it will be useful,
0013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0015  * Lesser General Public License for more details.
0016  *
0017  * You should have received a copy of the GNU Lesser General
0018  * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
0019  *
0020  * Author: Alexander Larsson <alexl@redhat.com>
0021  */
0022 
0023 #ifndef __G_IO_MODULE_H__
0024 #define __G_IO_MODULE_H__
0025 
0026 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
0027 #error "Only <gio/gio.h> can be included directly."
0028 #endif
0029 
0030 #include <gio/giotypes.h>
0031 #include <gmodule.h>
0032 
0033 G_BEGIN_DECLS
0034 
0035 typedef struct _GIOModuleScope GIOModuleScope;
0036 
0037 GIO_AVAILABLE_IN_2_30
0038 GIOModuleScope *   g_io_module_scope_new     (GIOModuleScopeFlags  flags);
0039 GIO_AVAILABLE_IN_2_30
0040 void               g_io_module_scope_free    (GIOModuleScope      *scope);
0041 GIO_AVAILABLE_IN_2_30
0042 void               g_io_module_scope_block   (GIOModuleScope      *scope,
0043                                               const gchar         *basename);
0044 
0045 #define G_IO_TYPE_MODULE         (g_io_module_get_type ())
0046 #define G_IO_MODULE(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), G_IO_TYPE_MODULE, GIOModule))
0047 #define G_IO_MODULE_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), G_IO_TYPE_MODULE, GIOModuleClass))
0048 #define G_IO_IS_MODULE(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_IO_TYPE_MODULE))
0049 #define G_IO_IS_MODULE_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), G_IO_TYPE_MODULE))
0050 #define G_IO_MODULE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_IO_TYPE_MODULE, GIOModuleClass))
0051 
0052 typedef struct _GIOModuleClass GIOModuleClass;
0053 
0054 GIO_AVAILABLE_IN_ALL
0055 GType              g_io_module_get_type                       (void) G_GNUC_CONST;
0056 GIO_AVAILABLE_IN_ALL
0057 GIOModule         *g_io_module_new                            (const gchar       *filename);
0058 
0059 GIO_AVAILABLE_IN_ALL
0060 void               g_io_modules_scan_all_in_directory         (const char        *dirname);
0061 GIO_AVAILABLE_IN_ALL
0062 GList             *g_io_modules_load_all_in_directory         (const gchar       *dirname);
0063 
0064 GIO_AVAILABLE_IN_2_30
0065 void               g_io_modules_scan_all_in_directory_with_scope   (const gchar       *dirname,
0066                                                                     GIOModuleScope    *scope);
0067 GIO_AVAILABLE_IN_2_30
0068 GList             *g_io_modules_load_all_in_directory_with_scope   (const gchar       *dirname,
0069                                                                     GIOModuleScope    *scope);
0070 
0071 GIO_AVAILABLE_IN_ALL
0072 GIOExtensionPoint *g_io_extension_point_register              (const char        *name);
0073 GIO_AVAILABLE_IN_ALL
0074 GIOExtensionPoint *g_io_extension_point_lookup                (const char        *name);
0075 GIO_AVAILABLE_IN_ALL
0076 void               g_io_extension_point_set_required_type     (GIOExtensionPoint *extension_point,
0077                                    GType              type);
0078 GIO_AVAILABLE_IN_ALL
0079 GType              g_io_extension_point_get_required_type     (GIOExtensionPoint *extension_point);
0080 GIO_AVAILABLE_IN_ALL
0081 GList             *g_io_extension_point_get_extensions        (GIOExtensionPoint *extension_point);
0082 GIO_AVAILABLE_IN_ALL
0083 GIOExtension *     g_io_extension_point_get_extension_by_name (GIOExtensionPoint *extension_point,
0084                                    const char        *name);
0085 GIO_AVAILABLE_IN_ALL
0086 GIOExtension *     g_io_extension_point_implement             (const char        *extension_point_name,
0087                                    GType              type,
0088                                    const char        *extension_name,
0089                                    gint               priority);
0090 
0091 GIO_AVAILABLE_IN_ALL
0092 GType              g_io_extension_get_type                    (GIOExtension      *extension);
0093 GIO_AVAILABLE_IN_ALL
0094 const char *       g_io_extension_get_name                    (GIOExtension      *extension);
0095 GIO_AVAILABLE_IN_ALL
0096 gint               g_io_extension_get_priority                (GIOExtension      *extension);
0097 GIO_AVAILABLE_IN_ALL
0098 GTypeClass*        g_io_extension_ref_class                   (GIOExtension      *extension);
0099 
0100 
0101 /* API for the modules to implement.
0102  * Note that those functions are not implemented by libgio, they are declared
0103  * here to be implemented in modules, that's why it uses G_MODULE_EXPORT
0104  * instead of GIO_AVAILABLE_IN_ALL.
0105  */
0106 
0107 /**
0108  * g_io_module_load: (skip)
0109  * @module: a #GIOModule.
0110  *
0111  * Required API for GIO modules to implement.
0112  *
0113  * This function is run after the module has been loaded into GIO,
0114  * to initialize the module. Typically, this function will call
0115  * g_io_extension_point_implement().
0116  *
0117  * Since 2.56, this function should be named `g_io_<modulename>_load`, where
0118  * `modulename` is the plugin’s filename with the `lib` or `libgio` prefix and
0119  * everything after the first dot removed, and with `-` replaced with `_`
0120  * throughout. For example, `libgiognutls-helper.so` becomes `gnutls_helper`.
0121  * Using the new symbol names avoids name clashes when building modules
0122  * statically. The old symbol names continue to be supported, but cannot be used
0123  * for static builds.
0124  **/
0125 G_MODULE_EXPORT
0126 void   g_io_module_load   (GIOModule *module);
0127 
0128 /**
0129  * g_io_module_unload: (skip)
0130  * @module: a #GIOModule.
0131  *
0132  * Required API for GIO modules to implement.
0133  *
0134  * This function is run when the module is being unloaded from GIO,
0135  * to finalize the module.
0136  *
0137  * Since 2.56, this function should be named `g_io_<modulename>_unload`, where
0138  * `modulename` is the plugin’s filename with the `lib` or `libgio` prefix and
0139  * everything after the first dot removed, and with `-` replaced with `_`
0140  * throughout. For example, `libgiognutls-helper.so` becomes `gnutls_helper`.
0141  * Using the new symbol names avoids name clashes when building modules
0142  * statically. The old symbol names continue to be supported, but cannot be used
0143  * for static builds.
0144  **/
0145 G_MODULE_EXPORT
0146 void   g_io_module_unload (GIOModule *module);
0147 
0148 /**
0149  * g_io_module_query:
0150  *
0151  * Optional API for GIO modules to implement.
0152  *
0153  * Should return a list of all the extension points that may be
0154  * implemented in this module.
0155  *
0156  * This method will not be called in normal use, however it may be
0157  * called when probing existing modules and recording which extension
0158  * points that this model is used for. This means we won't have to
0159  * load and initialize this module unless its needed.
0160  *
0161  * If this function is not implemented by the module the module will
0162  * always be loaded, initialized and then unloaded on application
0163  * startup so that it can register its extension points during init.
0164  *
0165  * Note that a module need not actually implement all the extension
0166  * points that g_io_module_query() returns, since the exact list of
0167  * extension may depend on runtime issues. However all extension
0168  * points actually implemented must be returned by g_io_module_query()
0169  * (if defined).
0170  *
0171  * When installing a module that implements g_io_module_query() you must
0172  * run gio-querymodules in order to build the cache files required for
0173  * lazy loading.
0174  *
0175  * Since 2.56, this function should be named `g_io_<modulename>_query`, where
0176  * `modulename` is the plugin’s filename with the `lib` or `libgio` prefix and
0177  * everything after the first dot removed, and with `-` replaced with `_`
0178  * throughout. For example, `libgiognutls-helper.so` becomes `gnutls_helper`.
0179  * Using the new symbol names avoids name clashes when building modules
0180  * statically. The old symbol names continue to be supported, but cannot be used
0181  * for static builds.
0182  *
0183  * Returns: (transfer full): A %NULL-terminated array of strings,
0184  *     listing the supported extension points of the module. The array
0185  *     must be suitable for freeing with g_strfreev().
0186  *
0187  * Since: 2.24
0188  **/
0189 G_MODULE_EXPORT
0190 char **g_io_module_query (void);
0191 
0192 G_END_DECLS
0193 
0194 #endif /* __G_IO_MODULE_H__ */