VirtualBox

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

Last change on this file since 70939 was 69392, checked in by vboxsync, 7 years ago

GuestHost/OpenGL: scm updates

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 1.6 KB
Line 
1# Copyright (c) 2001, Stanford University
2# All rights reserved.
3#
4# See the file LICENSE.txt for information on redistributing this software.
5
6from __future__ import print_function
7import sys
8import apiutil
9
10
11apiutil.CopyrightC()
12
13print("""
14
15/* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED BY spucopy.py SCRIPT */
16
17#include "cr_spu.h"
18#include "cr_mem.h"
19
20void crSPUCopyDispatchTable( SPUDispatchTable *dst, SPUDispatchTable *src )
21{
22""")
23
24keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
25for func_name in keys:
26 print('\tdst->%s = src->%s;' % (func_name, func_name))
27
28# if the destination is already a copy of something, we'd better make sure
29# that we take it off its source's copy list first.
30
31print("""
32 if (dst->copy_of != NULL)
33 {
34 /*
35 * dst was already a copy, go back to the original,
36 * and remove dst from the original's copyList.
37 */
38 struct _copy_list_node *temp, *prior = NULL;
39 for (temp = dst->copy_of->copyList; temp; prior = temp, temp = temp->next)
40 {
41 if (temp->copy == dst)
42 {
43 if (prior)
44 {
45 prior->next = temp->next;
46 }
47 else
48 {
49 dst->copy_of->copyList = temp->next;
50 }
51 crFree( temp );
52 break;
53 }
54 }
55 }
56 /*
57 * Now that dst->copy_of is unused, set it to point to our
58 * new original.
59 */
60 if (src->copy_of)
61 {
62 dst->copy_of = src->copy_of;
63 }
64 else
65 {
66 dst->copy_of = src;
67 }
68 /*
69 * Create a new copy node, so the src can keep track of the
70 * new copy (i.e. dst).
71 */
72 {
73 struct _copy_list_node *copynode;
74 copynode = (struct _copy_list_node*)crAlloc( sizeof( *copynode ) );
75 copynode->copy = dst;
76 copynode->next = src->copyList;
77 src->copyList = copynode;
78 }
79}
80""")
Note: See TracBrowser for help on using the repository browser.

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