NULLfuncs.py revision afa310d43160bccfd48d69282d13d81c998e77c3
2N/A# Copyright (c) 2001, Stanford University
2N/A# All rights reserved.
2N/A#
2N/A# See the file LICENSE.txt for information on redistributing this software.
2N/A
2N/A
2N/Aimport sys
2N/A
2N/Aimport apiutil
2N/A
2N/Akeys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
2N/A
2N/Aapiutil.CopyrightC()
2N/A
2N/Aprint """
2N/A/* DO NOT EDIT - THIS FILE GENERATED BY THE NULLfuncs.py SCRIPT */
2N/A
2N/A#include "cr_error.h"
2N/A#include "stub.h"
2N/A"""
2N/A
2N/Afor func_name in keys:
2N/A return_type = apiutil.ReturnType(func_name)
2N/A params = apiutil.Parameters(func_name)
2N/A
2N/A print "static %s SPULOAD_APIENTRY NULL_%s( %s )" % (return_type, func_name, apiutil.MakeDeclarationString(params))
2N/A print "{"
2N/A print "\t/* do nothing */"
2N/A print "\tcrWarning(\"YOU ARE CALLING A NULLED FUNCTION (%s)\");" % func_name
2N/A for (name, type, vecSize) in params:
2N/A print "\t(void) %s;" % name
2N/A if return_type != "void":
2N/A print "\treturn 0;"
2N/A print "}"
2N/A print ""
2N/A
2N/A
2N/Aprint "DECLEXPORT(SPUDispatchTable) stubNULLDispatch = {"
2N/Afor func_name in keys:
2N/A print "\tNULL_%s," % (func_name)
2N/Aprint "\tNULL, /* copyList */"
2N/Aprint "\tNULL, /* copy_of */"
2N/Aprint "\t0, /* mark */"
2N/Aprint "\tNULL /* server */"
2N/Aprint "};"
2N/A
2N/Aprint ""
2N/Aprint "/* Declare and initialize the glim dispatch table here so that we */"
2N/Aprint "/* can initialize all entries to no-op routines. */"
2N/Aprint "SPUDispatchTable glim = {"
2N/Afor func_name in keys:
2N/A print "\tNULL_%s," % (func_name)
2N/Aprint "\tNULL, /* copyList */"
2N/Aprint "\tNULL, /* copy_of */"
2N/Aprint "\t0, /* mark */"
2N/Aprint "\tNULL /* server */"
2N/Aprint "};"
2N/A