epoc32/include/stdapis/glib-2.0/gmodule.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 gmodule.h
     1 /* GMODULE - GLIB wrapper code for dynamic module loading
       
     2  * Copyright (C) 1998 Tim Janik
       
     3  * Portions copyright (c) 2006 Nokia Corporation.  All rights reserved.
       
     4  *
       
     5  * This library is free software; you can redistribute it and/or
       
     6  * modify it under the terms of the GNU Lesser General Public
       
     7  * License as published by the Free Software Foundation; either
       
     8  * version 2 of the License, or (at your option) any later version.
       
     9  *
       
    10  * This library is distributed in the hope that it will be useful,
       
    11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
       
    13  * Lesser General Public License for more details.
       
    14  *
       
    15  * You should have received a copy of the GNU Lesser General Public
       
    16  * License along with this library; if not, write to the
       
    17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
       
    18  * Boston, MA 02111-1307, USA.
       
    19  */
       
    20 
       
    21 /*
       
    22  * Modified by the GLib Team and others 1997-2000.  See the AUTHORS
       
    23  * file for a list of people on the GLib Team.  See the ChangeLog
       
    24  * files for a list of changes.  These files are distributed with
       
    25  * GLib at ftp://ftp.gtk.org/pub/gtk/. 
       
    26  */
       
    27 
       
    28 #ifndef __GMODULE_H__
       
    29 #define __GMODULE_H__
       
    30 
       
    31 #include <_ansi.h>
       
    32 #include <glib.h>
       
    33 
       
    34 G_BEGIN_DECLS
       
    35 
       
    36 /* exporting and importing functions, this is special cased
       
    37  * to feature Windows dll stubs.
       
    38  */
       
    39 #define	G_MODULE_IMPORT		extern
       
    40 #ifdef G_PLATFORM_WIN32
       
    41 #  define	G_MODULE_EXPORT		__declspec(dllexport)
       
    42 #else /* !G_PLATFORM_WIN32 */
       
    43 #  define	G_MODULE_EXPORT
       
    44 #endif /* !G_PLATFORM_WIN32 */
       
    45 
       
    46 typedef enum
       
    47 {
       
    48   G_MODULE_BIND_LAZY	= 1 << 0,
       
    49   G_MODULE_BIND_LOCAL	= 1 << 1,
       
    50   G_MODULE_BIND_MASK	= 0x03
       
    51 } GModuleFlags;
       
    52 
       
    53 typedef	struct _GModule			 GModule;
       
    54 typedef const gchar* (*GModuleCheckInit) (GModule	*module);
       
    55 typedef void	     (*GModuleUnload)	 (GModule	*module);
       
    56 
       
    57 #ifdef G_OS_WIN32
       
    58 #define g_module_open g_module_open_utf8
       
    59 #define g_module_name g_module_name_utf8
       
    60 #endif
       
    61 
       
    62 /* return TRUE if dynamic module loading is supported */
       
    63 IMPORT_C gboolean	g_module_supported	   (void) G_GNUC_CONST;
       
    64 
       
    65 /* open a module `file_name' and return handle, which is NULL on error */
       
    66 IMPORT_C GModule*              g_module_open          (const gchar  *file_name,
       
    67 					      GModuleFlags  flags);
       
    68 
       
    69 /* close a previously opened module, returns TRUE on success */
       
    70 IMPORT_C gboolean              g_module_close         (GModule      *module);
       
    71 
       
    72 /* make a module resident so g_module_close on it will be ignored */
       
    73 IMPORT_C void                  g_module_make_resident (GModule      *module);
       
    74 
       
    75 /* query the last module error as a string */
       
    76 IMPORT_C G_CONST_RETURN gchar* g_module_error         (void);
       
    77 
       
    78 /* retrieve a symbol pointer from `module', returns TRUE on success */
       
    79 IMPORT_C gboolean              g_module_symbol        (GModule      *module,
       
    80 					      const gchar  *symbol_name,
       
    81 					      gpointer     *symbol);
       
    82 
       
    83 /* retrieve the file name from an existing module */
       
    84 IMPORT_C G_CONST_RETURN gchar* g_module_name          (GModule      *module);
       
    85 
       
    86 /* Build the actual file name containing a module. `directory' is the
       
    87  * directory where the module file is supposed to be, or NULL or empty
       
    88  * in which case it should either be in the current directory or, on
       
    89  * some operating systems, in some standard place, for instance on the
       
    90  * PATH. Hence, to be absoultely sure to get the correct module,
       
    91  * always pass in a directory. The file name consists of the directory,
       
    92  * if supplied, and `module_name' suitably decorated accoring to
       
    93  * the operating system's conventions (for instance lib*.so or *.dll).
       
    94  *
       
    95  * No checks are made that the file exists, or is of correct type.
       
    96  */
       
    97 IMPORT_C gchar*                g_module_build_path    (const gchar  *directory,
       
    98 					      const gchar  *module_name);
       
    99 
       
   100 
       
   101 G_END_DECLS
       
   102 
       
   103 #endif /* __GMODULE_H__ */