sdl3-bindgen-sys
Safe HaskellNone
LanguageGHC2021

SDL3.Sys.Bindgen.Loadso.FunPtr

Synopsis

Documentation

sDL_LoadObject :: FunPtr (PtrConst CChar -> IO (Ptr SDL_SharedObject)) Source #

Dynamically load a shared object.

sofile
a system-dependent name of the object file.
Returns
an opaque pointer to the object handle or NULL on failure; call SDL_GetError() for more information.
Thread safety
It is safe to call this function from any thread.
See also
sDL_LoadFunction, sDL_UnloadObject
C declaration
SDL_LoadObject, defined at SDL3/SDL_loadso.h 93:48

Since: 3.2.0

sDL_LoadFunction :: FunPtr (Ptr SDL_SharedObject -> PtrConst CChar -> IO SDL_FunctionPointer) Source #

Look up the address of the named function in a shared object.

This function pointer is no longer valid after calling SDL_UnloadObject().

This function can only look up C function names. Other languages may have name mangling and intrinsic language support that varies from compiler to compiler.

Make sure you declare your function pointers with the same calling convention as the actual library function. Your code will crash mysteriously if you do not do this.

If the requested function doesn't exist, NULL is returned.

handle
a valid shared object handle returned by SDL_LoadObject().
name
the name of the function to look up.
Returns
a pointer to the function or NULL on failure; call SDL_GetError() for more information.
Thread safety
It is safe to call this function from any thread.
See also
sDL_LoadObject
C declaration
SDL_LoadFunction, defined at SDL3/SDL_loadso.h 121:49

Since: 3.2.0

sDL_UnloadObject :: FunPtr (Ptr SDL_SharedObject -> IO ()) Source #

Unload a shared object from memory.

Note that any pointers from this object looked up through SDL_LoadFunction() will no longer be valid.

handle
a valid shared object handle returned by SDL_LoadObject().
Thread safety
It is safe to call this function from any thread.
See also
sDL_LoadObject
C declaration
SDL_UnloadObject, defined at SDL3/SDL_loadso.h 137:34

Since: 3.2.0