rename ffi func

This commit is contained in:
appflowy
2021-12-04 10:27:08 +08:00
parent e7cc11cc44
commit 76691e3e8c
6 changed files with 13 additions and 15 deletions

View File

@ -3,12 +3,11 @@
#include <stdint.h>
#include <stdlib.h>
int64_t init_sdk(char *path);
void async_command(int64_t port, const uint8_t *input, uintptr_t len);
void async_event(int64_t port, const uint8_t *input, uintptr_t len);
const uint8_t *sync_command(const uint8_t *input, uintptr_t len);
const uint8_t *sync_event(const uint8_t *input, uintptr_t len);
int32_t set_stream_port(int64_t port);

View File

@ -33,7 +33,7 @@ pub extern "C" fn init_sdk(path: *mut c_char) -> i64 {
}
#[no_mangle]
pub extern "C" fn async_command(port: i64, input: *const u8, len: usize) {
pub extern "C" fn async_event(port: i64, input: *const u8, len: usize) {
let request: ModuleRequest = FFIRequest::from_u8_pointer(input, len).into();
log::trace!(
"[FFI]: {} Async Event: {:?} with {} port",
@ -49,7 +49,7 @@ pub extern "C" fn async_command(port: i64, input: *const u8, len: usize) {
}
#[no_mangle]
pub extern "C" fn sync_command(input: *const u8, len: usize) -> *const u8 {
pub extern "C" fn sync_event(input: *const u8, len: usize) -> *const u8 {
let request: ModuleRequest = FFIRequest::from_u8_pointer(input, len).into();
log::trace!("[FFI]: {} Sync Event: {:?}", &request.id, &request.event,);
let _response = EventDispatch::sync_send(dispatch(), request);