Utility provides a few basic, low-level utilities for the PlayStation Portable.
ASSERT - Tests a condition.utlOops - Displays an error message and halts the program.utlSetupCallbacks - Sets up a basic exit callback.SAFE_FREE - A "safe" wrapper for free.SAFE_STR - A "safe" wrapper for strings.#define ASSERT(condition, failureMessage)
Evaluates condition as a Boolean expression. If condition is false, utlOops is called with failureMessage.
#define SAFE_FREE(ptr)
If ptr is NULL, does nothing. Otherwise, frees ptr and sets it to NULL.
#define SAFE_STR(str)
If str is NULL, returns "". Otherwise, returns str. Shorthand for (str ? str : "").
void utlOops(const char *message, const char *file, int line)
Terminates the GU, initializes the debug screen, and displays message. file and line are displayed at the bottom of the screen to indicate where the problem occurred. This function is best called with the __FILE__ and __LINE__ macros, like so:
utlOops("Out of memory", __FILE__, __LINE__);
This function never returns.
int utlSetupCallbacks()
Sets up a basic exit callback, which allows the kernel to terminate the program. Returns the callback thread's ID.