ecs_os_api_t

Struct ecs_os_api_t 

Source
#[repr(C)]
pub struct ecs_os_api_t {
Show 40 fields pub init_: Option<unsafe extern "C" fn()>, pub fini_: Option<unsafe extern "C" fn()>, pub malloc_: Option<unsafe extern "C" fn(i32) -> *mut c_void>, pub realloc_: Option<unsafe extern "C" fn(*mut c_void, i32) -> *mut c_void>, pub calloc_: Option<unsafe extern "C" fn(i32) -> *mut c_void>, pub free_: Option<unsafe extern "C" fn(*mut c_void)>, pub strdup_: Option<unsafe extern "C" fn(*const i8) -> *mut i8>, pub thread_new_: Option<unsafe extern "C" fn(Option<unsafe extern "C" fn(*mut c_void) -> *mut c_void>, *mut c_void) -> usize>, pub thread_join_: Option<unsafe extern "C" fn(usize) -> *mut c_void>, pub thread_self_: Option<unsafe extern "C" fn() -> u64>, pub task_new_: Option<unsafe extern "C" fn(Option<unsafe extern "C" fn(*mut c_void) -> *mut c_void>, *mut c_void) -> usize>, pub task_join_: Option<unsafe extern "C" fn(usize) -> *mut c_void>, pub ainc_: Option<unsafe extern "C" fn(*mut i32) -> i32>, pub adec_: Option<unsafe extern "C" fn(*mut i32) -> i32>, pub lainc_: Option<unsafe extern "C" fn(*mut i64) -> i64>, pub ladec_: Option<unsafe extern "C" fn(*mut i64) -> i64>, pub mutex_new_: Option<unsafe extern "C" fn() -> usize>, pub mutex_free_: Option<unsafe extern "C" fn(usize)>, pub mutex_lock_: Option<unsafe extern "C" fn(usize)>, pub mutex_unlock_: Option<unsafe extern "C" fn(usize)>, pub cond_new_: Option<unsafe extern "C" fn() -> usize>, pub cond_free_: Option<unsafe extern "C" fn(usize)>, pub cond_signal_: Option<unsafe extern "C" fn(usize)>, pub cond_broadcast_: Option<unsafe extern "C" fn(usize)>, pub cond_wait_: Option<unsafe extern "C" fn(usize, usize)>, pub sleep_: Option<unsafe extern "C" fn(i32, i32)>, pub now_: Option<unsafe extern "C" fn() -> u64>, pub get_time_: Option<unsafe extern "C" fn(*mut ecs_time_t)>, pub log_: Option<unsafe extern "C" fn(i32, *const i8, i32, *const i8)>, pub abort_: Option<unsafe extern "C" fn()>, pub dlopen_: Option<unsafe extern "C" fn(*const i8) -> usize>, pub dlproc_: Option<unsafe extern "C" fn(usize, *const i8) -> Option<unsafe extern "C" fn()>>, pub dlclose_: Option<unsafe extern "C" fn(usize)>, pub module_to_dl_: Option<unsafe extern "C" fn(*const i8) -> *mut i8>, pub module_to_etc_: Option<unsafe extern "C" fn(*const i8) -> *mut i8>, pub log_level_: i32, pub log_indent_: i32, pub log_last_error_: i32, pub log_last_timestamp_: i64, pub flags_: u32,
}
Expand description

Prefix members of struct with ‘ecs_’ as some system headers may define macros for functions like “strdup”, “log” or “_free”

Fields§

§init_: Option<unsafe extern "C" fn()>

API init / deinit

§fini_: Option<unsafe extern "C" fn()>§malloc_: Option<unsafe extern "C" fn(i32) -> *mut c_void>

Memory management

§realloc_: Option<unsafe extern "C" fn(*mut c_void, i32) -> *mut c_void>§calloc_: Option<unsafe extern "C" fn(i32) -> *mut c_void>§free_: Option<unsafe extern "C" fn(*mut c_void)>§strdup_: Option<unsafe extern "C" fn(*const i8) -> *mut i8>

Strings

§thread_new_: Option<unsafe extern "C" fn(Option<unsafe extern "C" fn(*mut c_void) -> *mut c_void>, *mut c_void) -> usize>

Threads

§thread_join_: Option<unsafe extern "C" fn(usize) -> *mut c_void>§thread_self_: Option<unsafe extern "C" fn() -> u64>§task_new_: Option<unsafe extern "C" fn(Option<unsafe extern "C" fn(*mut c_void) -> *mut c_void>, *mut c_void) -> usize>

Tasks

§task_join_: Option<unsafe extern "C" fn(usize) -> *mut c_void>§ainc_: Option<unsafe extern "C" fn(*mut i32) -> i32>

Atomic incremenet / decrement

§adec_: Option<unsafe extern "C" fn(*mut i32) -> i32>§lainc_: Option<unsafe extern "C" fn(*mut i64) -> i64>§ladec_: Option<unsafe extern "C" fn(*mut i64) -> i64>§mutex_new_: Option<unsafe extern "C" fn() -> usize>

Mutex

§mutex_free_: Option<unsafe extern "C" fn(usize)>§mutex_lock_: Option<unsafe extern "C" fn(usize)>§mutex_unlock_: Option<unsafe extern "C" fn(usize)>§cond_new_: Option<unsafe extern "C" fn() -> usize>

Condition variable

§cond_free_: Option<unsafe extern "C" fn(usize)>§cond_signal_: Option<unsafe extern "C" fn(usize)>§cond_broadcast_: Option<unsafe extern "C" fn(usize)>§cond_wait_: Option<unsafe extern "C" fn(usize, usize)>§sleep_: Option<unsafe extern "C" fn(i32, i32)>

Time

§now_: Option<unsafe extern "C" fn() -> u64>§get_time_: Option<unsafe extern "C" fn(*mut ecs_time_t)>§log_: Option<unsafe extern "C" fn(i32, *const i8, i32, *const i8)>

Logging function. The level should be interpreted as: / / >0: Debug tracing. Only enabled in debug builds. / / 0: Tracing. Enabled in debug/release builds. / / -2: Warning. An issue occurred, but operation was successful. / / -3: Error. An issue occurred, and operation was unsuccessful. / / -4: Fatal. An issue occurred, and application must quit.

§abort_: Option<unsafe extern "C" fn()>

Application termination

§dlopen_: Option<unsafe extern "C" fn(*const i8) -> usize>

Dynamic library loading

§dlproc_: Option<unsafe extern "C" fn(usize, *const i8) -> Option<unsafe extern "C" fn()>>§dlclose_: Option<unsafe extern "C" fn(usize)>§module_to_dl_: Option<unsafe extern "C" fn(*const i8) -> *mut i8>

Overridable function that translates from a logical module id to a shared library filename

§module_to_etc_: Option<unsafe extern "C" fn(*const i8) -> *mut i8>

Overridable function that translates from a logical module id to a path that contains module-specif resources or assets

§log_level_: i32

Trace level

§log_indent_: i32

Trace indentation

§log_last_error_: i32

Last error code

§log_last_timestamp_: i64

Last recorded timestamp

§flags_: u32

OS API flags

Trait Implementations§

Source§

impl Clone for ecs_os_api_t

Source§

fn clone(&self) -> ecs_os_api_t

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ecs_os_api_t

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Copy for ecs_os_api_t

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Component for T
where T: 'static,