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