util.c 413 B

12345678910111213141516171819
  1. #include "util.h"
  2. #include <gdnative/gdnative.h>
  3. #include <stdlib.h>
  4. // Helper functions for accessing C arrays.
  5. godot_gdnative_api_struct *cgo_get_ext(godot_gdnative_api_struct **ext, int i) {
  6. return ext[i];
  7. }
  8. void **go_void_build_array(int length) {
  9. void **arr = malloc(sizeof(void *) * length);
  10. return arr;
  11. }
  12. void go_void_add_element(void **array, void *element, int index) {
  13. array[index] = element;
  14. }