| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
SDL3.Sys.Bindgen.Assert.Unsafe
Synopsis
- sDL_ReportAssertion :: Ptr SDL_AssertData -> PtrConst CChar -> PtrConst CChar -> CInt -> IO SDL_AssertState
- sDL_SetAssertionHandler :: SDL_AssertionHandler -> Ptr Void -> IO ()
- sDL_GetDefaultAssertionHandler :: IO SDL_AssertionHandler
- sDL_GetAssertionHandler :: Ptr (Ptr Void) -> IO SDL_AssertionHandler
- sDL_GetAssertionReport :: IO (PtrConst SDL_AssertData)
- sDL_ResetAssertionReport :: IO ()
Documentation
Arguments
| :: Ptr SDL_AssertData |
|
| -> PtrConst CChar |
|
| -> PtrConst CChar |
|
| -> CInt |
|
| -> IO SDL_AssertState |
Never call this directly.
Use the SDL_assert macros instead.
- Returns
- assert state.
- Thread safety
- It is safe to call this function from any thread.
- C declaration
SDL_ReportAssertion, defined atSDL3/SDL_assert.h 363:45
Since: 3.2.0
sDL_SetAssertionHandler Source #
Arguments
| :: SDL_AssertionHandler |
|
| -> Ptr Void |
|
| -> IO () |
Set an application-defined assertion handler.
This function allows an application to show its own assertion UI and/or force the response to an assertion failure. If the application doesn't provide this, SDL will try to do the right thing, popping up a system-specific GUI dialog, and probably minimizing any fullscreen windows.
This callback may fire from any thread, but it runs wrapped in a mutex, so it will only fire from one thread at a time.
This callback is NOT reset to SDL's internal handler upon SDL_Quit()!
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetAssertionHandler- C declaration
SDL_SetAssertionHandler, defined atSDL3/SDL_assert.h 604:34
Since: 3.2.0
sDL_GetDefaultAssertionHandler :: IO SDL_AssertionHandler Source #
Get the default assertion handler.
This returns the function pointer that is called by default when an assertion is triggered. This is an internal function provided by SDL, that is used for assertions when SDL_SetAssertionHandler() hasn't been used to provide a different function.
- Returns
- the default
SDL_AssertionHandlerthat is called when an assert triggers. - Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetAssertionHandler- C declaration
SDL_GetDefaultAssertionHandler, defined atSDL3/SDL_assert.h 625:50
Since: 3.2.0
sDL_GetAssertionHandler Source #
Arguments
| :: Ptr (Ptr Void) |
|
| -> IO SDL_AssertionHandler |
Get the current assertion handler.
This returns the function pointer that is called when an assertion is triggered. This is either the value last passed to SDL_SetAssertionHandler(), or if no application-specified function is set, is equivalent to calling SDL_GetDefaultAssertionHandler().
The parameter puserdata is a pointer to a void*, which will store the "userdata" pointer that was passed to SDL_SetAssertionHandler(). This value will always be NULL for the default handler. If you don't care about this data, it is safe to pass a NULL pointer to this function to ignore it.
- Returns
- the
SDL_AssertionHandlerthat is called when an assert triggers. - Thread safety
- It is safe to call this function from any thread.
- See also
sDL_SetAssertionHandler- C declaration
SDL_GetAssertionHandler, defined atSDL3/SDL_assert.h 650:50
Since: 3.2.0
sDL_GetAssertionReport :: IO (PtrConst SDL_AssertData) Source #
Get a list of all assertion failures.
This function gets all assertions triggered since the last call to SDL_ResetAssertionReport(), or the start of the program.
The proper way to examine this data looks something like this:
const SDL_AssertData *item = SDL_GetAssertionReport();
while (item) {
printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\\n",
item->condition, item->function, item->filename,
item->linenum, item->trigger_count,
item->always_ignore ? "yes" : "no");
item = item->next;
}
- Returns
- a list of all failed assertions or NULL if the list is empty. This memory should not be modified or freed by the application. This pointer remains valid until the next call to SDL_Quit() or
SDL_ResetAssertionReport(). - Thread safety
- This function is not thread safe. Other threads calling
SDL_ResetAssertionReport()simultaneously, may render the returned pointer invalid. - See also
sDL_ResetAssertionReport- C declaration
SDL_GetAssertionReport, defined atSDL3/SDL_assert.h 684:52
Since: 3.2.0
sDL_ResetAssertionReport :: IO () Source #
Clear the list of all assertion failures.
This function will clear the list of all assertions triggered up to that point. Immediately following this call, SDL_GetAssertionReport will return no items. In addition, any previously-triggered assertions will be reset to a trigger_count of zero, and their always_ignore state will be false.
- Thread safety
- This function is not thread safe. Other threads triggering an assertion, or simultaneously calling this function may cause memory leaks or crashes.
- See also
sDL_GetAssertionReport- C declaration
SDL_ResetAssertionReport, defined atSDL3/SDL_assert.h 702:34
Since: 3.2.0