loader.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* Copyright 2001,2009-2015,2018,2020,2021
  2. Free Software Foundation, Inc.
  3. This file is part of Guile.
  4. Guile is free software: you can redistribute it and/or modify it
  5. under the terms of the GNU Lesser General Public License as published
  6. by the Free Software Foundation, either version 3 of the License, or
  7. (at your option) any later version.
  8. Guile is distributed in the hope that it will be useful, but WITHOUT
  9. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10. FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
  11. License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with Guile. If not, see
  14. <https://www.gnu.org/licenses/>. */
  15. #ifndef _SCM_LOADER_H_
  16. #define _SCM_LOADER_H_
  17. #include <libguile/scm.h>
  18. #ifdef BUILDING_LIBGUILE
  19. /* The endianness marker in objcode. */
  20. #ifdef WORDS_BIGENDIAN
  21. # define SCM_OBJCODE_ENDIANNESS "BE"
  22. #else
  23. # define SCM_OBJCODE_ENDIANNESS "LE"
  24. #endif
  25. #define _SCM_CPP_STRINGIFY(x) # x
  26. #define SCM_CPP_STRINGIFY(x) _SCM_CPP_STRINGIFY (x)
  27. /* The word size marker in objcode. */
  28. #define SCM_OBJCODE_WORD_SIZE SCM_CPP_STRINGIFY (SIZEOF_VOID_P)
  29. /* Major and minor versions must be single characters. */
  30. #define SCM_OBJCODE_MAJOR_VERSION 4
  31. #define SCM_OBJCODE_MINIMUM_MINOR_VERSION 2
  32. #define SCM_OBJCODE_MINOR_VERSION 6
  33. #define SCM_OBJCODE_MAJOR_VERSION_STRING \
  34. SCM_CPP_STRINGIFY(SCM_OBJCODE_MAJOR_VERSION)
  35. #define SCM_OBJCODE_MINOR_VERSION_STRING \
  36. SCM_CPP_STRINGIFY(SCM_OBJCODE_MINOR_VERSION)
  37. #define SCM_OBJCODE_VERSION_STRING \
  38. SCM_OBJCODE_MAJOR_VERSION_STRING "." SCM_OBJCODE_MINOR_VERSION_STRING
  39. #define SCM_OBJCODE_MACHINE_VERSION_STRING \
  40. SCM_OBJCODE_ENDIANNESS "-" SCM_OBJCODE_WORD_SIZE "-" SCM_OBJCODE_VERSION_STRING
  41. #endif
  42. SCM_API SCM scm_load_thunk_from_file (SCM filename);
  43. SCM_API SCM scm_load_thunk_from_memory (SCM bv);
  44. SCM_INTERNAL const uint8_t *
  45. scm_find_slot_map_unlocked (const uint32_t *ip);
  46. SCM_INTERNAL void scm_bootstrap_loader (void);
  47. SCM_INTERNAL void scm_init_loader (void);
  48. #endif /* _SCM_LOADER_H_ */