ffi-test.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. /*
  2. * Part of Scheme 48 1.9. See file COPYING for notices and license.
  3. *
  4. * Authors: Harald Glab-Phlag, Marcus Crestani
  5. */
  6. #if !defined(FFI_TEST_H)
  7. #define FFI_TEST_H
  8. #include <stdlib.h>
  9. #include <string.h>
  10. #include "scheme48.h"
  11. /* structure definitions for internal use */
  12. typedef struct _strange_thing
  13. {
  14. int id;
  15. char* name;
  16. } strange_thing, *strange_thing_ref;
  17. /* external via .def exported functions */
  18. void s48_on_load(void);
  19. void s48_on_reload(void);
  20. void s48_on_unload(void);
  21. /* functions for testing the new ffi */
  22. s48_ref_t ffi_working_on_lists(s48_call_t call,
  23. s48_ref_t sch_a_list);
  24. s48_ref_t ffi_add_integer(s48_call_t call,
  25. s48_ref_t sch_integer);
  26. void ffi_priv_initialize(void);
  27. s48_ref_t ffi_pair_p(s48_call_t call,
  28. s48_ref_t sch_maybe_pair);
  29. s48_ref_t ffi_car(s48_call_t call, s48_ref_t sch_a_pair);
  30. s48_ref_t ffi_cdr(s48_call_t call, s48_ref_t sch_a_pair);
  31. s48_ref_t ffi_length(s48_call_t call, s48_ref_t sch_a_list);
  32. s48_ref_t ffi_record_set(s48_call_t call,
  33. s48_ref_t sch_record,
  34. s48_ref_t sch_index,
  35. s48_ref_t sch_value);
  36. s48_ref_t ffi_record_ref(s48_call_t call,
  37. s48_ref_t sch_record,
  38. s48_ref_t sch_index);
  39. s48_ref_t ffi_vector_set(s48_call_t call,
  40. s48_ref_t sch_vector,
  41. s48_ref_t sch_index,
  42. s48_ref_t sch_value);
  43. s48_ref_t ffi_vector_ref(s48_call_t call,
  44. s48_ref_t sch_vector,
  45. s48_ref_t sch_index);
  46. s48_ref_t ffi_make_vector(s48_call_t call,
  47. s48_ref_t sch_length,
  48. s48_ref_t sch_value);
  49. s48_ref_t ffi_make_byte_vector (s48_call_t call,
  50. s48_ref_t sch_length);
  51. s48_ref_t ffi_extract_byte_vector (s48_call_t call, s48_ref_t bv);
  52. s48_ref_t ffi_extract_and_modify_byte_vector (s48_call_t call, s48_ref_t bv);
  53. s48_ref_t ffi_extract_twice_and_modify_byte_vector (s48_call_t call, s48_ref_t bv);
  54. s48_ref_t ffi_extract_byte_vector_and_call_scheme (s48_call_t call, s48_ref_t bv, s48_ref_t callback);
  55. s48_ref_t ffi_make_a_record(s48_call_t call,
  56. s48_ref_t sch_id_string);
  57. s48_ref_t ffi_get_cons_val(s48_call_t call,
  58. s48_ref_t sch_first_value,
  59. s48_ref_t sch_second_value);
  60. s48_ref_t ffi_enums(s48_call_t call,
  61. s48_ref_t sch_enum);
  62. s48_ref_t ffi_get_color_enum_set( s48_call_t call,
  63. s48_ref_t sch_mask);
  64. s48_ref_t ffi_call_scheme(s48_call_t call, s48_ref_t sch_proc,
  65. s48_ref_t sch_nargs, s48_ref_t sch_parm_1,
  66. s48_ref_t sch_parm_2, s48_ref_t sch_parm_3);
  67. s48_ref_t ffi_make_strange_value (s48_call_t call, s48_ref_t sch_id,
  68. s48_ref_t sch_name);
  69. s48_ref_t ffi_strange_value_to_list (s48_call_t call,
  70. s48_ref_t sch_strange_val);
  71. s48_ref_t ffi_strange_value_free (s48_call_t call,
  72. s48_ref_t sch_strange_val);
  73. s48_ref_t ffi_propagate_binding(s48_call_t call,
  74. s48_ref_t sch_binding);
  75. s48_ref_t ffi_propagate_binding_global(s48_call_t call,
  76. s48_ref_t sch_binding);
  77. s48_ref_t ffi_a_status_set_and_export(s48_call_t call,
  78. s48_ref_t a_status_value);
  79. s48_ref_t ffi_a_status_set_by_binding (s48_call_t call,
  80. s48_ref_t sch_a_status_binding,
  81. s48_ref_t sch_a_value);
  82. s48_ref_t ffi_a_status_set (s48_call_t call, s48_ref_t sch_a_value);
  83. s48_ref_t ffi_a_status(s48_call_t call, s48_ref_t sch_a_status_binding);
  84. s48_ref_t ffi_export_bindings(s48_call_t call);
  85. s48_ref_t ffi_any_shared_binding_set(s48_call_t call,
  86. s48_ref_t sch_shared_binding_name,
  87. s48_ref_t sch_value);
  88. s48_ref_t ffi_any_shared_binding_ref(s48_call_t call,
  89. s48_ref_t sch_shared_binding_name);
  90. s48_ref_t ffi_check_a_status_and_get_name(s48_call_t call);
  91. s48_ref_t ffi_make_local_buf(s48_call_t call);
  92. s48_ref_t ffi_free_local_buf(s48_call_t call);
  93. s48_ref_t ffi_free_local_buf1(s48_call_t call);
  94. s48_ref_t ffi_free_local_buf2(s48_call_t call);
  95. s48_ref_t ffi_free_local_buf3(s48_call_t call);
  96. s48_ref_t ffi_make_weak_pointer(s48_call_t call, s48_ref_t value);
  97. s48_ref_t ffi_weak_pointer_p(s48_call_t call, s48_ref_t sch_pointer);
  98. s48_ref_t ffi_weak_pointer_ref(s48_call_t call, s48_ref_t sch_pointer);
  99. s48_ref_t ffi_check_string_latin_1 (s48_call_t call, s48_ref_t sch_string);
  100. s48_ref_t ffi_check_string_utf_8 (s48_call_t call, s48_ref_t sch_string);
  101. s48_ref_t ffi_check_string_utf_16 (s48_call_t call, s48_ref_t sch_string);
  102. char* ffi_string_to_latin_1(s48_call_t call, s48_ref_t sch_in);
  103. #endif