Skip to content

Commit

Permalink
add module name to ffi calls
Browse files Browse the repository at this point in the history
Signed-off-by: Luiz Irber <[email protected]>
  • Loading branch information
luizirber committed Sep 17, 2018
1 parent 9a6aa7f commit b899c10
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions include/hypercore.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
*/
typedef struct Feed_RandomAccessMemory Feed_RandomAccessMemory;

void free_feed(Feed_RandomAccessMemory *ptr);
void hypercore_feed_free(Feed_RandomAccessMemory *ptr);

Feed_RandomAccessMemory *new_feed(void);
Feed_RandomAccessMemory *hypercore_feed_new(void);

#endif /* HYPERCORE_BINDINGS_H */
4 changes: 2 additions & 2 deletions src/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use random_access_memory::RandomAccessMemory;
use {generate_keypair, Feed, Storage};

#[no_mangle]
pub extern "C" fn new_feed() -> *mut Feed<RandomAccessMemory> {
pub extern "C" fn hypercore_feed_new() -> *mut Feed<RandomAccessMemory> {
let keypair = generate_keypair();
let storage = Storage::new_memory().unwrap();
let feed = Feed::builder(keypair.public, storage)
Expand All @@ -14,7 +14,7 @@ pub extern "C" fn new_feed() -> *mut Feed<RandomAccessMemory> {
}

#[no_mangle]
pub extern "C" fn free_feed(ptr: *mut Feed<RandomAccessMemory>) {
pub extern "C" fn hypercore_feed_free(ptr: *mut Feed<RandomAccessMemory>) {
if ptr.is_null() {
return;
}
Expand Down

0 comments on commit b899c10

Please sign in to comment.