gmodule.pp 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. {
  2. $Id$
  3. GMODULE - GLIB wrapper code for dynamic module loading
  4. Copyright (C) 1998 Tim Janik
  5. This library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU Library 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. 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. You should have received a copy of the GNU Library General Public
  14. License along with this library; if not, write to the
  15. Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  16. Boston, MA 02111-1307, USA.
  17. }
  18. unit gmodule;
  19. interface
  20. {$mode objfpc}
  21. uses
  22. glib;
  23. {$ifdef win32}
  24. const
  25. gmoduledll='gmodule-1.3';
  26. {$define gtkwin}
  27. {$else}
  28. const
  29. gmoduledll='gmodule';
  30. {$endif}
  31. {$packrecords C}
  32. var
  33. g_log_domain_gmodule : Pgchar;external gmoduledll name 'g_log_domain_gmodule';
  34. type
  35. PGModule=pointer;
  36. TGModuleFlags = longint;
  37. const
  38. G_MODULE_BIND_LAZY = 1 shl 0;
  39. G_MODULE_BIND_MASK = 1;
  40. type
  41. TGModuleCheckInit = function (module:PGModule):Pgchar;cdecl;
  42. TGModuleUnload = procedure (module:PGModule);cdecl;
  43. function g_module_supported:gboolean;cdecl;external gmoduledll name 'g_module_supported';
  44. function g_module_open(file_name:Pgchar; flags:TGModuleFlags):PGModule;cdecl;external gmoduledll name 'g_module_open';
  45. function g_module_close(module:PGModule):gboolean;cdecl;external gmoduledll name 'g_module_close';
  46. procedure g_module_make_resident(module:PGModule);cdecl;external gmoduledll name 'g_module_make_resident';
  47. function g_module_error:Pgchar;cdecl;external gmoduledll name 'g_module_error';
  48. function g_module_symbol(module:PGModule; symbol_name:Pgchar; symbol:Pgpointer):gboolean;cdecl;external gmoduledll name 'g_module_symbol';
  49. function g_module_name(module:PGModule):Pgchar;cdecl;external gmoduledll name 'g_module_name';
  50. function g_module_build_path(directory:Pgchar; module_name:Pgchar):Pgchar;cdecl;external gmoduledll name 'g_module_build_path';
  51. implementation
  52. end.
  53. {
  54. $Log$
  55. Revision 1.1 1999-11-24 23:36:34 peter
  56. * moved to packages dir
  57. Revision 1.6 1999/10/06 17:42:48 peter
  58. * external is now only in the interface
  59. * removed gtk 1.0 support
  60. Revision 1.5 1999/07/23 16:11:48 peter
  61. * use packrecords C
  62. Revision 1.4 1999/07/03 10:29:23 peter
  63. * enum fixes
  64. * use version 1.3 instead of 1.2 for win32
  65. Revision 1.3 1999/05/11 00:37:58 peter
  66. * win32 fixes
  67. Revision 1.2 1999/05/10 15:18:46 peter
  68. * cdecl fixes
  69. Revision 1.1 1999/05/07 10:40:22 peter
  70. * first things for 1.2
  71. }