gmodule.pp 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. {$ifdef os2}
  35. const
  36. gmoduledll='gmodule';
  37. {$define gtkos2}
  38. {$packrecords C}
  39. {$else}
  40. const
  41. gmoduledll='gmodule';
  42. {$packrecords C}
  43. {$endif}
  44. {$endif}
  45. {$ifndef gtkos2}
  46. var
  47. g_log_domain_gmodule : Pgchar;external gmoduledll name 'g_log_domain_gmodule';
  48. {$endif}
  49. type
  50. PGModule=pointer;
  51. TGModuleFlags = longint;
  52. const
  53. G_MODULE_BIND_LAZY = 1 shl 0;
  54. G_MODULE_BIND_MASK = 1;
  55. type
  56. TGModuleCheckInit = function (module:PGModule):Pgchar;cdecl;
  57. TGModuleUnload = procedure (module:PGModule);cdecl;
  58. function g_module_supported:gboolean;cdecl;external gmoduledll name 'g_module_supported';
  59. function g_module_open(file_name:Pgchar; flags:TGModuleFlags):PGModule;cdecl;external gmoduledll name 'g_module_open';
  60. function g_module_close(module:PGModule):gboolean;cdecl;external gmoduledll name 'g_module_close';
  61. procedure g_module_make_resident(module:PGModule);cdecl;external gmoduledll name 'g_module_make_resident';
  62. function g_module_error:Pgchar;cdecl;external gmoduledll name 'g_module_error';
  63. function g_module_symbol(module:PGModule; symbol_name:Pgchar; symbol:Pgpointer):gboolean;cdecl;external gmoduledll name 'g_module_symbol';
  64. function g_module_name(module:PGModule):Pgchar;cdecl;external gmoduledll name 'g_module_name';
  65. function g_module_build_path(directory:Pgchar; module_name:Pgchar):Pgchar;cdecl;external gmoduledll name 'g_module_build_path';
  66. implementation
  67. end.
  68. {
  69. $Log$
  70. Revision 1.3 2003-03-02 02:10:19 hajny
  71. + OS/2 support for GTK and X11 added by Yuri
  72. Revision 1.2 2002/09/07 15:42:59 peter
  73. * old logs removed and tabs fixed
  74. Revision 1.1 2002/01/29 17:55:08 peter
  75. * splitted to base and extra
  76. }