scheme48vm-prelude.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include <string.h> /* memcpy, strlen */
  4. #include "c-mods.h"
  5. #include "scheme48write-barrier.h"
  6. #define SMALL_MULTIPLY(x,y) ((x) * (y))
  7. #define NO_ERRORS 0 /* extension to errno.h */
  8. #include "scheme48vm.h"
  9. #include "scheme48heap.h"
  10. #include "scheme48image.h"
  11. #include "bignum.h"
  12. #include "event.h"
  13. #include "fd-io.h"
  14. extern s48_value s48_extended_vm(long, s48_value),
  15. s48_lookup_external_name(char *, char *),
  16. s48_external_call(s48_value proc,
  17. s48_value proc_name,
  18. long nargs,
  19. char *argv);
  20. /*
  21. * This comes from glue.{s,c}.
  22. */
  23. extern long s48_call_native_procedure(long, long),
  24. s48_invoke_native_continuation(long);
  25. /*
  26. * The following are hand-written macro versions of procedures
  27. * in scheme48heap.c.
  28. */
  29. #define AVAILABLEp(cells) (s48_ShpS + ((cells)<<2) < s48_SlimitS)
  30. static char *_HHallocate_temp;
  31. #define ALLOCATE_SPACE(type, len) \
  32. (_HHallocate_temp = s48_ShpS, \
  33. s48_ShpS += ((len)+3) & ~3, \
  34. _HHallocate_temp)
  35. #define GET_PROPOSAL_LOCK() ((void)0)
  36. #define RELEASE_PROPOSAL_LOCK() ((void)0)
  37. #define SHARED_REF(x) (x)
  38. #define SHARED_SETB(x, v) ((x) = (v))
  39. /*
  40. * We rename these to avoid name clashes.
  41. */
  42. #define TTreturn_value s48_return_value
  43. #define TTrun_machine(x) s48_run_machine(x)