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 |
|
---|
7 | import sys
|
---|
8 |
|
---|
9 | import apiutil
|
---|
10 |
|
---|
11 | keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
|
---|
12 |
|
---|
13 | apiutil.CopyrightC()
|
---|
14 |
|
---|
15 | print """
|
---|
16 | /* DO NOT EDIT - THIS FILE GENERATED BY THE NULLfuncs.py SCRIPT */
|
---|
17 |
|
---|
18 | #include "cr_error.h"
|
---|
19 | #include "stub.h"
|
---|
20 | """
|
---|
21 |
|
---|
22 | for func_name in keys:
|
---|
23 | return_type = apiutil.ReturnType(func_name)
|
---|
24 | params = apiutil.Parameters(func_name)
|
---|
25 |
|
---|
26 | print "static %s SPULOAD_APIENTRY NULL_%s( %s )" % (return_type, func_name, apiutil.MakeDeclarationString(params))
|
---|
27 | print "{"
|
---|
28 | print "\t/* do nothing */"
|
---|
29 | print "\tcrWarning(\"YOU ARE CALLING A NULLED FUNCTION (%s)\");" % func_name
|
---|
30 | for (name, type, vecSize) in params:
|
---|
31 | print "\t(void) %s;" % name
|
---|
32 | if return_type != "void":
|
---|
33 | print "\treturn 0;"
|
---|
34 | print "}"
|
---|
35 | print ""
|
---|
36 |
|
---|
37 |
|
---|
38 | print "DECLEXPORT(SPUDispatchTable) stubNULLDispatch = {"
|
---|
39 | for func_name in keys:
|
---|
40 | print "\tNULL_%s," % (func_name)
|
---|
41 | print "\tNULL, /* copyList */"
|
---|
42 | print "\tNULL, /* copy_of */"
|
---|
43 | print "\t0, /* mark */"
|
---|
44 | print "\tNULL /* server */"
|
---|
45 | print "};"
|
---|
46 |
|
---|
47 | print ""
|
---|
48 | print "/* Declare and initialize the glim dispatch table here so that we */"
|
---|
49 | print "/* can initialize all entries to no-op routines. */"
|
---|
50 | print "SPUDispatchTable glim = {"
|
---|
51 | for func_name in keys:
|
---|
52 | print "\tNULL_%s," % (func_name)
|
---|
53 | print "\tNULL, /* copyList */"
|
---|
54 | print "\tNULL, /* copy_of */"
|
---|
55 | print "\t0, /* mark */"
|
---|
56 | print "\tNULL /* server */"
|
---|
57 | print "};"
|
---|