scheme48vm-prelude.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. #include <stdlib.h>
  7. #include <stdio.h>
  8. #include <string.h> /* memcpy, strlen */
  9. #include "c-mods.h"
  10. #include "scheme48write-barrier.h"
  11. /*
  12. * This is to tell the C compiler that the result may be negative even
  13. * though the operands are unsigned. It is still dubious: A cast from
  14. * an unsigned to an int that involves an overflow pretty much has
  15. * undefined result - the C standard does not give us two's complement
  16. * arithmetic.
  17. */
  18. #define SMALL_MULTIPLY(x,y) ((long)((unsigned long)(x) * (unsigned long)(y)))
  19. #define NO_ERRORS 0 /* extension to errno.h */
  20. #include "scheme48vm.h"
  21. #include "scheme48heap.h"
  22. #include "scheme48image.h"
  23. #include "bignum.h"
  24. #include "event.h"
  25. #include "fd-io.h"
  26. extern s48_value s48_extended_vm(long, s48_value),
  27. s48_lookup_external_name(char *, char *),
  28. s48_external_call(s48_value proc,
  29. s48_value proc_name,
  30. long nargs,
  31. char *argv),
  32. s48_external_call_2(s48_value proc,
  33. s48_value proc_name,
  34. long nargs,
  35. char *argv);
  36. /*
  37. * This comes from glue.{s,c}.
  38. */
  39. extern long s48_call_native_procedure(long, long),
  40. s48_invoke_native_continuation(long, long),
  41. s48_jump_to_native_address(long, long);
  42. #define GET_PROPOSAL_LOCK() ((void)0)
  43. #define RELEASE_PROPOSAL_LOCK() ((void)0)
  44. #define SHARED_REF(x) (x)
  45. #define SHARED_SETB(x, v) ((x) = (v))
  46. extern void s48_raise_argument_type_error(s48_value);
  47. extern void s48_raise_range_error(s48_value, s48_value, s48_value);
  48. char *s48_get_os_string_encoding(void);
  49. /*
  50. * We rename these to avoid name clashes.
  51. */
  52. #define TTreturn_value s48_return_value
  53. #define TTrun_machine(x) s48_run_machine(x)