feat: add cbindgen to livekit-ffi (#57)
This commit is contained in:
@@ -0,0 +1,4 @@
|
|||||||
|
language = "C"
|
||||||
|
include_guard = "livekit_ffi"
|
||||||
|
autogen_warning = "/* Warning, this file is autogenerated. Don't modify this manually. */"
|
||||||
|
usize_is_size_t = true
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
#ifndef livekit_ffi
|
||||||
|
#define livekit_ffi
|
||||||
|
|
||||||
|
/* Warning, this file is autogenerated. Don't modify this manually. */
|
||||||
|
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
typedef size_t FfiHandleId;
|
||||||
|
|
||||||
|
#define INVALID_HANDLE 0
|
||||||
|
|
||||||
|
FfiHandleId livekit_ffi_request(const uint8_t *data,
|
||||||
|
size_t len,
|
||||||
|
const uint8_t **res_ptr,
|
||||||
|
size_t *res_len);
|
||||||
|
|
||||||
|
bool livekit_ffi_drop_handle(FfiHandleId handle_id);
|
||||||
|
|
||||||
|
#endif /* livekit_ffi */
|
||||||
@@ -31,7 +31,7 @@ pub type FfiHandle = Box<dyn Any + Send + Sync>;
|
|||||||
pub const INVALID_HANDLE: FfiHandleId = 0;
|
pub const INVALID_HANDLE: FfiHandleId = 0;
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub(crate) extern "C" fn livekit_ffi_request(
|
pub extern "C" fn livekit_ffi_request(
|
||||||
data: *const u8,
|
data: *const u8,
|
||||||
len: usize,
|
len: usize,
|
||||||
res_ptr: *mut *const u8,
|
res_ptr: *mut *const u8,
|
||||||
@@ -69,7 +69,7 @@ pub(crate) extern "C" fn livekit_ffi_request(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub(crate) extern "C" fn livekit_ffi_drop_handle(handle_id: FfiHandleId) -> bool {
|
pub extern "C" fn livekit_ffi_drop_handle(handle_id: FfiHandleId) -> bool {
|
||||||
// Free the memory
|
// Free the memory
|
||||||
server::FFI_SERVER
|
server::FFI_SERVER
|
||||||
.ffi_handles()
|
.ffi_handles()
|
||||||
|
|||||||
Reference in New Issue
Block a user