wined3d: Pack hardcoded local constants in ARB.
[wine] / tools / winapi / c_function.pm
1 #
2 # Copyright 1999, 2000, 2001 Patrik Stridvall
3 #
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
8 #
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 # Lesser General Public License for more details.
13 #
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 #
18
19 package c_function;
20
21 use strict;
22
23 sub new($)
24 {
25     my $proto = shift;
26     my $class = ref($proto) || $proto;
27     my $self  = {};
28     bless ($self, $class);
29
30     return $self;
31 }
32
33
34 #
35 # Property setter / getter functions (each does both)
36 #
37
38 sub file($;$)
39 {
40     my $self = shift;
41     my $file = \${$self->{FILE}};
42
43     local $_ = shift;
44
45     if(defined($_)) { $$file = $_; }
46
47     return $$file;
48 }
49
50 sub begin_line($;$)
51 {
52     my $self = shift;
53     my $begin_line = \${$self->{BEGIN_LINE}};
54
55     local $_ = shift;
56
57     if(defined($_)) { $$begin_line = $_; }
58
59     return $$begin_line;
60 }
61
62 sub begin_column($;$)
63 {
64     my $self = shift;
65     my $begin_column = \${$self->{BEGIN_COLUMN}};
66
67     local $_ = shift;
68
69     if(defined($_)) { $$begin_column = $_; }
70
71     return $$begin_column;
72 }
73
74 sub end_line($;$)
75 {
76     my $self = shift;
77     my $end_line = \${$self->{END_LINE}};
78
79     local $_ = shift;
80
81     if(defined($_)) { $$end_line = $_; }
82
83     return $$end_line;
84 }
85
86 sub end_column($;$)
87 {
88     my $self = shift;
89     my $end_column = \${$self->{END_COLUMN}};
90
91     local $_ = shift;
92
93     if(defined($_)) { $$end_column = $_; }
94
95     return $$end_column;
96 }
97
98 sub linkage($;$)
99 {
100     my $self = shift;
101     my $linkage = \${$self->{LINKAGE}};
102
103     local $_ = shift;
104
105     if(defined($_)) { $$linkage = $_; }
106
107     return $$linkage;
108 }
109
110 sub return_type($;$)
111 {
112     my $self = shift;
113     my $return_type = \${$self->{RETURN_TYPE}};
114
115     local $_ = shift;
116
117     if(defined($_)) { $$return_type = $_; }
118
119     return $$return_type;
120 }
121
122 sub calling_convention($;$)
123 {
124     my $self = shift;
125     my $calling_convention = \${$self->{CALLING_CONVENTION}};
126
127     local $_ = shift;
128
129     if(defined($_)) { $$calling_convention = $_; }
130
131     return $$calling_convention;
132 }
133
134 sub name($;$)
135 {
136     my $self = shift;
137     my $name = \${$self->{NAME}};
138
139     local $_ = shift;
140
141     if(defined($_)) { $$name = $_; }
142
143     return $$name;
144 }
145
146 sub argument_types($;$)
147 {
148     my $self = shift;
149     my $argument_types = \${$self->{ARGUMENT_TYPES}};
150
151     local $_ = shift;
152
153     if(defined($_)) { $$argument_types = $_; }
154
155     return $$argument_types;
156 }
157
158 sub argument_names($;$)
159 {
160     my $self = shift;
161     my $argument_names = \${$self->{ARGUMENT_NAMES}};
162
163     local $_ = shift;
164
165     if(defined($_)) { $$argument_names = $_; }
166
167     return $$argument_names;
168 }
169
170 sub statements_line($;$)
171 {
172     my $self = shift;
173     my $statements_line = \${$self->{STATEMENTS_LINE}};
174
175     local $_ = shift;
176
177     if(defined($_)) { $$statements_line = $_; }
178
179     return $$statements_line;
180 }
181
182 sub statements_column($;$)
183 {
184     my $self = shift;
185     my $statements_column = \${$self->{STATEMENTS_COLUMN}};
186
187     local $_ = shift;
188
189     if(defined($_)) { $$statements_column = $_; }
190
191     return $$statements_column;
192 }
193
194 sub statements($;$)
195 {
196     my $self = shift;
197     my $statements = \${$self->{STATEMENTS}};
198
199     local $_ = shift;
200
201     if(defined($_)) { $$statements = $_; }
202
203     return $$statements;
204 }
205
206 1;