File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 29
29
use std:: ffi:: { CStr , CString } ;
30
30
31
31
pub use kclvm_api:: gpyrpc:: * ;
32
- use kclvm_api:: service:: capi:: { kclvm_service_call , kclvm_service_new} ;
32
+ use kclvm_api:: service:: capi:: { kclvm_service_call_with_length , kclvm_service_new} ;
33
33
use kclvm_api:: service:: service_impl:: KclvmServiceImpl ;
34
34
35
35
use anyhow:: Result ;
@@ -41,7 +41,8 @@ pub fn call<'a>(name: &'a [u8], args: &'a [u8]) -> Result<&'a [u8]> {
41
41
let args = CString :: new ( args) ?;
42
42
let call = CString :: new ( name) ?;
43
43
let serv = kclvm_service_new ( 0 ) ;
44
- kclvm_service_call ( serv, call. as_ptr ( ) , args. as_ptr ( ) )
44
+ let mut result_len: usize = 0 ;
45
+ kclvm_service_call_with_length ( serv, call. as_ptr ( ) , args. as_ptr ( ) , & mut result_len)
45
46
} ;
46
47
let result = unsafe { CStr :: from_ptr ( result_ptr) } ;
47
48
Ok ( result. to_bytes ( ) )
You can’t perform that action at this time.
0 commit comments