vm-builtins.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* Copyright 2013,2018
  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_VM_BUILTINS_H_
  16. #define _SCM_VM_BUILTINS_H_
  17. #ifdef BUILDING_LIBGUILE
  18. #define FOR_EACH_VM_BUILTIN(M) \
  19. M(apply, APPLY, 2, 0, 1) \
  20. M(values, VALUES, 0, 0, 1) \
  21. M(abort_to_prompt, ABORT_TO_PROMPT, 1, 0, 1) \
  22. M(call_with_values, CALL_WITH_VALUES, 2, 0, 0) \
  23. M(call_with_current_continuation, CALL_WITH_CURRENT_CONTINUATION, 1, 0, 0)
  24. /* These enumerated values are embedded in VM code, and as such are
  25. part of Guile's ABI. */
  26. enum scm_vm_builtins
  27. {
  28. #define ENUM(builtin, BUILTIN, req, opt, rest) SCM_VM_BUILTIN_##BUILTIN,
  29. FOR_EACH_VM_BUILTIN(ENUM)
  30. #undef ENUM
  31. SCM_VM_BUILTIN_COUNT
  32. };
  33. SCM_INTERNAL SCM scm_vm_builtin_ref (unsigned idx);
  34. SCM_INTERNAL SCM scm_vm_builtin_name_to_index (SCM name);
  35. SCM_INTERNAL SCM scm_vm_builtin_index_to_name (SCM idx);
  36. SCM_INTERNAL void scm_init_vm_builtin_properties (void);
  37. #endif /* BUILDING_LIBGUILE */
  38. #endif /* _SCM_VM_BUILTINS_H_ */