Implement new features #6

Merged
n3tael merged 9 commits from bedohswe/labast:master into master 2024-06-20 20:39:40 +00:00
Showing only changes of commit e174f3a885 - Show all commits

View File

@ -41,8 +41,8 @@ pub fn native(stack: &mut Stack, arg: String) {
unsafe { unsafe {
let module = Library::new([libpref, arg, libsuf].join("")).unwrap(); let module = Library::new([libpref, arg, libsuf].join("")).unwrap();
// C libraries should use // C libraries should use
// int labashka(unsinged short (*pop)(), void (*push)(unsinged short), size_t (*len)(), size_t max_size ); // void (*labashka)(unsigned short (*pop)(void), void (*push)(unsigned short), size_t (*len)(void), size_t max_size);
let func: Symbol<unsafe extern "C" fn(extern fn() -> u16, extern fn(u16) -> i32, extern fn () -> usize, usize) -> u32> = module.get(b"labashka").unwrap(); let func: Symbol<unsafe extern "C" fn(extern fn() -> u16, extern fn(u16) -> i32, extern fn () -> usize, usize)> = module.get(b"labashka").unwrap();
func(stack_pop_callback,stack_push_callback,stack_len_callback, stack.memory.size()); func(stack_pop_callback,stack_push_callback,stack_len_callback, stack.memory.size());
} }
} }