gmodule.pp 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. { Always use smartlinking for win32, this solves some undefined functions
  22. in the development gtk versions which change often (PFV) }
  23. {$ifdef win32}
  24. {$smartlink on}
  25. {$endif}
  26. uses
  27. glib;
  28. {$ifdef win32}
  29. const
  30. gmoduledll='gmodule-1.3';
  31. {$define gtkwin}
  32. {$packrecords C}
  33. {$else}
  34. const
  35. gmoduledll='gmodule';
  36. {$packrecords C}
  37. {$endif}
  38. var
  39. g_log_domain_gmodule : Pgchar;external gmoduledll name 'g_log_domain_gmodule';
  40. type
  41. PGModule=pointer;
  42. TGModuleFlags = longint;
  43. const
  44. G_MODULE_BIND_LAZY = 1 shl 0;
  45. G_MODULE_BIND_MASK = 1;
  46. type
  47. TGModuleCheckInit = function (module:PGModule):Pgchar;cdecl;
  48. TGModuleUnload = procedure (module:PGModule);cdecl;
  49. function g_module_supported:gboolean;cdecl;external gmoduledll name 'g_module_supported';
  50. function g_module_open(file_name:Pgchar; flags:TGModuleFlags):PGModule;cdecl;external gmoduledll name 'g_module_open';
  51. function g_module_close(module:PGModule):gboolean;cdecl;external gmoduledll name 'g_module_close';
  52. procedure g_module_make_resident(module:PGModule);cdecl;external gmoduledll name 'g_module_make_resident';
  53. function g_module_error:Pgchar;cdecl;external gmoduledll name 'g_module_error';
  54. function g_module_symbol(module:PGModule; symbol_name:Pgchar; symbol:Pgpointer):gboolean;cdecl;external gmoduledll name 'g_module_symbol';
  55. function g_module_name(module:PGModule):Pgchar;cdecl;external gmoduledll name 'g_module_name';
  56. function g_module_build_path(directory:Pgchar; module_name:Pgchar):Pgchar;cdecl;external gmoduledll name 'g_module_build_path';
  57. implementation
  58. end.
  59. {
  60. $Log$
  61. Revision 1.2 2002-09-07 15:42:59 peter
  62. * old logs removed and tabs fixed
  63. Revision 1.1 2002/01/29 17:55:08 peter
  64. * splitted to base and extra
  65. }