|
Kore 3
|
Contains functionality to stop the program in case of an error and create a user-visible error message. More...
Go to the source code of this file.
Functions | |
| KORE_FUNC void | kore_affirm (bool condition) |
| Exits the program when a condition is untrue and shows a generic error message. | |
| KORE_FUNC void | kore_affirm_message (bool condition, const char *format,...) |
| Exits the program when a condition is untrue and shows a provided error message. | |
| KORE_FUNC void | kore_affirm_args (bool condition, const char *format, va_list args) |
| Equivalent to kore_affirm_message but uses a va_list parameter. | |
| KORE_FUNC void | kore_error (void) |
| Exits the program and shows a generic error message. | |
| KORE_FUNC void | kore_error_message (const char *format,...) |
| Exits the program and shows a provided error message. | |
| KORE_FUNC void | kore_error_args (const char *format, va_list args) |
| Equivalent to kore_error_message but uses a va_list parameter. | |
Contains functionality to stop the program in case of an error and create a user-visible error message.
The affirm and error functions print an error message and then exit the program. Error messages can be made visible to the user (unless a console window is active this is only implemented for Windows).
| KORE_FUNC void kore_affirm | ( | bool | condition | ) |
Exits the program when a condition is untrue and shows a generic error message.
This is an alternative to assert which also persists in release builds. Use this instead of assert in situations where you want your users to see what's going wrong. This uses Kore's log and error functionality to make errors visible.
| condition | Exits the program if condition is false, otherwise does nothing. |
| KORE_FUNC void kore_affirm_args | ( | bool | condition, |
| const char * | format, | ||
| va_list | args ) |
Equivalent to kore_affirm_message but uses a va_list parameter.
You will need this if you want to provide the parameters using va_start/va_end.
| condition | Exits the program if condition is false, otherwise does nothing. |
| format | The parameter is equivalent to the first vprintf parameter. |
| ... | The parameter is equivalent to the second vprintf parameter. |
| KORE_FUNC void kore_affirm_message | ( | bool | condition, |
| const char * | format, | ||
| ... ) |
Exits the program when a condition is untrue and shows a provided error message.
This is equivalent to kore_affirm() but uses the provided message instead of a generic one.
| condition | Exits the program if condition is false, otherwise does nothing. |
| format | The parameter is equivalent to the first printf parameter. |
| ... | The parameter is equivalent to the second printf parameter. |
| KORE_FUNC void kore_error | ( | void | ) |
Exits the program and shows a generic error message.
Mainly this just calls exit(EXIT_FAILURE) but will also use Kore's log function and on Windows show an error message box.
| KORE_FUNC void kore_error_args | ( | const char * | format, |
| va_list | args ) |
Equivalent to kore_error_message but uses a va_list parameter.
You will need this if you want to provide the parameters using va_start/va_end.
| format | The parameter is equivalent to the first vprintf parameter. |
| ... | The parameter is equivalent to the second vprintf parameter. |
| KORE_FUNC void kore_error_message | ( | const char * | format, |
| ... ) |
Exits the program and shows a provided error message.
This is equivalent to kore_error() but uses the provided message instead of a generic one.
| format | The parameter is equivalent to the first printf parameter. |
| ... | The parameter is equivalent to the second printf parameter. |