gmodule.pp 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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.5 2000-09-09 18:41:39 peter
  62. * fixes for gtk win32
  63. Revision 1.4 2000/09/06 21:14:28 peter
  64. * packrecords 4 for win32, packrecords c for linux
  65. Revision 1.3 2000/08/06 10:46:23 peter
  66. * force smartlink (merged)
  67. Revision 1.2 2000/07/13 11:33:20 michael
  68. + removed logs
  69. }