dlfcn_win32.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * dlfcn-win32
  3. * Copyright (c) 2007 Ramiro Polla
  4. *
  5. * dlfcn-win32 is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Lesser General Public
  7. * License as published by the Free Software Foundation; either
  8. * version 2.1 of the License, or (at your option) any later version.
  9. *
  10. * dlfcn-win32 is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General Public
  16. * License along with dlfcn-win32; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  18. */
  19. #ifndef DLFCN_H
  20. #define DLFCN_H
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. #if defined(DLFCN_WIN32_EXPORTS)
  25. # define DLFCN_EXPORT __declspec(dllexport)
  26. #else
  27. # define DLFCN_EXPORT
  28. #endif
  29. /* Relocations are performed when the object is loaded. */
  30. #define RTLD_NOW 0
  31. /* Relocations are performed at an implementation-defined time.
  32. * Windows API does not support lazy symbol resolving (when first reference
  33. * to a given symbol occurs). So RTLD_LAZY implementation is same as RTLD_NOW.
  34. */
  35. #define RTLD_LAZY RTLD_NOW
  36. /* All symbols are available for relocation processing of other modules. */
  37. #define RTLD_GLOBAL (1 << 1)
  38. /* All symbols are not made available for relocation processing by other modules. */
  39. #define RTLD_LOCAL (1 << 2)
  40. /* These two were added in The Open Group Base Specifications Issue 6.
  41. * Note: All other RTLD_* flags in any dlfcn.h are not standard compliant.
  42. */
  43. /* The symbol lookup happens in the normal global scope. */
  44. #define RTLD_DEFAULT ((void *)0)
  45. /* Specifies the next object after this one that defines name. */
  46. #define RTLD_NEXT ((void *)-1)
  47. /* Open a symbol table handle. */
  48. DLFCN_EXPORT void *dlopen(const char *file, int mode);
  49. /* Close a symbol table handle. */
  50. DLFCN_EXPORT int dlclose(void *handle);
  51. /* Get the address of a symbol from a symbol table handle. */
  52. DLFCN_EXPORT void *dlsym(void *handle, const char *name);
  53. /* Get diagnostic information. */
  54. DLFCN_EXPORT char *dlerror(void);
  55. #ifdef __cplusplus
  56. }
  57. #endif
  58. #endif /* DLFCN_H */