stumpless_load_element

Function stumpless_load_element 

Source
pub unsafe extern "C" fn stumpless_load_element(
    element: *mut stumpless_element,
    name: *const c_char,
) -> *mut stumpless_element
Expand description

Loads a provided element with the given name.

Does not call any memory allocation routines, and is faster than stumpless_new_element as a result.

An element loaded using this function must be unloaded with stumpless_unload_element when it is no longer needed. Calling stumpless_destroy_element or any function that does (such as stumpless_destroy_entry_and_contents will result in memory corruption).

Thread Safety: MT-Safe race:element race:name This function is thread safe, assuming that the element and name are not changed by other threads during execution.

Async Signal Safety: AS-Unsafe lock This function is not safe to call from signal handlers due to the use of a mutex initialization routine. If STUMPLESS_THREAD_SAFETY_SUPPORTED is not defined, then this function is AS-Safe.

Async Cancel Safety: AC-Unsafe lock This function is not safe to call from threads that may be asynchronously cancelled, due to the use of a mutex initialization routine. If STUMPLESS_THREAD_SAFETY_SUPPORTED is not defined, then this function is AC-Safe.

@since release v2.2.0

@param element The struct to load.

@param name The name of the element.

@return A pointer to the loaded element, if no error is encountered. If an error is encountered, then NULL is returned and an error code is set appropriately.