fix cmopiler warnings. check (de)initialization code.
[platform/upstream/glib.git] / gmodule / gmodule.h
1 /* GMODULE - GLIB wrapper code for dynamic module loading
2  * Copyright (C) 1998 Tim Janik
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19 #ifndef __GMODULE_H__
20 #define __GMODULE_H__
21
22
23 #include <glib.h>
24
25 #ifdef __cplusplus
26 extern "C" {
27 #pragma }
28 #endif /* __cplusplus */
29
30
31 /* exporting and importing functions,
32  * we need autoconf support here for supporting windows.
33  */
34 #define G_MODULE_EXPORT
35 #define G_MODULE_IMPORT         extern
36
37
38 typedef enum
39 {
40   G_MODULE_BIND_LAZY    = 1 << 0,
41   G_MODULE_BIND_MASK    = 0x01
42 } GModuleFlags;
43
44 typedef struct  _GModule                GModule;
45 typedef gboolean (*GModuleCheckInit)    (GModule        *module);
46 typedef void     (*GModuleDeInit)       (GModule        *module);
47
48 /* return TRUE if dynamic module loading is supported */
49 gboolean        g_module_supported         (void);
50
51 /* open a module `file_name' and return handle, which is NULL on error */
52 GModule*        g_module_open              (const gchar         *file_name,
53                                             GModuleFlags         flags);
54
55 /* close a previously opened module, returns TRUE on success */
56 gboolean        g_module_close             (GModule             *module);
57
58 /* query the last module error as a string */
59 gchar*          g_module_error             (void);
60
61 /* retrive a symbol pointer from `module', returns TRUE on success */
62 gboolean        g_module_symbol            (GModule             *module,
63                                             const gchar         *symbol_name,
64                                             gconstpointer       *symbol);
65
66 /* retrive the file name from an existing module */
67 gchar*          g_module_name              (GModule             *module);
68
69
70 #ifdef __cplusplus
71 }
72 #endif /* __cplusplus */
73
74
75 #endif /* __GMODULE_H__ */