VirtualBox

source: vbox/trunk/src/VBox/Additions/common/crOpenGL/NULLfuncs.py@ 78384

Last change on this file since 78384 was 69310, checked in by vboxsync, 7 years ago

common/crOpenGL: scm updates

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 1.5 KB
Line 
1# Copyright (c) 2001, Stanford University
2# All rights reserved.
3#
4# See the file LICENSE.txt for information on redistributing this software.
5
6
7from __future__ import print_function
8import sys
9
10import apiutil
11
12keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
13
14apiutil.CopyrightC()
15
16print("""
17/* DO NOT EDIT - THIS FILE GENERATED BY THE NULLfuncs.py SCRIPT */
18
19#include "cr_error.h"
20#include "stub.h"
21""")
22
23for func_name in keys:
24 return_type = apiutil.ReturnType(func_name)
25 params = apiutil.Parameters(func_name)
26
27 print("static %s SPULOAD_APIENTRY NULL_%s(%s)" % (return_type, func_name, apiutil.MakeDeclarationString(params)))
28 print("{")
29 print("\t/* do nothing */")
30 print("\tcrWarning(\"YOU ARE CALLING A NULLED FUNCTION (%s)\");" % func_name)
31 for (name, type, vecSize) in params:
32 print("\t(void) %s;" % name)
33 if return_type != "void":
34 print("\treturn 0;")
35 print("}")
36 print("")
37
38
39print("DECLEXPORT(SPUDispatchTable) stubNULLDispatch = {")
40for func_name in keys:
41 print("\tNULL_%s," % (func_name))
42print("\tNULL, /* copyList */")
43print("\tNULL, /* copy_of */")
44print("\t0, /* mark */")
45print("\tNULL /* server */")
46print("};")
47
48print("")
49print("/* Declare and initialize the glim dispatch table here so that we */")
50print("/* can initialize all entries to no-op routines. */")
51print("SPUDispatchTable glim = {")
52for func_name in keys:
53 print("\tNULL_%s," % (func_name))
54print("\tNULL, /* copyList */")
55print("\tNULL, /* copy_of */")
56print("\t0, /* mark */")
57print("\tNULL /* server */")
58print("};")
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette