vm-builtins.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* Copyright (C) 2013 Free Software Foundation, Inc.
  2. *
  3. * This library is free software; you can redistribute it and/or
  4. * modify it under the terms of the GNU Lesser General Public License
  5. * as published by the Free Software Foundation; either version 3 of
  6. * the License, or (at your option) any later version.
  7. *
  8. * This library is distributed in the hope that it will be useful, but
  9. * WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. * Lesser General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU Lesser General Public
  14. * License along with this library; if not, write to the Free Software
  15. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  16. * 02110-1301 USA
  17. */
  18. #ifndef _SCM_VM_BUILTINS_H_
  19. #define _SCM_VM_BUILTINS_H_
  20. #ifdef BUILDING_LIBGUILE
  21. #define FOR_EACH_VM_BUILTIN(M) \
  22. M(apply, APPLY, 2, 0, 1) \
  23. M(values, VALUES, 0, 0, 1) \
  24. M(abort_to_prompt, ABORT_TO_PROMPT, 1, 0, 1) \
  25. M(call_with_values, CALL_WITH_VALUES, 2, 0, 0) \
  26. M(call_with_current_continuation, CALL_WITH_CURRENT_CONTINUATION, 1, 0, 0)
  27. /* These enumerated values are embedded in VM code, and as such are
  28. part of Guile's ABI. */
  29. enum scm_vm_builtins
  30. {
  31. #define ENUM(builtin, BUILTIN, req, opt, rest) SCM_VM_BUILTIN_##BUILTIN,
  32. FOR_EACH_VM_BUILTIN(ENUM)
  33. #undef ENUM
  34. SCM_VM_BUILTIN_COUNT
  35. };
  36. SCM_INTERNAL SCM scm_vm_builtin_name_to_index (SCM name);
  37. SCM_INTERNAL SCM scm_vm_builtin_index_to_name (SCM idx);
  38. SCM_INTERNAL void scm_init_vm_builtin_properties (void);
  39. #endif /* BUILDING_LIBGUILE */
  40. #endif /* _SCM_VM_BUILTINS_H_ */