xref: /aosp_15_r20/external/mesa3d/src/egl/main/egldispatchstubs.h (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1*61046927SAndroid Build Coastguard Worker /*
2*61046927SAndroid Build Coastguard Worker  * (C) Copyright 2016, NVIDIA CORPORATION.
3*61046927SAndroid Build Coastguard Worker  * All Rights Reserved.
4*61046927SAndroid Build Coastguard Worker  *
5*61046927SAndroid Build Coastguard Worker  * Permission is hereby granted, free of charge, to any person obtaining a
6*61046927SAndroid Build Coastguard Worker  * copy of this software and associated documentation files (the "Software"),
7*61046927SAndroid Build Coastguard Worker  * to deal in the Software without restriction, including without limitation
8*61046927SAndroid Build Coastguard Worker  * on the rights to use, copy, modify, merge, publish, distribute, sub
9*61046927SAndroid Build Coastguard Worker  * license, and/or sell copies of the Software, and to permit persons to whom
10*61046927SAndroid Build Coastguard Worker  * the Software is furnished to do so, subject to the following conditions:
11*61046927SAndroid Build Coastguard Worker  *
12*61046927SAndroid Build Coastguard Worker  * The above copyright notice and this permission notice (including the next
13*61046927SAndroid Build Coastguard Worker  * paragraph) shall be included in all copies or substantial portions of the
14*61046927SAndroid Build Coastguard Worker  * Software.
15*61046927SAndroid Build Coastguard Worker  *
16*61046927SAndroid Build Coastguard Worker  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17*61046927SAndroid Build Coastguard Worker  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18*61046927SAndroid Build Coastguard Worker  * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
19*61046927SAndroid Build Coastguard Worker  * IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20*61046927SAndroid Build Coastguard Worker  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21*61046927SAndroid Build Coastguard Worker  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22*61046927SAndroid Build Coastguard Worker  * IN THE SOFTWARE.
23*61046927SAndroid Build Coastguard Worker  *
24*61046927SAndroid Build Coastguard Worker  * Authors:
25*61046927SAndroid Build Coastguard Worker  *    Kyle Brenneman <[email protected]>
26*61046927SAndroid Build Coastguard Worker  */
27*61046927SAndroid Build Coastguard Worker 
28*61046927SAndroid Build Coastguard Worker #ifndef EGLDISPATCHSTUBS_H
29*61046927SAndroid Build Coastguard Worker #define EGLDISPATCHSTUBS_H
30*61046927SAndroid Build Coastguard Worker 
31*61046927SAndroid Build Coastguard Worker #include "glvnd/libeglabi.h"
32*61046927SAndroid Build Coastguard Worker 
33*61046927SAndroid Build Coastguard Worker // These variables are all generated along with the dispatch stubs.
34*61046927SAndroid Build Coastguard Worker extern const int __EGL_DISPATCH_FUNC_COUNT;
35*61046927SAndroid Build Coastguard Worker extern const char *const __EGL_DISPATCH_FUNC_NAMES[];
36*61046927SAndroid Build Coastguard Worker extern int __EGL_DISPATCH_FUNC_INDICES[];
37*61046927SAndroid Build Coastguard Worker extern const __eglMustCastToProperFunctionPointerType __EGL_DISPATCH_FUNCS[];
38*61046927SAndroid Build Coastguard Worker 
39*61046927SAndroid Build Coastguard Worker void
40*61046927SAndroid Build Coastguard Worker __eglInitDispatchStubs(const __EGLapiExports *exportsTable);
41*61046927SAndroid Build Coastguard Worker void
42*61046927SAndroid Build Coastguard Worker __eglSetDispatchIndex(const char *name, int index);
43*61046927SAndroid Build Coastguard Worker 
44*61046927SAndroid Build Coastguard Worker /**
45*61046927SAndroid Build Coastguard Worker  * Returns the dispatch function for the given name, or \c NULL if the function
46*61046927SAndroid Build Coastguard Worker  * isn't supported.
47*61046927SAndroid Build Coastguard Worker  */
48*61046927SAndroid Build Coastguard Worker void *
49*61046927SAndroid Build Coastguard Worker __eglDispatchFindDispatchFunction(const char *name);
50*61046927SAndroid Build Coastguard Worker 
51*61046927SAndroid Build Coastguard Worker // Helper functions used by the generated stubs.
52*61046927SAndroid Build Coastguard Worker __eglMustCastToProperFunctionPointerType
53*61046927SAndroid Build Coastguard Worker __eglDispatchFetchByDisplay(EGLDisplay dpy, int index);
54*61046927SAndroid Build Coastguard Worker __eglMustCastToProperFunctionPointerType
55*61046927SAndroid Build Coastguard Worker __eglDispatchFetchByDevice(EGLDeviceEXT dpy, int index);
56*61046927SAndroid Build Coastguard Worker __eglMustCastToProperFunctionPointerType
57*61046927SAndroid Build Coastguard Worker __eglDispatchFetchByCurrent(int index);
58*61046927SAndroid Build Coastguard Worker 
59*61046927SAndroid Build Coastguard Worker #endif // EGLDISPATCHSTUBS_H
60