VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/spu_loader/spucopy.py@ 59922

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

crOpenGL: export to OSE

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id
檔案大小: 1.6 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
6import sys
7import apiutil
8
9
10apiutil.CopyrightC()
11
12print """
13
14/* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED BY spucopy.py SCRIPT */
15
16#include "cr_spu.h"
17#include "cr_mem.h"
18
19void crSPUCopyDispatchTable( SPUDispatchTable *dst, SPUDispatchTable *src )
20{
21"""
22
23keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
24for func_name in keys:
25 print '\tdst->%s = src->%s;' % (func_name, func_name)
26
27# if the destination is already a copy of something, we'd better make sure
28# that we take it off its source's copy list first.
29
30print """
31 if (dst->copy_of != NULL)
32 {
33 /*
34 * dst was already a copy, go back to the original,
35 * and remove dst from the original's copyList.
36 */
37 struct _copy_list_node *temp, *prior = NULL;
38 for (temp = dst->copy_of->copyList; temp; prior = temp, temp = temp->next)
39 {
40 if (temp->copy == dst)
41 {
42 if (prior)
43 {
44 prior->next = temp->next;
45 }
46 else
47 {
48 dst->copy_of->copyList = temp->next;
49 }
50 crFree( temp );
51 break;
52 }
53 }
54 }
55 /*
56 * Now that dst->copy_of is unused, set it to point to our
57 * new original.
58 */
59 if (src->copy_of)
60 {
61 dst->copy_of = src->copy_of;
62 }
63 else
64 {
65 dst->copy_of = src;
66 }
67 /*
68 * Create a new copy node, so the src can keep track of the
69 * new copy (i.e. dst).
70 */
71 {
72 struct _copy_list_node *copynode;
73 copynode = (struct _copy_list_node*)crAlloc( sizeof( *copynode ) );
74 copynode->copy = dst;
75 copynode->next = src->copyList;
76 src->copyList = copynode;
77 }
78}
79"""
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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