# Copyright (c) 2001, Stanford University
# All rights reserved.
#
# See the file LICENSE.txt for information on redistributing this software.
# This script generates the spu_dispatch_table.h file from gl_header.parsed
import apiutil
print """
/* DO NOT EDIT - THIS FILE GENERATED BY THE dispatchheader.py SCRIPT */
#ifndef CR_SPU_DISPATCH_TABLE_H
#define CR_SPU_DISPATCH_TABLE_H
#ifdef WINDOWS
#define SPU_APIENTRY __stdcall
#else
#define SPU_APIENTRY
#endif
#include "chromium.h"
#include "state/cr_statetypes.h"
"""
print '/* Offsets of each function within the dispatch table */'
offset += 1
print ''
print '/* Function typedefs */'
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 {'
print """
struct _copy_list_node *copyList;
struct _spu_dispatch_table *copy_of;
int mark;
void *server;
} SPUDispatchTable;
struct _copy_list_node {
SPUDispatchTable *copy;
struct _copy_list_node *next;
};
#endif /* CR_SPU_DISPATCH_TABLE_H */
"""