bink/lib.rs
1//! C API for bladeink.
2
3use std::{ffi::CString, os::raw::c_char};
4
5pub mod cchoices;
6pub mod cstory;
7pub mod ctags;
8
9const BINK_OK: u32 = 0;
10const BINK_FAIL: u32 = 1;
11const BINK_FAIL_NULL_POINTER: u32 = 2;
12
13#[allow(clippy::not_unsafe_ptr_arg_deref)]
14#[no_mangle]
15pub extern "C" fn bink_cstring_free(cstring: *mut c_char) {
16 unsafe {
17 if !cstring.is_null() {
18 drop(CString::from_raw(cstring));
19 }
20 }
21}