dl.pp 792 B

123456789101112131415161718192021222324252627282930
  1. Unit dl;
  2. Interface
  3. Const
  4. {$ifdef BSD} // dlopen is in libc on FreeBSD.
  5. LibDL = 'c';
  6. {$else}
  7. LibDL = 'dl';
  8. {$endif}
  9. RTLD_LAZY = $001;
  10. RTLD_NOW = $002;
  11. RTLD_BINDING_MASK = $003;
  12. RTLD_GLOBAL = $100;
  13. {$ifdef BSD}
  14. RTLD_MODEMASK = RTLD_BINDING_MASK;
  15. {$endif}
  16. Function dlopen(Name : PChar; Flags : longint) : Pointer; cdecl; external libdl;
  17. FUnction dlsym(Lib : Pointer; Name : Pchar) : Pointer; cdecl; external Libdl;
  18. Function dlclose(Lib : Pointer) : Longint; cdecl; external libdl;
  19. Function dlerror() : Pchar; cdecl; external libdl;
  20. { overloaded for compatibility with hmodule }
  21. FUnction dlsym(Lib : PtrInt; Name : Pchar) : Pointer; cdecl; external Libdl;
  22. Function dlclose(Lib : PtrInt) : Longint; cdecl; external libdl;
  23. implementation
  24. end.