Ejemplo n.º 1
0
keys = apiutil.GetDispatchedFunctions(sys.argv[1] + "/APIspec.txt")

print('/* Offsets of each function within the dispatch table */')
offset = 0
for func_name in keys:
    print('#define DISPATCH_OFFSET_%s %d' % (func_name, offset))
    offset += 1
print('')

print('/* Function typedefs */')
for func_name in keys:
    return_type = apiutil.ReturnType(func_name)
    params = apiutil.Parameters(func_name)

    print('typedef %s (SPU_APIENTRY *%sFunc_t)(%s);' %
          (return_type, func_name, apiutil.MakePrototypeString(params)))
print('')

print('struct _copy_list_node;')
print('')
print('/* Prototype for SPU internal state load/unload callbacks. */')
print('')
print('typedef int (*SPUStateFunc_t)(void *);')
print('')
print('/* The SPU dispatch table */')
print('typedef struct _spu_dispatch_table {')

for func_name in keys:
    print("\t%sFunc_t %s; " % (func_name, func_name))

print("""
keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")


print '/* Offsets of each function within the dispatch table */'
offset = 0
for func_name in keys:
	print '#define DISPATCH_OFFSET_%s %d' % (func_name, offset)
	offset += 1
print ''

print '/* Function typedefs */'
for func_name in keys:
	return_type = apiutil.ReturnType(func_name)
	params = apiutil.Parameters(func_name)

	print 'typedef %s (SPU_APIENTRY *%sFunc_t)(%s);' % (return_type, func_name, apiutil.MakePrototypeString(params))
print ''

print 'struct _copy_list_node;'
print ''
print '/* The SPU dispatch table */'
print 'typedef struct _spu_dispatch_table {'

for func_name in keys:
	print "\t%sFunc_t %s; " % ( func_name, func_name )

print """
	struct _copy_list_node *copyList;
	struct _spu_dispatch_table *copy_of;
	int mark;
	void *server;