spir_ffi.h 635 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef __SPIR_FFI_H__
  2. #define __SPIR_FFI_H__
  3. #include <stdint.h>
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. typedef struct {
  8. const char *data;
  9. size_t len;
  10. size_t capacity;
  11. } VecData;
  12. typedef struct {
  13. void *client;
  14. VecData pub_params;
  15. } ClientNewRet;
  16. extern void spir_init(uint32_t num_threads);
  17. extern ClientNewRet spir_client_new(uint8_t r);
  18. extern void spir_client_free(void *client);
  19. extern void* spir_server_new(uint8_t r, const char *pub_params,
  20. size_t pub_params_len);
  21. extern void spir_server_free(void *server);
  22. extern void spir_vecdata_free(VecData vecdata);
  23. #ifdef __cplusplus
  24. }
  25. #endif
  26. #endif