Adds species_drop FFI method.

This commit is contained in:
Deukhoofd 2022-09-22 17:33:45 +02:00
parent 1070753be7
commit 78fde698ca
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 6 additions and 0 deletions

View File

@ -3,6 +3,7 @@ use crate::static_data::{Form, Species};
use crate::StringKey; use crate::StringKey;
use hashbrown::HashSet; use hashbrown::HashSet;
use std::ffi::{c_char, CStr}; use std::ffi::{c_char, CStr};
use std::ptr::drop_in_place;
use std::sync::Arc; use std::sync::Arc;
#[no_mangle] #[no_mangle]
@ -35,6 +36,11 @@ unsafe extern "C" fn species_new(
))) )))
} }
#[no_mangle]
unsafe extern "C" fn species_drop(ptr: OwnedPtr<Species>) {
drop_in_place(ptr);
}
ffi_getter!(Species, id, u16); ffi_getter!(Species, id, u16);
ffi_stringkey_getter!(Species, name); ffi_stringkey_getter!(Species, name);
ffi_getter!(Species, gender_rate, f32); ffi_getter!(Species, gender_rate, f32);