push e1d8a1293d44015bb0894687d02c5c53339996f7
[wine/hacks.git] / tools / winapi / c_function.pm
blobc7645764bf24f8d9ff6cd83aff6f90aa7540deae
2 # Copyright 1999, 2000, 2001 Patrik Stridvall
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.
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.
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
19 package c_function;
21 use strict;
23 sub new($)
25 my $proto = shift;
26 my $class = ref($proto) || $proto;
27 my $self = {};
28 bless ($self, $class);
30 return $self;
35 # Property setter / getter functions (each does both)
38 sub file($;$)
40 my $self = shift;
41 my $file = \${$self->{FILE}};
43 local $_ = shift;
45 if(defined($_)) { $$file = $_; }
47 return $$file;
50 sub begin_line($;$)
52 my $self = shift;
53 my $begin_line = \${$self->{BEGIN_LINE}};
55 local $_ = shift;
57 if(defined($_)) { $$begin_line = $_; }
59 return $$begin_line;
62 sub begin_column($;$)
64 my $self = shift;
65 my $begin_column = \${$self->{BEGIN_COLUMN}};
67 local $_ = shift;
69 if(defined($_)) { $$begin_column = $_; }
71 return $$begin_column;
74 sub end_line($;$)
76 my $self = shift;
77 my $end_line = \${$self->{END_LINE}};
79 local $_ = shift;
81 if(defined($_)) { $$end_line = $_; }
83 return $$end_line;
86 sub end_column($;$)
88 my $self = shift;
89 my $end_column = \${$self->{END_COLUMN}};
91 local $_ = shift;
93 if(defined($_)) { $$end_column = $_; }
95 return $$end_column;
98 sub linkage($;$)
100 my $self = shift;
101 my $linkage = \${$self->{LINKAGE}};
103 local $_ = shift;
105 if(defined($_)) { $$linkage = $_; }
107 return $$linkage;
110 sub return_type($;$)
112 my $self = shift;
113 my $return_type = \${$self->{RETURN_TYPE}};
115 local $_ = shift;
117 if(defined($_)) { $$return_type = $_; }
119 return $$return_type;
122 sub calling_convention($;$)
124 my $self = shift;
125 my $calling_convention = \${$self->{CALLING_CONVENTION}};
127 local $_ = shift;
129 if(defined($_)) { $$calling_convention = $_; }
131 return $$calling_convention;
134 sub name($;$)
136 my $self = shift;
137 my $name = \${$self->{NAME}};
139 local $_ = shift;
141 if(defined($_)) { $$name = $_; }
143 return $$name;
146 sub argument_types($;$)
148 my $self = shift;
149 my $argument_types = \${$self->{ARGUMENT_TYPES}};
151 local $_ = shift;
153 if(defined($_)) { $$argument_types = $_; }
155 return $$argument_types;
158 sub argument_names($;$)
160 my $self = shift;
161 my $argument_names = \${$self->{ARGUMENT_NAMES}};
163 local $_ = shift;
165 if(defined($_)) { $$argument_names = $_; }
167 return $$argument_names;
170 sub statements_line($;$)
172 my $self = shift;
173 my $statements_line = \${$self->{STATEMENTS_LINE}};
175 local $_ = shift;
177 if(defined($_)) { $$statements_line = $_; }
179 return $$statements_line;
182 sub statements_column($;$)
184 my $self = shift;
185 my $statements_column = \${$self->{STATEMENTS_COLUMN}};
187 local $_ = shift;
189 if(defined($_)) { $$statements_column = $_; }
191 return $$statements_column;
194 sub statements($;$)
196 my $self = shift;
197 my $statements = \${$self->{STATEMENTS}};
199 local $_ = shift;
201 if(defined($_)) { $$statements = $_; }
203 return $$statements;