Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ctypes-test.c 537B

1234567891011121314151617181920212223
  1. #include <assert.h>
  2. #include <stdio.h>
  3. typedef void (*PythonSideFn)(int checker);
  4. __attribute__ ((visibility("default"))) void set_python_side_fn(PythonSideFn fn);
  5. __attribute__ ((visibility("default"))) void call_python_side_fn(void);
  6. PythonSideFn pyFn = NULL;
  7. void set_python_side_fn(PythonSideFn fn)
  8. {
  9. printf("set_python_side_fn(%p)\n", fn);
  10. pyFn = fn;
  11. }
  12. void call_python_side_fn(void)
  13. {
  14. assert(pyFn != NULL);
  15. printf("going to call python function now, ptr: %p\n", pyFn);
  16. pyFn(1337);
  17. printf("done!\n");
  18. }