1WAFFLE_INIT(3)                   Waffle Manual                  WAFFLE_INIT(3)
2
3
4

NAME

6       waffle_error, waffle_error_get_info, waffle_error_get_code,
7       waffle_error_to_string - Thread-local error state
8

SYNOPSIS

10       #include <waffle.h>
11
12       enum waffle_error {...};
13
14       struct waffle_error_info {
15           enum waffle_error code;
16           const char *message;
17           size_t message_length;
18       };
19
20
21       const struct waffle_error_info* waffle_error_get_info(void);
22
23       enum waffle_error waffle_error_get_code(void);
24
25       const char* waffle_error_to_string(enum waffle_errore);
26

DESCRIPTION

28       Waffle functions usually return either a bool, in which false indicates
29       failure, or a pointer, in which null indicates failure. In addition to
30       returning a flag indicating failure, most functions also clear and then
31       set some thread-local error state.
32
33       The only functions that do not alter waffle's error state are listed
34       here and are explicitly documented as such. All functions listed here
35       can be called before waffle has been successfully initialized with
36       waffle_init(3)
37
38       struct waffle_error_info
39           This struct contains the user-visible portion of waffle's
40           thread-local error state.
41
42           code may be any token from enum waffle_error.
43
44           message often contains a descriptive message about the error. It is
45           never null, though it may be the empty string.
46
47           message_length is the length of message according to strlen(3).
48
49       waffle_error_to_string()
50           Convert a waffle_error token to a string. For example, convert
51           WAFFLE_ERROR_UNKNOWN to "WAFFLE_ERROR_UNKNOWN". Return null if the
52           token is not a valid error token.
53
54           This function always sets the error code to WAFFLE_ERROR_NONE.
55
56       waffle_error_get_info()
57           Get information about the current thread's error state.
58
59           This function never returns null. The returned pointer becomes
60           invalid when the thread-local error state changes.
61
62           This function does not alter waffle's error state.
63
64       waffle_error_get_code()
65           Get the current thread's error code. Calling this function is
66           equivalent to obtaining the error code with
67           waffle_error_get_info()->code.
68
69           This function does not alter waffle's error state.
70
71       enum waffle_error
72           For reference, below is the complete list of waffle's error codes.
73
74           WAFFLE_NO_ERROR = 0x00
75               The function succeeded.
76
77           WAFFLE_ERROR_FATAL = 0x01
78               Waffle encountered a fatal error. All future waffle calls
79               result in undefined behavior.
80
81           WAFFLE_ERROR_UNKNOWN = 0x02
82               Waffle encountered an error for which it lacks an error code.
83               This is usually produced when an underlying native call, such
84               as XOpenDisplay(3), fails for an unknown reason.
85
86           WAFFLE_ERROR_INTERNAL = 0x03
87               You found a bug in waffle. Please report it. The error message,
88               obtained by waffle_error_get_info(), should contain a
89               description of the bug.
90
91           WAFFLE_ERROR_BAD_ALLOC = 0x04
92               Waffle failed to allocate memory.
93
94           WAFFLE_ERROR_NOT_INITIALIZED = 0x05
95               The failed function requires waffle to be initialized with
96               waffle_init(3).
97
98           WAFFLE_ERROR_ALREADY_INITIALIZED = 0x06
99               If waffle has already been initialized by a successful call to
100               waffle_init(3), then subsequent calls to waffle_init() produce
101               this error.
102
103           WAFFLE_ERROR_BAD_ATTRIBUTE = 0x08
104               An unrecognized attribute name or attribute value was passed in
105               an attribute list.
106
107           WAFFLE_ERROR_BAD_PARAMETER = 0x10
108               The failed function was passed an invalid argument.
109
110           WAFFLE_ERROR_BAD_DISPLAY_MATCH = 0x11
111               The waffle objects passed to the failed function belong to
112               different displays.
113
114           WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM = 0x12
115               The requested action is unsupported on the current system or
116               platform, but is otherwise valid.
117
118               For example, attempting to choose a waffle_config whose API is
119               OpenGL ES1 on a system that doesn't OpenGL ES1 will produce
120               this error.
121
122           WAFFLE_ERROR_BUILT_WITHOUT_SUPPORT = 0x13
123               Waffle was built without support for the requested action.
124
125               For example, if waffle was built without support for GBM, then
126               calling waffle_init() with attribute
127               WAFFLE_PLATFORM=WAFFLE_PLATFORM_GBM will produce this error.
128
129

ISSUES

131       Please report bugs or and feature requests to
132       https://gitlab.freedesktop.org/mesa/waffle/issues.
133

SEE ALSO

135       waffle(7)
136

AUTHOR

138       Chad Versace <chad.versace@linux.intel.com>
139           Maintainer
140
142       Copyright © 2013 Intel
143
144       This manual page is licensed under the Creative Commons
145       Attribution-ShareAlike 3.0 United States License (CC BY-SA 3.0). To
146       view a copy of this license, visit
147       http://creativecommons.org.license/by-sa/3.0/us.
148
149
150
151
152waffle                            04/01/2020                    WAFFLE_INIT(3)
Impressum