WIP
This commit is contained in:
@@ -18,7 +18,7 @@ lazy_static! {
|
||||
|
||||
// Initialize a new lightclient and store its value
|
||||
#[no_mangle]
|
||||
pub extern fn initialze(dangerous: bool, server: *const c_char) -> *mut c_char {
|
||||
pub extern fn litelib_initialze(dangerous: bool, server: *const c_char) -> *mut c_char {
|
||||
let server_str = unsafe {
|
||||
assert!(!server.is_null());
|
||||
|
||||
@@ -49,7 +49,7 @@ pub extern fn initialze(dangerous: bool, server: *const c_char) -> *mut c_char {
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern fn execute(cmd: *const c_char) -> *mut c_char {
|
||||
pub extern fn litelib_execute(cmd: *const c_char) -> *mut c_char {
|
||||
let cmd_str = unsafe {
|
||||
assert!(!cmd.is_null());
|
||||
|
||||
@@ -77,7 +77,7 @@ pub extern fn execute(cmd: *const c_char) -> *mut c_char {
|
||||
* back to rust, so it can be freed. Failure to call this function will result in a memory leak
|
||||
*/
|
||||
#[no_mangle]
|
||||
pub extern fn rust_free_string(s: *mut c_char) {
|
||||
pub extern fn litelib_rust_free_string(s: *mut c_char) {
|
||||
unsafe {
|
||||
if s.is_null() { return }
|
||||
CString::from_raw(s)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
#ifndef _ZEC_PAPER_RUST_H
|
||||
#define _ZEC_PAPER_RUST_H
|
||||
|
||||
@@ -6,9 +5,9 @@
|
||||
extern "C"{
|
||||
#endif
|
||||
|
||||
extern char * initialze (bool dangerous, const char* server);
|
||||
extern char * execute (char* s);
|
||||
extern void rust_free_string (char* s);
|
||||
extern char * litelib_initialze (bool dangerous, const char* server);
|
||||
extern char * litelib_execute (char* s);
|
||||
extern void litelib_rust_free_string (char* s);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user