dynamo-test.c 727 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* No Copyright. */
  2. /*
  3. * A simple test file for dynamic loading, dynamic name lookup, and
  4. * old-style external calls.
  5. */
  6. #include <stdio.h>
  7. #include "scheme48.h"
  8. /*
  9. * These should only be called on characters or other immediates.
  10. */
  11. s48_value
  12. s48_dynamo_test(s48_value arg0, s48_value arg1, s48_value arg2)
  13. {
  14. int i;
  15. s48_value vector = s48_make_vector(3, S48_FALSE);
  16. S48_VECTOR_SET(vector, 0, arg0);
  17. S48_VECTOR_SET(vector, 1, arg1);
  18. S48_VECTOR_SET(vector, 2, arg2);
  19. return vector;
  20. }
  21. s48_value
  22. s48_old_dynamo_test(long nargs, s48_value args[])
  23. {
  24. int i;
  25. s48_value vector = s48_make_vector(nargs, S48_FALSE);
  26. for (i = 0; i < nargs; i++)
  27. S48_VECTOR_SET(vector, i, args[i]);
  28. return vector;
  29. }