ocamlmatrix_old.c 409 B

12345678910111213141516171819202122232425262728
  1. #include "ruby.h"
  2. #include "caml/callback.h"
  3. void initcaml(void) {
  4. char *dummy_argv[] = {0};
  5. caml_startup(dummy_argv);
  6. }
  7. VALUE OcamlMatrix = Qnil; // set up the Ruby namespace
  8. void Init_ocamlmatrix();
  9. int interm_matrix_mul(*a, *b) {
  10. static value *f = NULL;
  11. f = caml_named_value("ocaml_matrix_mul");
  12. if (f == NULL)
  13. return -1;
  14. value r_caml;
  15. r_caml = callback(*f, a, b);
  16. }