VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/spu_loader/dispatchheader.py@ 40640

最後變更 在這個檔案從40640是 15532,由 vboxsync 提交於 16 年 前

crOpenGL: export to OSE

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id
檔案大小: 1.5 KB
 
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# This script generates the spu_dispatch_table.h file from gl_header.parsed
7
8import sys, string
9
10import apiutil
11
12
13apiutil.CopyrightC()
14
15print """
16/* DO NOT EDIT - THIS FILE GENERATED BY THE dispatchheader.py SCRIPT */
17
18#ifndef CR_SPU_DISPATCH_TABLE_H
19#define CR_SPU_DISPATCH_TABLE_H
20
21#ifdef WINDOWS
22#define SPU_APIENTRY __stdcall
23#else
24#define SPU_APIENTRY
25#endif
26
27#include "chromium.h"
28#include "state/cr_statetypes.h"
29"""
30
31keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
32
33
34print '/* Offsets of each function within the dispatch table */'
35offset = 0
36for func_name in keys:
37 print '#define DISPATCH_OFFSET_%s %d' % (func_name, offset)
38 offset += 1
39print ''
40
41print '/* Function typedefs */'
42for func_name in keys:
43 return_type = apiutil.ReturnType(func_name)
44 params = apiutil.Parameters(func_name)
45
46 print 'typedef %s (SPU_APIENTRY *%sFunc_t)(%s);' % (return_type, func_name, apiutil.MakePrototypeString(params))
47print ''
48
49print 'struct _copy_list_node;'
50print ''
51print '/* The SPU dispatch table */'
52print 'typedef struct _spu_dispatch_table {'
53
54for func_name in keys:
55 print "\t%sFunc_t %s; " % ( func_name, func_name )
56
57print """
58 struct _copy_list_node *copyList;
59 struct _spu_dispatch_table *copy_of;
60 int mark;
61 void *server;
62} SPUDispatchTable;
63
64struct _copy_list_node {
65 SPUDispatchTable *copy;
66 struct _copy_list_node *next;
67};
68
69
70#endif /* CR_SPU_DISPATCH_TABLE_H */
71"""
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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