dynlib.hpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* Declarations for dynamic library loading.
  2. This file is part of khipu.
  3. khipu is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU Lesser General Public License as published by
  5. the Free Software Foundation; either version 3 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public License
  12. along with this program. If not, see <https://www.gnu.org/licenses/>. */
  13. #ifndef __KP_DYNLIB__
  14. #define __KP_DYNLIB__ 1
  15. #include "defs.hpp"
  16. KP_DECLS_BEGIN
  17. enum
  18. {
  19. DYNLIB_LOCAL = 0x1,
  20. DYNLIB_APPEXT = 0x2
  21. };
  22. struct interpreter;
  23. KP_EXPORT void* dynlib_open (interpreter *interp,
  24. const char *path, uint32_t path_len, uint32_t flags);
  25. KP_EXPORT void* dynlib_open (interpreter *interp,
  26. const char *path, uint32_t flags);
  27. KP_EXPORT void* dynlib_sym (void *dynlib, const char *symbol);
  28. KP_EXPORT void dynlib_close (void *dynlib);
  29. KP_EXPORT const char* dynlib_extension ();
  30. KP_DECLS_END
  31. #endif