Skip to main content

apr_pool_userdata_set

Function apr_pool_userdata_set 

Source
pub unsafe extern "C" fn apr_pool_userdata_set(
    data: *const c_void,
    key: *const c_char,
    cleanup: Option<unsafe extern "C" fn(arg1: *mut c_void) -> apr_status_t>,
    pool: *mut apr_pool_t,
) -> apr_status_t
Expand description

Set the data associated with the current pool @param data The user data associated with the pool. @param key The key to use for association @param cleanup The cleanup program to use to cleanup the data (NULL if none) @param pool The current pool @warning The data to be attached to the pool should have a life span at least as long as the pool it is being attached to.

 Users of APR must take EXTREME care when choosing a key to
 use for their data.  It is possible to accidentally overwrite
 data by choosing a key that another part of the program is using.
 Therefore it is advised that steps are taken to ensure that unique
 keys are used for all of the userdata objects in a particular pool
 (the same key in two different pools or a pool and one of its
 subpools is okay) at all times.  Careful namespace prefixing of
 key names is a typical way to help ensure this uniqueness.