Type Definition physfs_sys::PHYSFS_StringCallback[][src]

pub type PHYSFS_StringCallback = Option<unsafe extern "C" fn(data: *mut c_void, str: *const c_char)>;
Expand description

\typedef PHYSFS_StringCallback \brief Function signature for callbacks that report strings.

These are used to report a list of strings to an original caller, one string per callback. All strings are UTF-8 encoded. Functions should not try to modify or free the string’s memory.

These callbacks are used, starting in PhysicsFS 1.1, as an alternative to functions that would return lists that need to be cleaned up with PHYSFS_freeList(). The callback means that the library doesn’t need to allocate an entire list and all the strings up front.

Be aware that promises data ordering in the list versions are not necessarily so in the callback versions. Check the documentation on specific APIs, but strings may not be sorted as you expect.

\param data User-defined data pointer, passed through from the API that eventually called the callback. \param str The string data about which the callback is meant to inform.

\sa PHYSFS_getCdRomDirsCallback \sa PHYSFS_getSearchPathCallback