Skip to main content

FLDoc_SetAssociated

Function FLDoc_SetAssociated 

Source
pub unsafe extern "C" fn FLDoc_SetAssociated(
    doc: FLDoc,
    pointer: *mut c_void,
    type_: *const c_char,
) -> bool
Expand description

Associates an arbitrary pointer value with a document, and thus its contained values. Allows client code to associate its own pointer with this FLDoc and its Values, which can later be retrieved with \ref FLDoc_GetAssociated. For example, this could be a pointer to an app::Document object, of which this Doc’s root FLDict is its properties. You would store it by calling FLDoc_SetAssociated(doc, myDoc, "app::Document");. @param doc The FLDoc to store a pointer in. @param pointer The pointer to store in the FLDoc. @param type A C string literal identifying the type. This is used to avoid collisions with unrelated code that might try to store a different type of value. @return True if the pointer was stored, false if a pointer of a different type is already stored. @warning Be sure to clear this before the associated object is freed/invalidated! @warning This function is not thread-safe. Do not concurrently get & set objects.