WAFFLE_INIT(3) | Waffle Manual | WAFFLE_INIT(3) |
NAME¶
waffle_error, waffle_error_get_info, waffle_error_get_code, waffle_error_to_string - Thread-local error state
SYNOPSIS¶
#include <waffle.h> enum waffle_error {...}; struct waffle_error_info {
enum waffle_error code;
const char *message;
size_t message_length; };
const struct waffle_error_info* waffle_error_get_info(void);
enum waffle_error waffle_error_get_code(void);
const char* waffle_error_to_string(enum waffle_errore);
DESCRIPTION¶
Waffle functions usually return either a bool, in which false indicates failure, or a pointer, in which null indicates failure. In addition to returning a flag indicating failure, most functions also clear and then set some thread-local error state.
The only functions that do not alter waffle's error state are listed here and are explicitly documented as such. All functions listed here can be called before waffle has been successfully initialized with waffle_init(3)
struct waffle_error_info
code may be any token from enum waffle_error.
message often contains a descriptive message about the error. It is never null, though it may be the empty string.
message_length is the length of message according to strlen(3).
waffle_error_to_string()
This function always sets the error code to WAFFLE_ERROR_NONE.
waffle_error_get_info()
This function never returns null. The returned pointer becomes invalid when the thread-local error state changes.
This function does not alter waffle's error state.
waffle_error_get_code()
This function does not alter waffle's error state.
enum waffle_error
WAFFLE_NO_ERROR = 0x00
WAFFLE_ERROR_FATAL = 0x01
WAFFLE_ERROR_UNKNOWN = 0x02
WAFFLE_ERROR_INTERNAL = 0x03
WAFFLE_ERROR_BAD_ALLOC = 0x04
WAFFLE_ERROR_NOT_INITIALIZED = 0x05
WAFFLE_ERROR_ALREADY_INITIALIZED = 0x06
WAFFLE_ERROR_BAD_ATTRIBUTE = 0x08
WAFFLE_ERROR_BAD_PARAMETER = 0x10
WAFFLE_ERROR_BAD_DISPLAY_MATCH = 0x11
WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM = 0x12
For example, attempting to choose a waffle_config whose API is OpenGL ES1 on a system that doesn't OpenGL ES1 will produce this error.
WAFFLE_ERROR_BUILT_WITHOUT_SUPPORT = 0x13
For example, if waffle was built without support for GBM, then calling waffle_init() with attribute WAFFLE_PLATFORM=WAFFLE_PLATFORM_GBM will produce this error.
ISSUES¶
Please report bugs or and feature requests to https://gitlab.freedesktop.org/mesa/waffle/issues.
SEE ALSO¶
AUTHOR¶
Chad Versace <chad.versace@linux.intel.com>
COPYRIGHT¶
Copyright © 2013 Intel
This manual page is licensed under the Creative Commons Attribution-ShareAlike 3.0 United States License (CC BY-SA 3.0). To view a copy of this license, visit http://creativecommons.org.license/by-sa/3.0/us.
08/18/2021 | waffle |