scheme48vm.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /*
  2. * Part of Scheme 48 1.9. See file COPYING for notices and license.
  3. *
  4. * Authors: Richard Kelsey, Jonathan Rees, Mike Sperber, Marcus Crestani
  5. */
  6. /*
  7. * Externally visible objects defined in scheme48vm.c.
  8. */
  9. #include "scheme48.h"
  10. #include "c-mods.h"
  11. /* initializing */
  12. extern void s48_init(void);
  13. extern long s48_initialize(int *argc, char ***argv);
  14. extern void s48_initialize_vm(char *, long);
  15. /* running */
  16. extern long s48_call_startup_procedure(char **, long);
  17. extern s48_value s48_restart(s48_value proc, long nargs);
  18. extern s48_value s48_Scallback_return_stack_blockS;
  19. /* for extension.c */
  20. extern void s48_set_extension_valueB(s48_value);
  21. extern s48_value s48_Sextension_valueS;
  22. /* interrupts */
  23. extern void s48_note_event(void);
  24. extern psbool s48_Spending_eventsPS;
  25. extern char * s48_Sstack_limitS;
  26. extern void s48_disable_interruptsB(void);
  27. extern void s48_enable_interruptsB(void);
  28. extern void s48_set_os_signals(s48_value list);
  29. extern void s48_reset_interruptsB();
  30. extern char s48_os_signal_pending(void);
  31. extern void s48_note_external_eventBUunsafe(long);
  32. extern char s48_external_event_readyPUunsafe(void);
  33. extern char s48_external_event_pendingPUunsafe(void);
  34. extern long s48_dequeue_external_eventBUunsafe(char*);
  35. /* imported and exported bindings */
  36. S48_EXTERN s48_value s48_define_exported_binding(char *, s48_value);
  37. S48_EXTERN s48_value s48_get_imported_binding(char *);
  38. /* for raising exceptions in external code */
  39. extern void s48_setup_external_exception(s48_value exception,
  40. long nargs);
  41. extern s48_value s48_resetup_external_exception(s48_value exception,
  42. long additional_nargs);
  43. extern void s48_argument_type_violation(s48_value value);
  44. extern void s48_range_violation(s48_value value, s48_value min, s48_value max);
  45. extern void s48_push(s48_value value);
  46. extern s48_value s48_stack_ref(long offset);
  47. extern void s48_stack_setB(long offset, s48_value value);
  48. /* strings */
  49. S48_EXTERN s48_value s48_allocate_string(long l);
  50. extern s48_value s48_enter_string_utf_16beU(char *);
  51. extern s48_value s48_enter_string_utf_16be_nU(char *, long);
  52. extern long s48_copy_string_to_utf_16beU(s48_value, char *);
  53. extern long s48_copy_string_to_utf_16be_nU(s48_value, long, long, char *);
  54. extern s48_value s48_enter_string_utf_16leU(char *);
  55. extern s48_value s48_enter_string_utf_16le_nU(char *, long);
  56. extern long s48_copy_string_to_utf_16leU(s48_value, char *);
  57. extern long s48_copy_string_to_utf_16le_nU(s48_value, long, long, char *);
  58. /* called when writing an image */
  59. extern s48_value s48_symbol_table(void);
  60. extern s48_value *s48_channels(void);
  61. extern long s48_channel_count(void);
  62. extern s48_value s48_imported_bindings(void);
  63. extern s48_value s48_exported_bindings(void);
  64. /* for initializion on SMP machines */
  65. extern void s48_initialize_shared_registersB(long, long, long, long);
  66. /* manipulating channels */
  67. S48_EXTERN void s48_close_channel(long);
  68. S48_EXTERN s48_value s48_set_channel_os_index(s48_value, long);
  69. extern s48_value s48_really_add_channel(s48_value, s48_value, long);
  70. /* external allocation and GC roots */
  71. extern void s48_gc_root(void);
  72. extern long s48_gc_run_time(long *);
  73. extern s48_value s48_allocate_stob(long type, long size);
  74. extern s48_value s48_allocate_weak_stob(long type, long size);
  75. extern s48_value s48_allocate_unmovable_stob(long type, long size);
  76. extern psbool s48_unmovableP(s48_value);
  77. extern psbool s48_gc_can_allocate_unmovableP(void);
  78. S48_EXTERN void s48_push_gc_rootsB(char *, long);
  79. S48_EXTERN psbool s48_pop_gc_rootsB(void);
  80. extern char * s48_set_gc_roots_baseB(void);
  81. extern psbool s48_release_gc_roots_baseB(char *);
  82. S48_EXTERN char * s48_register_gc_rootB(char *);
  83. S48_EXTERN void s48_unregister_gc_rootB(char *);
  84. extern void s48_reset_external_rootsB(void);
  85. extern void s48_post_gc_cleanup(psbool, psbool);
  86. extern void s48_trace_external_calls(void);
  87. /* for native code */
  88. extern void s48_copy_stack_into_heap();
  89. /* variables for native code (the names need to be fixed) */
  90. extern s48_value StemplateS;
  91. extern char * Scode_pointerS;
  92. extern char * ScontS;
  93. extern char * SstackS;
  94. extern s48_value SenvS;
  95. extern s48_value SvalS;
  96. extern long s48_Snative_protocolS;