line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
#
|
3
|
|
|
|
|
|
|
# Interface Definition Language (OMG IDL CORBA v3.0)
|
4
|
|
|
|
|
|
|
#
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package CORBA::XS::StubCVisitor;
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
5
|
use strict;
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
33
|
|
9
|
1
|
|
|
1
|
|
5
|
use POSIX qw(ctime);
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
5
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '0.62';
|
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
55
|
use CORBA::XS::CdrCVisitor;
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
25
|
|
14
|
1
|
|
|
1
|
|
3
|
use base qw(CORBA::XS::CdrCVisitor);
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
81
|
|
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
6
|
use File::Basename;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
11615
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# needs $node->{c_name} (CnameVisitor), $node->{c_literal} (CliteralVisitor)
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub new {
|
21
|
0
|
|
|
0
|
0
|
|
my $proto = shift;
|
22
|
0
|
|
0
|
|
|
|
my $class = ref($proto) || $proto;
|
23
|
0
|
|
|
|
|
|
my $self = {};
|
24
|
0
|
|
|
|
|
|
bless $self, $class;
|
25
|
0
|
|
|
|
|
|
my($parser,$incpath,$prefix) = @_;
|
26
|
0
|
|
0
|
|
|
|
$self->{incpath} = $incpath || q{};
|
27
|
|
|
|
|
|
|
# $prefix = 'skel_' unless (defined $prefix);
|
28
|
|
|
|
|
|
|
# $self->{prefix} = $prefix;
|
29
|
0
|
|
|
|
|
|
$self->{prefix} = q{};
|
30
|
0
|
|
|
|
|
|
$self->{srcname} = $parser->YYData->{srcname};
|
31
|
0
|
|
|
|
|
|
$self->{srcname_size} = $parser->YYData->{srcname_size};
|
32
|
0
|
|
|
|
|
|
$self->{srcname_mtime} = $parser->YYData->{srcname_mtime};
|
33
|
0
|
|
|
|
|
|
$self->{symbtab} = $parser->YYData->{symbtab};
|
34
|
0
|
|
|
|
|
|
$self->{server} = 1;
|
35
|
0
|
|
|
|
|
|
my $filename = 'cdr_' . basename($self->{srcname}, '.idl') . '.c';
|
36
|
0
|
|
|
|
|
|
$self->open_stream($filename);
|
37
|
0
|
|
|
|
|
|
$self->{done_hash} = {};
|
38
|
0
|
|
|
|
|
|
$self->{num_key} = 'num_c_stub';
|
39
|
0
|
|
|
|
|
|
return $self;
|
40
|
|
|
|
|
|
|
}
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub _get_c_decl_var {
|
43
|
0
|
|
|
0
|
|
|
my $self = shift;
|
44
|
0
|
|
|
|
|
|
my($type, $attr, $name) = @_;
|
45
|
|
|
|
|
|
|
|
46
|
0
|
0
|
0
|
|
|
|
if ( $type->isa('BasicType')
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
47
|
|
|
|
|
|
|
or $type->isa('EnumType')
|
48
|
|
|
|
|
|
|
or $type->isa('FixedPtType') ) {
|
49
|
0
|
0
|
|
|
|
|
if ( $attr eq 'in' ) {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
50
|
0
|
|
|
|
|
|
return $type->{c_name} . q{ } . $name;
|
51
|
|
|
|
|
|
|
}
|
52
|
|
|
|
|
|
|
elsif ( $attr eq 'inout' ) {
|
53
|
0
|
|
|
|
|
|
return $type->{c_name} . q{ } . $name;
|
54
|
|
|
|
|
|
|
}
|
55
|
|
|
|
|
|
|
elsif ( $attr eq 'out' ) {
|
56
|
0
|
|
|
|
|
|
return $type->{c_name} . q{ } . $name;
|
57
|
|
|
|
|
|
|
}
|
58
|
|
|
|
|
|
|
elsif ( $attr eq 'return' ) {
|
59
|
0
|
|
|
|
|
|
return $type->{c_name} . q{ } . $name;
|
60
|
|
|
|
|
|
|
}
|
61
|
|
|
|
|
|
|
}
|
62
|
|
|
|
|
|
|
elsif ( $type->isa('StructType')
|
63
|
|
|
|
|
|
|
or $type->isa('UnionType') ) {
|
64
|
0
|
0
|
|
|
|
|
if ( $attr eq 'in' ) {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
65
|
0
|
|
|
|
|
|
return $type->{c_name} . q{ } . $name;
|
66
|
|
|
|
|
|
|
}
|
67
|
|
|
|
|
|
|
elsif ( $attr eq 'inout' ) {
|
68
|
0
|
|
|
|
|
|
return $type->{c_name} . q{ } . $name;
|
69
|
|
|
|
|
|
|
}
|
70
|
|
|
|
|
|
|
elsif ( $attr eq 'out' ) {
|
71
|
0
|
0
|
|
|
|
|
if (defined $type->{length}) { # variable
|
72
|
0
|
|
|
|
|
|
return $type->{c_name} . ' * ' . $name;
|
73
|
|
|
|
|
|
|
}
|
74
|
|
|
|
|
|
|
else {
|
75
|
0
|
|
|
|
|
|
return $type->{c_name} . q{ } . $name;
|
76
|
|
|
|
|
|
|
}
|
77
|
|
|
|
|
|
|
}
|
78
|
|
|
|
|
|
|
elsif ( $attr eq 'return' ) {
|
79
|
0
|
0
|
|
|
|
|
if (defined $type->{length}) { # variable
|
80
|
0
|
|
|
|
|
|
return $type->{c_name} . ' * ' . $name;
|
81
|
|
|
|
|
|
|
}
|
82
|
|
|
|
|
|
|
else {
|
83
|
0
|
|
|
|
|
|
return $type->{c_name} . q{ } . $name;
|
84
|
|
|
|
|
|
|
}
|
85
|
|
|
|
|
|
|
}
|
86
|
|
|
|
|
|
|
}
|
87
|
|
|
|
|
|
|
elsif ( $type->isa('SequenceType') ) {
|
88
|
0
|
|
|
|
|
|
my $max = 0;
|
89
|
0
|
0
|
|
|
|
|
$max = $type->{max}->{c_literal} if (exists $type->{max});
|
90
|
0
|
0
|
|
|
|
|
if ( $attr eq 'in' ) {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
91
|
0
|
|
|
|
|
|
return $type->{c_name} . q{ } . $name;
|
92
|
|
|
|
|
|
|
}
|
93
|
|
|
|
|
|
|
elsif ( $attr eq 'inout' ) {
|
94
|
0
|
|
|
|
|
|
return $type->{c_name} . q{ } . $name;
|
95
|
|
|
|
|
|
|
}
|
96
|
|
|
|
|
|
|
elsif ( $attr eq 'out' ) {
|
97
|
0
|
|
|
|
|
|
return $type->{c_name} . ' * ' . $name;
|
98
|
|
|
|
|
|
|
}
|
99
|
|
|
|
|
|
|
elsif ( $attr eq 'return' ) {
|
100
|
0
|
|
|
|
|
|
return $type->{c_name} . ' * ' . $name;
|
101
|
|
|
|
|
|
|
}
|
102
|
|
|
|
|
|
|
}
|
103
|
|
|
|
|
|
|
elsif ( $type->isa('StringType')
|
104
|
|
|
|
|
|
|
or $type->isa('WideStringType') ) {
|
105
|
0
|
0
|
|
|
|
|
if ( $attr eq 'in' ) {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
106
|
0
|
|
|
|
|
|
return $type->{c_name} . q{ } . $name;
|
107
|
|
|
|
|
|
|
}
|
108
|
|
|
|
|
|
|
elsif ( $attr eq 'inout' ) {
|
109
|
0
|
|
|
|
|
|
return $type->{c_name} . q{ } . $name;
|
110
|
|
|
|
|
|
|
}
|
111
|
|
|
|
|
|
|
elsif ( $attr eq 'out' ) {
|
112
|
0
|
|
|
|
|
|
return $type->{c_name} . q{ } . $name;
|
113
|
|
|
|
|
|
|
}
|
114
|
|
|
|
|
|
|
elsif ( $attr eq 'return' ) {
|
115
|
0
|
|
|
|
|
|
return $type->{c_name} . '* ' . $name;
|
116
|
|
|
|
|
|
|
}
|
117
|
|
|
|
|
|
|
}
|
118
|
|
|
|
|
|
|
elsif ( $type->isa('TypeDeclarator') ) {
|
119
|
0
|
0
|
|
|
|
|
if (exists $type->{array_size}) {
|
120
|
0
|
|
|
|
|
|
warn "_get_c_decl_var TypeDeclarator $type->{idf} : empty array_size.\n"
|
121
|
0
|
0
|
|
|
|
|
unless (@{$type->{array_size}});
|
122
|
0
|
0
|
|
|
|
|
if ( $attr eq 'in' ) {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
123
|
0
|
|
|
|
|
|
return $type->{c_name} . q{ } . $name;
|
124
|
|
|
|
|
|
|
}
|
125
|
|
|
|
|
|
|
elsif ( $attr eq 'inout' ) {
|
126
|
0
|
|
|
|
|
|
return $type->{c_name} . q{ } . $name;
|
127
|
|
|
|
|
|
|
}
|
128
|
|
|
|
|
|
|
elsif ( $attr eq 'out' ) {
|
129
|
0
|
0
|
|
|
|
|
if (defined $type->{length}) { # variable
|
130
|
0
|
|
|
|
|
|
return $type->{c_name} . '_slice * ' . $name;
|
131
|
|
|
|
|
|
|
}
|
132
|
|
|
|
|
|
|
else {
|
133
|
0
|
|
|
|
|
|
return $type->{c_name} . q{ } . $name;
|
134
|
|
|
|
|
|
|
}
|
135
|
|
|
|
|
|
|
}
|
136
|
|
|
|
|
|
|
elsif ( $attr eq 'return' ) {
|
137
|
0
|
|
|
|
|
|
return $type->{c_name} . '_slice ' . $name;
|
138
|
|
|
|
|
|
|
}
|
139
|
|
|
|
|
|
|
}
|
140
|
|
|
|
|
|
|
else {
|
141
|
0
|
|
|
|
|
|
my $type = $type->{type};
|
142
|
0
|
0
|
|
|
|
|
unless (ref $type) {
|
143
|
0
|
|
|
|
|
|
$type = $self->{symbtab}->Lookup($type);
|
144
|
|
|
|
|
|
|
}
|
145
|
0
|
|
|
|
|
|
return $self->_get_c_decl_var($type, $attr, $name);
|
146
|
|
|
|
|
|
|
}
|
147
|
|
|
|
|
|
|
}
|
148
|
|
|
|
|
|
|
elsif ( $type->isa('NativeType') ) {
|
149
|
0
|
|
|
|
|
|
warn "_get_c_decl_var NativeType : not supplied \n";
|
150
|
0
|
|
|
|
|
|
return;
|
151
|
|
|
|
|
|
|
}
|
152
|
|
|
|
|
|
|
elsif ( $type->isa('BaseInterface')
|
153
|
|
|
|
|
|
|
or $type->isa('ForwardBaseInterface') ) {
|
154
|
0
|
|
|
|
|
|
warn "_get_c_decl_var BaseInterface : not supplied \n";
|
155
|
0
|
|
|
|
|
|
return;
|
156
|
|
|
|
|
|
|
}
|
157
|
|
|
|
|
|
|
elsif ( $type->isa('AnyType') ) {
|
158
|
0
|
|
|
|
|
|
warn "_get_c_decl_var AnyType : not supplied \n";
|
159
|
0
|
|
|
|
|
|
return;
|
160
|
|
|
|
|
|
|
}
|
161
|
|
|
|
|
|
|
else {
|
162
|
0
|
|
|
|
|
|
my $class = ref $type;
|
163
|
0
|
|
|
|
|
|
warn "Please implement '$class' in '_get_c_decl_var'.\n";
|
164
|
0
|
|
|
|
|
|
return;
|
165
|
|
|
|
|
|
|
}
|
166
|
|
|
|
|
|
|
}
|
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
sub _get_c_init_var {
|
169
|
0
|
|
|
0
|
|
|
my $self = shift;
|
170
|
0
|
|
|
|
|
|
my($type, $attr, $name) = @_;
|
171
|
|
|
|
|
|
|
|
172
|
0
|
0
|
0
|
|
|
|
if ( $type->isa('BasicType')
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
173
|
|
|
|
|
|
|
or $type->isa('EnumType') ) {
|
174
|
0
|
0
|
|
|
|
|
if ( $attr eq 'in' ) {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
175
|
0
|
|
|
|
|
|
return ();
|
176
|
|
|
|
|
|
|
}
|
177
|
|
|
|
|
|
|
elsif ( $attr eq 'inout' ) {
|
178
|
0
|
|
|
|
|
|
return ();
|
179
|
|
|
|
|
|
|
}
|
180
|
|
|
|
|
|
|
elsif ( $attr eq 'out' ) {
|
181
|
0
|
|
|
|
|
|
return ();
|
182
|
|
|
|
|
|
|
}
|
183
|
|
|
|
|
|
|
elsif ( $attr eq 'return' ) {
|
184
|
0
|
|
|
|
|
|
return ();
|
185
|
|
|
|
|
|
|
}
|
186
|
|
|
|
|
|
|
}
|
187
|
|
|
|
|
|
|
elsif ( $type->isa('FixedPtType') ) {
|
188
|
0
|
|
|
|
|
|
my $d = $type->{d}->{c_literal};
|
189
|
0
|
|
|
|
|
|
my $s = $type->{s}->{c_literal};
|
190
|
0
|
0
|
|
|
|
|
if ( $attr eq 'in' ) {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
191
|
|
|
|
|
|
|
return (
|
192
|
0
|
|
|
|
|
|
$name . '._digits = ' . $d,
|
193
|
|
|
|
|
|
|
$name . '._scale = ' . $s,
|
194
|
|
|
|
|
|
|
);
|
195
|
|
|
|
|
|
|
}
|
196
|
|
|
|
|
|
|
elsif ( $attr eq 'inout' ) {
|
197
|
|
|
|
|
|
|
return (
|
198
|
0
|
|
|
|
|
|
$name . '._digits = ' . $d,
|
199
|
|
|
|
|
|
|
$name . '._scale = ' . $s,
|
200
|
|
|
|
|
|
|
);
|
201
|
|
|
|
|
|
|
}
|
202
|
|
|
|
|
|
|
elsif ( $attr eq 'out' ) {
|
203
|
|
|
|
|
|
|
return (
|
204
|
0
|
|
|
|
|
|
$name . '._digits = ' . $d,
|
205
|
|
|
|
|
|
|
$name . '._scale = ' . $s,
|
206
|
|
|
|
|
|
|
);
|
207
|
|
|
|
|
|
|
}
|
208
|
|
|
|
|
|
|
elsif ( $attr eq 'return' ) {
|
209
|
|
|
|
|
|
|
return (
|
210
|
0
|
|
|
|
|
|
$name . '._digits = ' . $d,
|
211
|
|
|
|
|
|
|
$name . '._scale = ' . $s,
|
212
|
|
|
|
|
|
|
);
|
213
|
|
|
|
|
|
|
}
|
214
|
|
|
|
|
|
|
}
|
215
|
|
|
|
|
|
|
elsif ( $type->isa('BaseInterface')
|
216
|
|
|
|
|
|
|
or $type->isa('ForwardBaseInterface') ) {
|
217
|
0
|
|
|
|
|
|
warn "_get_c_init_var BaseInterface : not supplied \n";
|
218
|
0
|
|
|
|
|
|
return;
|
219
|
|
|
|
|
|
|
}
|
220
|
|
|
|
|
|
|
elsif ( $type->isa('StructType')
|
221
|
|
|
|
|
|
|
or $type->isa('UnionType') ) {
|
222
|
0
|
0
|
|
|
|
|
if ( $attr eq 'in' ) {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
223
|
0
|
|
|
|
|
|
return ();
|
224
|
|
|
|
|
|
|
}
|
225
|
|
|
|
|
|
|
elsif ( $attr eq 'inout' ) {
|
226
|
0
|
|
|
|
|
|
return ();
|
227
|
|
|
|
|
|
|
}
|
228
|
|
|
|
|
|
|
elsif ( $attr eq 'out' ) {
|
229
|
0
|
0
|
|
|
|
|
if (defined $type->{length}) { # variable
|
230
|
0
|
|
|
|
|
|
return ($name . ' = NULL');
|
231
|
|
|
|
|
|
|
}
|
232
|
|
|
|
|
|
|
else {
|
233
|
0
|
|
|
|
|
|
return ();
|
234
|
|
|
|
|
|
|
}
|
235
|
|
|
|
|
|
|
}
|
236
|
|
|
|
|
|
|
elsif ( $attr eq 'return' ) {
|
237
|
0
|
0
|
|
|
|
|
if (defined $type->{length}) { # variable
|
238
|
0
|
|
|
|
|
|
return ($name . ' = NULL');
|
239
|
|
|
|
|
|
|
}
|
240
|
|
|
|
|
|
|
else {
|
241
|
0
|
|
|
|
|
|
return ();
|
242
|
|
|
|
|
|
|
}
|
243
|
|
|
|
|
|
|
}
|
244
|
|
|
|
|
|
|
}
|
245
|
|
|
|
|
|
|
elsif ( $type->isa('SequenceType') ) {
|
246
|
0
|
|
|
|
|
|
my $max = 0;
|
247
|
0
|
0
|
|
|
|
|
$max = $type->{max}->{c_literal} if (exists $type->{max});
|
248
|
0
|
0
|
|
|
|
|
if ( $attr eq 'in' ) {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
249
|
|
|
|
|
|
|
return (
|
250
|
0
|
|
|
|
|
|
$name . '._maximum = ' . $max,
|
251
|
|
|
|
|
|
|
$name . '._length = 0',
|
252
|
|
|
|
|
|
|
$name . '._buffer = NULL'
|
253
|
|
|
|
|
|
|
);
|
254
|
|
|
|
|
|
|
}
|
255
|
|
|
|
|
|
|
elsif ( $attr eq 'inout' ) {
|
256
|
|
|
|
|
|
|
return (
|
257
|
0
|
|
|
|
|
|
$name . '._maximum = ' . $max,
|
258
|
|
|
|
|
|
|
$name . '._length = 0',
|
259
|
|
|
|
|
|
|
$name . '._buffer = NULL'
|
260
|
|
|
|
|
|
|
);
|
261
|
|
|
|
|
|
|
}
|
262
|
|
|
|
|
|
|
elsif ( $attr eq 'out' ) {
|
263
|
0
|
|
|
|
|
|
return ($name . ' = NULL');
|
264
|
|
|
|
|
|
|
}
|
265
|
|
|
|
|
|
|
elsif ( $attr eq 'return' ) {
|
266
|
0
|
|
|
|
|
|
return ($name . ' = NULL');
|
267
|
|
|
|
|
|
|
}
|
268
|
|
|
|
|
|
|
}
|
269
|
|
|
|
|
|
|
elsif ( $type->isa('StringType')
|
270
|
|
|
|
|
|
|
or $type->isa('WideStringType') ) {
|
271
|
0
|
0
|
|
|
|
|
if ( $attr eq 'in' ) {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
272
|
0
|
|
|
|
|
|
return ($name . ' = NULL');
|
273
|
|
|
|
|
|
|
}
|
274
|
|
|
|
|
|
|
elsif ( $attr eq 'inout' ) {
|
275
|
0
|
|
|
|
|
|
return ($name . ' = NULL');
|
276
|
|
|
|
|
|
|
}
|
277
|
|
|
|
|
|
|
elsif ( $attr eq 'out' ) {
|
278
|
0
|
|
|
|
|
|
return ($name . ' = NULL');
|
279
|
|
|
|
|
|
|
}
|
280
|
|
|
|
|
|
|
elsif ( $attr eq 'return' ) {
|
281
|
0
|
|
|
|
|
|
return ($name . ' = NULL');
|
282
|
|
|
|
|
|
|
}
|
283
|
|
|
|
|
|
|
}
|
284
|
|
|
|
|
|
|
elsif ( $type->isa('TypeDeclarator') ) {
|
285
|
0
|
0
|
|
|
|
|
if (exists $type->{array_size}) {
|
286
|
0
|
|
|
|
|
|
warn "_get_c_init_var TypeDeclarator $type->{idf} : empty array_size.\n"
|
287
|
0
|
0
|
|
|
|
|
unless (@{$type->{array_size}});
|
288
|
0
|
0
|
|
|
|
|
if ( $attr eq 'in' ) {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
289
|
0
|
|
|
|
|
|
return ();
|
290
|
|
|
|
|
|
|
}
|
291
|
|
|
|
|
|
|
elsif ( $attr eq 'inout' ) {
|
292
|
0
|
|
|
|
|
|
return ();
|
293
|
|
|
|
|
|
|
}
|
294
|
|
|
|
|
|
|
elsif ( $attr eq 'out' ) {
|
295
|
0
|
0
|
|
|
|
|
if (defined $type->{length}) { # variable
|
296
|
0
|
|
|
|
|
|
return ($name . ' = NULL');
|
297
|
|
|
|
|
|
|
}
|
298
|
|
|
|
|
|
|
else {
|
299
|
0
|
|
|
|
|
|
return ();
|
300
|
|
|
|
|
|
|
}
|
301
|
|
|
|
|
|
|
}
|
302
|
|
|
|
|
|
|
elsif ( $attr eq 'return' ) {
|
303
|
0
|
|
|
|
|
|
return ();
|
304
|
|
|
|
|
|
|
}
|
305
|
|
|
|
|
|
|
}
|
306
|
|
|
|
|
|
|
else {
|
307
|
0
|
|
|
|
|
|
my $type = $type->{type};
|
308
|
0
|
0
|
|
|
|
|
unless (ref $type) {
|
309
|
0
|
|
|
|
|
|
$type = $self->{symbtab}->Lookup($type);
|
310
|
|
|
|
|
|
|
}
|
311
|
0
|
|
|
|
|
|
return $self->_get_c_init_var($type, $attr, $name);
|
312
|
|
|
|
|
|
|
}
|
313
|
|
|
|
|
|
|
}
|
314
|
|
|
|
|
|
|
elsif ( $type->isa('NativeType') ) {
|
315
|
0
|
|
|
|
|
|
warn "_get_c_init_var NativeType : not supplied \n";
|
316
|
0
|
|
|
|
|
|
return;
|
317
|
|
|
|
|
|
|
}
|
318
|
|
|
|
|
|
|
elsif ( $type->isa('AnyType') ) {
|
319
|
0
|
|
|
|
|
|
warn "_get_c_init_var AnyType : not supplied \n";
|
320
|
0
|
|
|
|
|
|
return;
|
321
|
|
|
|
|
|
|
}
|
322
|
|
|
|
|
|
|
else {
|
323
|
0
|
|
|
|
|
|
my $class = ref $type;
|
324
|
0
|
|
|
|
|
|
warn "Please implement '$class' in '_get_c_init_var'.\n";
|
325
|
0
|
|
|
|
|
|
return;
|
326
|
|
|
|
|
|
|
}
|
327
|
|
|
|
|
|
|
}
|
328
|
|
|
|
|
|
|
|
329
|
|
|
|
|
|
|
sub _get_c_name_call {
|
330
|
0
|
|
|
0
|
|
|
my $self = shift;
|
331
|
0
|
|
|
|
|
|
my($type, $attr, $name) = @_;
|
332
|
|
|
|
|
|
|
|
333
|
0
|
0
|
0
|
|
|
|
if ( $type->isa('BasicType')
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
|
|
|
|
|
334
|
|
|
|
|
|
|
or $type->isa('EnumType') ) {
|
335
|
0
|
0
|
|
|
|
|
if ( $attr eq 'in' ) {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
336
|
0
|
|
|
|
|
|
return q{};
|
337
|
|
|
|
|
|
|
}
|
338
|
|
|
|
|
|
|
elsif ( $attr eq 'inout' ) {
|
339
|
0
|
|
|
|
|
|
return '&';
|
340
|
|
|
|
|
|
|
}
|
341
|
|
|
|
|
|
|
elsif ( $attr eq 'out' ) {
|
342
|
0
|
|
|
|
|
|
return '&';
|
343
|
|
|
|
|
|
|
}
|
344
|
|
|
|
|
|
|
elsif ( $attr eq 'return' ) {
|
345
|
0
|
|
|
|
|
|
return q{};
|
346
|
|
|
|
|
|
|
}
|
347
|
|
|
|
|
|
|
}
|
348
|
|
|
|
|
|
|
elsif ( $type->isa('BaseInterface')
|
349
|
|
|
|
|
|
|
or $type->isa('ForwardBaseInterface') ) {
|
350
|
0
|
|
|
|
|
|
warn "_get_c_name_call BaseInterface : not supplied \n";
|
351
|
0
|
|
|
|
|
|
return;
|
352
|
|
|
|
|
|
|
}
|
353
|
|
|
|
|
|
|
elsif ( $type->isa('StructType')
|
354
|
|
|
|
|
|
|
or $type->isa('UnionType')
|
355
|
|
|
|
|
|
|
or $type->isa('SequenceType')
|
356
|
|
|
|
|
|
|
or $type->isa('FixedPtType') ) {
|
357
|
0
|
0
|
|
|
|
|
if ( $attr eq 'in' ) {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
358
|
0
|
|
|
|
|
|
return '&';
|
359
|
|
|
|
|
|
|
}
|
360
|
|
|
|
|
|
|
elsif ( $attr eq 'inout' ) {
|
361
|
0
|
|
|
|
|
|
return '&';
|
362
|
|
|
|
|
|
|
}
|
363
|
|
|
|
|
|
|
elsif ( $attr eq 'out' ) {
|
364
|
0
|
|
|
|
|
|
return '&';
|
365
|
|
|
|
|
|
|
}
|
366
|
|
|
|
|
|
|
elsif ( $attr eq 'return' ) {
|
367
|
0
|
|
|
|
|
|
return q{};
|
368
|
|
|
|
|
|
|
}
|
369
|
|
|
|
|
|
|
}
|
370
|
|
|
|
|
|
|
elsif ( $type->isa('StringType')
|
371
|
|
|
|
|
|
|
or $type->isa('WideStringType') ) {
|
372
|
0
|
0
|
|
|
|
|
if ( $attr eq 'in' ) {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
373
|
0
|
|
|
|
|
|
return q{};
|
374
|
|
|
|
|
|
|
}
|
375
|
|
|
|
|
|
|
elsif ( $attr eq 'inout' ) {
|
376
|
0
|
|
|
|
|
|
return '&';
|
377
|
|
|
|
|
|
|
}
|
378
|
|
|
|
|
|
|
elsif ( $attr eq 'out' ) {
|
379
|
0
|
|
|
|
|
|
return '&';
|
380
|
|
|
|
|
|
|
}
|
381
|
|
|
|
|
|
|
elsif ( $attr eq 'return' ) {
|
382
|
0
|
|
|
|
|
|
return q{};
|
383
|
|
|
|
|
|
|
}
|
384
|
|
|
|
|
|
|
}
|
385
|
|
|
|
|
|
|
elsif ( $type->isa('TypeDeclarator') ) {
|
386
|
0
|
0
|
|
|
|
|
if (exists $type->{array_size}) {
|
387
|
0
|
|
|
|
|
|
warn "_get_c_name_call TypeDeclarator $type->{idf} : empty array_size.\n"
|
388
|
0
|
0
|
|
|
|
|
unless (@{$type->{array_size}});
|
389
|
0
|
0
|
|
|
|
|
if ( $attr eq 'in' ) {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
390
|
0
|
|
|
|
|
|
return q{};
|
391
|
|
|
|
|
|
|
}
|
392
|
|
|
|
|
|
|
elsif ( $attr eq 'inout' ) {
|
393
|
0
|
|
|
|
|
|
return q{};
|
394
|
|
|
|
|
|
|
}
|
395
|
|
|
|
|
|
|
elsif ( $attr eq 'out' ) {
|
396
|
0
|
0
|
|
|
|
|
if (defined $type->{length}) { # variable
|
397
|
0
|
|
|
|
|
|
return q{};
|
398
|
|
|
|
|
|
|
}
|
399
|
|
|
|
|
|
|
else {
|
400
|
0
|
|
|
|
|
|
return q{};
|
401
|
|
|
|
|
|
|
}
|
402
|
|
|
|
|
|
|
}
|
403
|
|
|
|
|
|
|
elsif ( $attr eq 'return' ) {
|
404
|
0
|
|
|
|
|
|
return q{};
|
405
|
|
|
|
|
|
|
}
|
406
|
|
|
|
|
|
|
}
|
407
|
|
|
|
|
|
|
else {
|
408
|
0
|
|
|
|
|
|
my $type = $type->{type};
|
409
|
0
|
0
|
|
|
|
|
unless (ref $type) {
|
410
|
0
|
|
|
|
|
|
$type = $self->{symbtab}->Lookup($type);
|
411
|
|
|
|
|
|
|
}
|
412
|
0
|
|
|
|
|
|
return $self->_get_c_name_call($type, $attr);
|
413
|
|
|
|
|
|
|
}
|
414
|
|
|
|
|
|
|
}
|
415
|
|
|
|
|
|
|
elsif ( $type->isa('NativeType') ) {
|
416
|
0
|
|
|
|
|
|
warn "_get_c_name_call NativeType : not supplied \n";
|
417
|
0
|
|
|
|
|
|
return;
|
418
|
|
|
|
|
|
|
}
|
419
|
|
|
|
|
|
|
elsif ( $type->isa('AnyType') ) {
|
420
|
0
|
|
|
|
|
|
warn "_get_c_name_call AnyType : not supplied \n";
|
421
|
0
|
|
|
|
|
|
return;
|
422
|
|
|
|
|
|
|
}
|
423
|
|
|
|
|
|
|
else {
|
424
|
0
|
|
|
|
|
|
my $class = ref $type;
|
425
|
0
|
|
|
|
|
|
warn "Please implement '$class' in '_get_c_name_call'.\n";
|
426
|
0
|
|
|
|
|
|
return;
|
427
|
|
|
|
|
|
|
}
|
428
|
|
|
|
|
|
|
}
|
429
|
|
|
|
|
|
|
|
430
|
|
|
|
|
|
|
sub _get_c_name_put {
|
431
|
0
|
|
|
0
|
|
|
my $self = shift;
|
432
|
0
|
|
|
|
|
|
my($type, $attr, $name) = @_;
|
433
|
|
|
|
|
|
|
|
434
|
0
|
0
|
0
|
|
|
|
if ( $type->isa('BasicType')
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
435
|
|
|
|
|
|
|
or $type->isa('EnumType')
|
436
|
|
|
|
|
|
|
or $type->isa('FixedPtType') ) {
|
437
|
0
|
0
|
|
|
|
|
if ( $attr eq 'inout' ) {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
438
|
0
|
|
|
|
|
|
return q{};
|
439
|
|
|
|
|
|
|
}
|
440
|
|
|
|
|
|
|
elsif ( $attr eq 'out' ) {
|
441
|
0
|
|
|
|
|
|
return q{};
|
442
|
|
|
|
|
|
|
}
|
443
|
|
|
|
|
|
|
elsif ( $attr eq 'return' ) {
|
444
|
0
|
|
|
|
|
|
return q{};
|
445
|
|
|
|
|
|
|
}
|
446
|
|
|
|
|
|
|
}
|
447
|
|
|
|
|
|
|
elsif ( $type->isa('BaseInterface')
|
448
|
|
|
|
|
|
|
or $type->isa('ForwardBaseInterface') ) {
|
449
|
0
|
|
|
|
|
|
warn "_get_c_name_put BaseInterface : not supplied \n";
|
450
|
0
|
|
|
|
|
|
return;
|
451
|
|
|
|
|
|
|
}
|
452
|
|
|
|
|
|
|
elsif ( $type->isa('StructType')
|
453
|
|
|
|
|
|
|
or $type->isa('UnionType') ) {
|
454
|
0
|
0
|
|
|
|
|
if ( $attr eq 'inout' ) {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
455
|
0
|
|
|
|
|
|
return q{};
|
456
|
|
|
|
|
|
|
}
|
457
|
|
|
|
|
|
|
elsif ( $attr eq 'out' ) {
|
458
|
0
|
0
|
|
|
|
|
if (defined $type->{length}) { # variable
|
459
|
0
|
|
|
|
|
|
return '*';
|
460
|
|
|
|
|
|
|
}
|
461
|
|
|
|
|
|
|
else {
|
462
|
0
|
|
|
|
|
|
return q{};
|
463
|
|
|
|
|
|
|
}
|
464
|
|
|
|
|
|
|
}
|
465
|
|
|
|
|
|
|
elsif ( $attr eq 'return' ) {
|
466
|
0
|
0
|
|
|
|
|
if (defined $type->{length}) { # variable
|
467
|
0
|
|
|
|
|
|
return '*';
|
468
|
|
|
|
|
|
|
}
|
469
|
|
|
|
|
|
|
else {
|
470
|
0
|
|
|
|
|
|
return q{};
|
471
|
|
|
|
|
|
|
}
|
472
|
|
|
|
|
|
|
}
|
473
|
|
|
|
|
|
|
}
|
474
|
|
|
|
|
|
|
elsif ( $type->isa('SequenceType') ) {
|
475
|
0
|
0
|
|
|
|
|
if ( $attr eq 'inout' ) {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
476
|
0
|
|
|
|
|
|
return q{};
|
477
|
|
|
|
|
|
|
}
|
478
|
|
|
|
|
|
|
elsif ( $attr eq 'out' ) {
|
479
|
0
|
|
|
|
|
|
return '*';
|
480
|
|
|
|
|
|
|
}
|
481
|
|
|
|
|
|
|
elsif ( $attr eq 'return' ) {
|
482
|
0
|
|
|
|
|
|
return '*';
|
483
|
|
|
|
|
|
|
}
|
484
|
|
|
|
|
|
|
}
|
485
|
|
|
|
|
|
|
elsif ( $type->isa('StringType')
|
486
|
|
|
|
|
|
|
or $type->isa('WideStringType') ) {
|
487
|
0
|
0
|
|
|
|
|
if ( $attr eq 'inout' ) {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
488
|
0
|
|
|
|
|
|
return q{};
|
489
|
|
|
|
|
|
|
}
|
490
|
|
|
|
|
|
|
elsif ( $attr eq 'out' ) {
|
491
|
0
|
|
|
|
|
|
return q{};
|
492
|
|
|
|
|
|
|
}
|
493
|
|
|
|
|
|
|
elsif ( $attr eq 'return' ) {
|
494
|
0
|
|
|
|
|
|
return '*';
|
495
|
|
|
|
|
|
|
}
|
496
|
|
|
|
|
|
|
}
|
497
|
|
|
|
|
|
|
elsif ( $type->isa('TypeDeclarator') ) {
|
498
|
0
|
0
|
|
|
|
|
if (exists $type->{array_size}) {
|
499
|
0
|
|
|
|
|
|
warn "_get_c_name_put TypeDeclarator $type->{idf} : empty array_size.\n"
|
500
|
0
|
0
|
|
|
|
|
unless (@{$type->{array_size}});
|
501
|
0
|
0
|
|
|
|
|
if ( $attr eq 'inout' ) {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
502
|
0
|
|
|
|
|
|
return q{};
|
503
|
|
|
|
|
|
|
}
|
504
|
|
|
|
|
|
|
elsif ( $attr eq 'out' ) {
|
505
|
0
|
|
|
|
|
|
return q{};
|
506
|
|
|
|
|
|
|
}
|
507
|
|
|
|
|
|
|
elsif ( $attr eq 'return' ) {
|
508
|
0
|
|
|
|
|
|
return q{};
|
509
|
|
|
|
|
|
|
}
|
510
|
|
|
|
|
|
|
}
|
511
|
|
|
|
|
|
|
else {
|
512
|
0
|
|
|
|
|
|
my $type = $type->{type};
|
513
|
0
|
0
|
|
|
|
|
unless (ref $type) {
|
514
|
0
|
|
|
|
|
|
$type = $self->{symbtab}->Lookup($type);
|
515
|
|
|
|
|
|
|
}
|
516
|
0
|
|
|
|
|
|
return $self->_get_c_name_put($type, $attr);
|
517
|
|
|
|
|
|
|
}
|
518
|
|
|
|
|
|
|
}
|
519
|
|
|
|
|
|
|
elsif ( $type->isa('NativeType') ) {
|
520
|
0
|
|
|
|
|
|
warn "_get_c_name_put NativeType : not supplied \n";
|
521
|
0
|
|
|
|
|
|
return;
|
522
|
|
|
|
|
|
|
}
|
523
|
|
|
|
|
|
|
elsif ( $type->isa('AnyType') ) {
|
524
|
0
|
|
|
|
|
|
warn "_get_c_name_put AnyType : not supplied \n";
|
525
|
0
|
|
|
|
|
|
return;
|
526
|
|
|
|
|
|
|
}
|
527
|
|
|
|
|
|
|
else {
|
528
|
0
|
|
|
|
|
|
my $class = ref $type;
|
529
|
0
|
|
|
|
|
|
warn "Please implement '$class' in '_get_c_name_put'.\n";
|
530
|
0
|
|
|
|
|
|
return;
|
531
|
|
|
|
|
|
|
}
|
532
|
|
|
|
|
|
|
}
|
533
|
|
|
|
|
|
|
|
534
|
|
|
|
|
|
|
sub _get_c_ptrname_get {
|
535
|
0
|
|
|
0
|
|
|
my $self = shift;
|
536
|
0
|
|
|
|
|
|
my($type, $attr, $name) = @_;
|
537
|
|
|
|
|
|
|
|
538
|
0
|
0
|
0
|
|
|
|
if ( $type->isa('BasicType')
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
539
|
|
|
|
|
|
|
or $type->isa('EnumType')
|
540
|
|
|
|
|
|
|
or $type->isa('FixedPtType') ) {
|
541
|
0
|
0
|
|
|
|
|
if ( $attr eq 'in' ) {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
542
|
0
|
|
|
|
|
|
return '&';
|
543
|
|
|
|
|
|
|
}
|
544
|
|
|
|
|
|
|
elsif ( $attr eq 'inout' ) {
|
545
|
0
|
|
|
|
|
|
return '&';
|
546
|
|
|
|
|
|
|
}
|
547
|
|
|
|
|
|
|
elsif ( $attr eq 'out' ) {
|
548
|
0
|
|
|
|
|
|
return '&';
|
549
|
|
|
|
|
|
|
}
|
550
|
|
|
|
|
|
|
elsif ( $attr eq 'return' ) {
|
551
|
0
|
|
|
|
|
|
return '&';
|
552
|
|
|
|
|
|
|
}
|
553
|
|
|
|
|
|
|
}
|
554
|
|
|
|
|
|
|
elsif ( $type->isa('BaseInterface')
|
555
|
|
|
|
|
|
|
or $type->isa('ForwardBaseInterface') ) {
|
556
|
0
|
|
|
|
|
|
warn "_get_c_ptrname_get BaseInterface : not supplied \n";
|
557
|
0
|
|
|
|
|
|
return;
|
558
|
|
|
|
|
|
|
}
|
559
|
|
|
|
|
|
|
elsif ( $type->isa('StructType')
|
560
|
|
|
|
|
|
|
or $type->isa('UnionType') ) {
|
561
|
0
|
0
|
|
|
|
|
if ( $attr eq 'in' ) {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
562
|
0
|
|
|
|
|
|
return '&';
|
563
|
|
|
|
|
|
|
}
|
564
|
|
|
|
|
|
|
elsif ( $attr eq 'inout' ) {
|
565
|
0
|
|
|
|
|
|
return '&';
|
566
|
|
|
|
|
|
|
}
|
567
|
|
|
|
|
|
|
elsif ( $attr eq 'out' ) {
|
568
|
0
|
0
|
|
|
|
|
if (defined $type->{length}) { # variable
|
569
|
0
|
|
|
|
|
|
return q{};
|
570
|
|
|
|
|
|
|
}
|
571
|
|
|
|
|
|
|
else {
|
572
|
0
|
|
|
|
|
|
return '&';
|
573
|
|
|
|
|
|
|
}
|
574
|
|
|
|
|
|
|
}
|
575
|
|
|
|
|
|
|
elsif ( $attr eq 'return' ) {
|
576
|
0
|
0
|
|
|
|
|
if (defined $type->{length}) { # variable
|
577
|
0
|
|
|
|
|
|
return q{};
|
578
|
|
|
|
|
|
|
}
|
579
|
|
|
|
|
|
|
else {
|
580
|
0
|
|
|
|
|
|
return '&';
|
581
|
|
|
|
|
|
|
}
|
582
|
|
|
|
|
|
|
}
|
583
|
|
|
|
|
|
|
}
|
584
|
|
|
|
|
|
|
elsif ( $type->isa('SequenceType') ) {
|
585
|
0
|
|
|
|
|
|
my $max = 0;
|
586
|
0
|
0
|
|
|
|
|
$max = $type->{max}->{c_literal} if (exists $type->{max});
|
587
|
0
|
0
|
|
|
|
|
if ( $attr eq 'in' ) {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
588
|
0
|
|
|
|
|
|
return '&';
|
589
|
|
|
|
|
|
|
}
|
590
|
|
|
|
|
|
|
elsif ( $attr eq 'inout' ) {
|
591
|
0
|
|
|
|
|
|
return '&';
|
592
|
|
|
|
|
|
|
}
|
593
|
|
|
|
|
|
|
elsif ( $attr eq 'out' ) {
|
594
|
0
|
|
|
|
|
|
return q{};
|
595
|
|
|
|
|
|
|
}
|
596
|
|
|
|
|
|
|
elsif ( $attr eq 'return' ) {
|
597
|
0
|
|
|
|
|
|
return q{};
|
598
|
|
|
|
|
|
|
}
|
599
|
|
|
|
|
|
|
}
|
600
|
|
|
|
|
|
|
elsif ( $type->isa('StringType')
|
601
|
|
|
|
|
|
|
or $type->isa('WideStringType') ) {
|
602
|
0
|
0
|
|
|
|
|
if ( $attr eq 'in' ) {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
603
|
0
|
|
|
|
|
|
return '&';
|
604
|
|
|
|
|
|
|
}
|
605
|
|
|
|
|
|
|
elsif ( $attr eq 'inout' ) {
|
606
|
0
|
|
|
|
|
|
return '&';
|
607
|
|
|
|
|
|
|
}
|
608
|
|
|
|
|
|
|
elsif ( $attr eq 'out' ) {
|
609
|
0
|
|
|
|
|
|
return '&';
|
610
|
|
|
|
|
|
|
}
|
611
|
|
|
|
|
|
|
elsif ( $attr eq 'return' ) {
|
612
|
0
|
|
|
|
|
|
return q{};
|
613
|
|
|
|
|
|
|
}
|
614
|
|
|
|
|
|
|
}
|
615
|
|
|
|
|
|
|
elsif ( $type->isa('TypeDeclarator') ) {
|
616
|
0
|
0
|
|
|
|
|
if (exists $type->{array_size}) {
|
617
|
0
|
|
|
|
|
|
warn "_get_c_ptrname_get TypeDeclarator $type->{idf} : empty array_size.\n"
|
618
|
0
|
0
|
|
|
|
|
unless (@{$type->{array_size}});
|
619
|
0
|
0
|
|
|
|
|
if ( $attr eq 'in' ) {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
620
|
0
|
|
|
|
|
|
return '&';
|
621
|
|
|
|
|
|
|
}
|
622
|
|
|
|
|
|
|
elsif ( $attr eq 'inout' ) {
|
623
|
0
|
|
|
|
|
|
return '&';
|
624
|
|
|
|
|
|
|
}
|
625
|
|
|
|
|
|
|
elsif ( $attr eq 'out' ) {
|
626
|
0
|
0
|
|
|
|
|
if (defined $type->{length}) { # variable
|
627
|
0
|
|
|
|
|
|
return '&';
|
628
|
|
|
|
|
|
|
}
|
629
|
|
|
|
|
|
|
else {
|
630
|
0
|
|
|
|
|
|
return '&';
|
631
|
|
|
|
|
|
|
}
|
632
|
|
|
|
|
|
|
}
|
633
|
|
|
|
|
|
|
elsif ( $attr eq 'return' ) {
|
634
|
0
|
|
|
|
|
|
return '&';
|
635
|
|
|
|
|
|
|
}
|
636
|
|
|
|
|
|
|
}
|
637
|
|
|
|
|
|
|
else {
|
638
|
0
|
|
|
|
|
|
my $type = $type->{type};
|
639
|
0
|
0
|
|
|
|
|
unless (ref $type) {
|
640
|
0
|
|
|
|
|
|
$type = $self->{symbtab}->Lookup($type);
|
641
|
|
|
|
|
|
|
}
|
642
|
0
|
|
|
|
|
|
return $self->_get_c_ptrname_get($type, $attr);
|
643
|
|
|
|
|
|
|
}
|
644
|
|
|
|
|
|
|
}
|
645
|
|
|
|
|
|
|
elsif ( $type->isa('NativeType') ) {
|
646
|
0
|
|
|
|
|
|
warn "_get_c_ptrname_get NativeType native : not supplied \n";
|
647
|
0
|
|
|
|
|
|
return;
|
648
|
|
|
|
|
|
|
}
|
649
|
|
|
|
|
|
|
elsif ( $type->isa('AnyType') ) {
|
650
|
0
|
|
|
|
|
|
warn "_get_c_ptrname_get AnyType : not supplied \n";
|
651
|
0
|
|
|
|
|
|
return;
|
652
|
|
|
|
|
|
|
}
|
653
|
|
|
|
|
|
|
else {
|
654
|
0
|
|
|
|
|
|
my $class = ref $type;
|
655
|
0
|
|
|
|
|
|
warn "Please implement '$class' in '_get_c_ptrname_get'.\n";
|
656
|
0
|
|
|
|
|
|
return;
|
657
|
|
|
|
|
|
|
}
|
658
|
|
|
|
|
|
|
}
|
659
|
|
|
|
|
|
|
|
660
|
|
|
|
|
|
|
#
|
661
|
|
|
|
|
|
|
# 3.5 OMG IDL Specification
|
662
|
|
|
|
|
|
|
#
|
663
|
|
|
|
|
|
|
|
664
|
|
|
|
|
|
|
sub visitSpecification {
|
665
|
0
|
|
|
0
|
0
|
|
my $self = shift;
|
666
|
0
|
|
|
|
|
|
my($node) = @_;
|
667
|
0
|
|
|
|
|
|
my $filename = $self->{prefix} . basename($self->{srcname}, '.idl') . '.h';
|
668
|
0
|
|
|
|
|
|
my $FH = $self->{out};
|
669
|
0
|
|
|
|
|
|
print $FH "/* ex: set ro: */\n";
|
670
|
0
|
|
|
|
|
|
print $FH "/* This file was generated (by ",$0,"). DO NOT modify it */\n";
|
671
|
0
|
|
|
|
|
|
print $FH "// From file : ",$self->{srcname},", ",$self->{srcname_size}," octets, ",POSIX::ctime($self->{srcname_mtime});
|
672
|
0
|
|
|
|
|
|
print $FH "\n";
|
673
|
0
|
|
|
|
|
|
print $FH "#include \n";
|
674
|
0
|
|
|
|
|
|
print $FH "#include <",$self->{incpath},"cdr.h>\n";
|
675
|
0
|
|
|
|
|
|
print $FH "#include \"",$filename,"\"\n";
|
676
|
0
|
|
|
|
|
|
print $FH "\n";
|
677
|
0
|
|
|
|
|
|
print $FH "\n";
|
678
|
0
|
|
|
|
|
|
foreach (@{$node->{list_decl}}) {
|
|
0
|
|
|
|
|
|
|
679
|
0
|
|
|
|
|
|
$self->_get_defn($_)->visit($self);
|
680
|
|
|
|
|
|
|
}
|
681
|
0
|
|
|
|
|
|
print $FH "/* end of file : ",$self->{filename}," */\n";
|
682
|
0
|
|
|
|
|
|
print $FH "\n";
|
683
|
0
|
|
|
|
|
|
print $FH "/*\n";
|
684
|
0
|
|
|
|
|
|
print $FH " * Local variables:\n";
|
685
|
0
|
|
|
|
|
|
print $FH " * buffer-read-only: t\n";
|
686
|
0
|
|
|
|
|
|
print $FH " * End:\n";
|
687
|
0
|
|
|
|
|
|
print $FH " */\n";
|
688
|
0
|
|
|
|
|
|
close $FH;
|
689
|
|
|
|
|
|
|
}
|
690
|
|
|
|
|
|
|
|
691
|
|
|
|
|
|
|
#
|
692
|
|
|
|
|
|
|
# 3.7 Module Declaration (inherited)
|
693
|
|
|
|
|
|
|
#
|
694
|
|
|
|
|
|
|
|
695
|
|
|
|
|
|
|
#
|
696
|
|
|
|
|
|
|
# 3.8 Interface Declaration
|
697
|
|
|
|
|
|
|
#
|
698
|
|
|
|
|
|
|
|
699
|
|
|
|
|
|
|
sub visitRegularInterface {
|
700
|
0
|
|
|
0
|
0
|
|
my $self = shift;
|
701
|
0
|
|
|
|
|
|
my($node) = @_;
|
702
|
0
|
|
|
|
|
|
my $FH = $self->{out};
|
703
|
0
|
|
|
|
|
|
print $FH "/*\n";
|
704
|
0
|
|
|
|
|
|
print $FH " * begin of interface ",$node->{c_name},"\n";
|
705
|
0
|
|
|
|
|
|
print $FH " */\n";
|
706
|
0
|
|
|
|
|
|
foreach (@{$node->{list_decl}}) {
|
|
0
|
|
|
|
|
|
|
707
|
0
|
|
|
|
|
|
my $defn = $self->_get_defn($_);
|
708
|
0
|
0
|
0
|
|
|
|
if ( $defn->isa('Operation')
|
709
|
|
|
|
|
|
|
or $defn->isa('Attributes') ) {
|
710
|
0
|
|
|
|
|
|
next;
|
711
|
|
|
|
|
|
|
}
|
712
|
0
|
|
|
|
|
|
$defn->visit($self);
|
713
|
|
|
|
|
|
|
}
|
714
|
0
|
|
|
|
|
|
print $FH "\n";
|
715
|
0
|
0
|
0
|
|
|
|
if ( $self->{srcname} eq $node->{filename}
|
|
0
|
|
|
|
|
|
|
716
|
|
|
|
|
|
|
and keys %{$node->{hash_attribute_operation}} ) {
|
717
|
0
|
|
|
|
|
|
$self->{itf} = $node->{c_name};
|
718
|
0
|
|
|
|
|
|
print $FH "\t\t/*-- functions --*/\n";
|
719
|
0
|
|
|
|
|
|
print $FH "\n";
|
720
|
0
|
|
|
|
|
|
foreach (values %{$node->{hash_attribute_operation}}) {
|
|
0
|
|
|
|
|
|
|
721
|
0
|
|
|
|
|
|
$self->_get_defn($_)->visit($self);
|
722
|
|
|
|
|
|
|
}
|
723
|
0
|
|
|
|
|
|
print $FH "\n";
|
724
|
|
|
|
|
|
|
}
|
725
|
0
|
|
|
|
|
|
print $FH "/*\n";
|
726
|
0
|
|
|
|
|
|
print $FH " * end of interface ",$node->{c_name},"\n";
|
727
|
0
|
|
|
|
|
|
print $FH " */\n";
|
728
|
0
|
|
|
|
|
|
print $FH "\n";
|
729
|
|
|
|
|
|
|
}
|
730
|
|
|
|
|
|
|
|
731
|
|
|
|
|
|
|
sub visitAbstractInterface {
|
732
|
|
|
|
|
|
|
# C mapping is aligned with CORBA 2.1
|
733
|
0
|
|
|
0
|
0
|
|
my $self = shift;
|
734
|
0
|
|
|
|
|
|
my($node) = @_;
|
735
|
0
|
|
|
|
|
|
my $FH = $self->{out};
|
736
|
0
|
|
|
|
|
|
print $FH "/*\n";
|
737
|
0
|
|
|
|
|
|
print $FH " * begin of interface ",$node->{c_name},"\n";
|
738
|
0
|
|
|
|
|
|
print $FH " */\n";
|
739
|
0
|
|
|
|
|
|
foreach (@{$node->{list_decl}}) {
|
|
0
|
|
|
|
|
|
|
740
|
0
|
|
|
|
|
|
my $defn = $self->_get_defn($_);
|
741
|
0
|
0
|
0
|
|
|
|
if ( $defn->isa('Operation')
|
742
|
|
|
|
|
|
|
or $defn->isa('Attributes') ) {
|
743
|
0
|
|
|
|
|
|
next;
|
744
|
|
|
|
|
|
|
}
|
745
|
0
|
|
|
|
|
|
$defn->visit($self);
|
746
|
|
|
|
|
|
|
}
|
747
|
0
|
|
|
|
|
|
print $FH "\n";
|
748
|
0
|
|
|
|
|
|
print $FH "/*\n";
|
749
|
0
|
|
|
|
|
|
print $FH " * end of interface ",$node->{c_name},"\n";
|
750
|
0
|
|
|
|
|
|
print $FH " */\n";
|
751
|
0
|
|
|
|
|
|
print $FH "\n";
|
752
|
|
|
|
|
|
|
}
|
753
|
|
|
|
|
|
|
|
754
|
|
|
|
|
|
|
#
|
755
|
|
|
|
|
|
|
# 3.9 Value Declaration (inherited)
|
756
|
|
|
|
|
|
|
#
|
757
|
|
|
|
|
|
|
|
758
|
|
|
|
|
|
|
#
|
759
|
|
|
|
|
|
|
# 3.10 Constant Declaration (inherited)
|
760
|
|
|
|
|
|
|
#
|
761
|
|
|
|
|
|
|
|
762
|
|
|
|
|
|
|
#
|
763
|
|
|
|
|
|
|
# 3.11 Type Declaration (inherited)
|
764
|
|
|
|
|
|
|
#
|
765
|
|
|
|
|
|
|
|
766
|
|
|
|
|
|
|
#
|
767
|
|
|
|
|
|
|
# 3.12 Exception Declaration (inherited)
|
768
|
|
|
|
|
|
|
#
|
769
|
|
|
|
|
|
|
|
770
|
|
|
|
|
|
|
#
|
771
|
|
|
|
|
|
|
# 3.13 Operation Declaration
|
772
|
|
|
|
|
|
|
#
|
773
|
|
|
|
|
|
|
|
774
|
|
|
|
|
|
|
sub visitOperation {
|
775
|
0
|
|
|
0
|
0
|
|
my $self = shift;
|
776
|
0
|
|
|
|
|
|
my($node) = @_;
|
777
|
0
|
|
|
|
|
|
my $FH = $self->{out};
|
778
|
0
|
|
|
|
|
|
my $label_err = undef;
|
779
|
0
|
|
|
|
|
|
my $nb_param_out = 0;
|
780
|
0
|
|
|
|
|
|
my $nb_param_in = 0;
|
781
|
0
|
|
|
|
|
|
my $type = $self->_get_defn($node->{type});
|
782
|
0
|
0
|
|
|
|
|
unless ($type->isa('VoidType')) { # return
|
783
|
0
|
|
|
|
|
|
$label_err = $type->{length};
|
784
|
0
|
|
|
|
|
|
$nb_param_out ++;
|
785
|
0
|
|
|
|
|
|
$node->{c_put_name} = $self->_get_c_name_put($type, 'return') . '_ret';
|
786
|
|
|
|
|
|
|
}
|
787
|
0
|
|
|
|
|
|
foreach (@{$node->{list_in}}) { # parameter
|
|
0
|
|
|
|
|
|
|
788
|
0
|
|
|
|
|
|
$type = $self->_get_defn($_->{type});
|
789
|
0
|
|
|
|
|
|
$_->{c_get_ptr_name} = $self->_get_c_ptrname_get($type, $_->{attr}) . $_->{c_name};
|
790
|
0
|
|
0
|
|
|
|
$label_err ||= $type->{length};
|
791
|
0
|
|
|
|
|
|
$nb_param_in ++;
|
792
|
|
|
|
|
|
|
}
|
793
|
0
|
|
|
|
|
|
foreach (@{$node->{list_inout}}) { # parameter
|
|
0
|
|
|
|
|
|
|
794
|
0
|
|
|
|
|
|
$type = $self->_get_defn($_->{type});
|
795
|
0
|
|
|
|
|
|
$_->{c_get_ptr_name} = $self->_get_c_ptrname_get($type, $_->{attr}) . $_->{c_name};
|
796
|
0
|
|
|
|
|
|
$_->{c_put_name} = $self->_get_c_name_put($type, $_->{attr}) . $_->{c_name};
|
797
|
0
|
|
0
|
|
|
|
$label_err ||= $type->{length};
|
798
|
0
|
|
|
|
|
|
$nb_param_in ++;
|
799
|
0
|
|
|
|
|
|
$nb_param_out ++;
|
800
|
|
|
|
|
|
|
}
|
801
|
0
|
|
|
|
|
|
foreach (@{$node->{list_out}}) { # parameter
|
|
0
|
|
|
|
|
|
|
802
|
0
|
|
|
|
|
|
$type = $self->_get_defn($_->{type});
|
803
|
0
|
|
|
|
|
|
$_->{c_get_ptr_name} = $self->_get_c_ptrname_get($type, $_->{attr}) . $_->{c_name};
|
804
|
0
|
|
|
|
|
|
$_->{c_put_name} = $self->_get_c_name_put($type, $_->{attr}) . $_->{c_name};
|
805
|
0
|
|
|
|
|
|
$nb_param_out ++;
|
806
|
|
|
|
|
|
|
}
|
807
|
0
|
|
|
|
|
|
my $nb_user_except = 0;
|
808
|
0
|
0
|
|
|
|
|
$nb_user_except = @{$node->{list_raise}} if (exists $node->{list_raise});
|
|
0
|
|
|
|
|
|
|
809
|
0
|
|
|
|
|
|
print $FH "\n";
|
810
|
0
|
0
|
|
|
|
|
if (exists $node->{modifier}) { # oneway
|
811
|
0
|
|
|
|
|
|
print $FH "void cdr_",$self->{itf},"_",$node->{c_name},"(void * _ref, char *_is)\n";
|
812
|
|
|
|
|
|
|
}
|
813
|
|
|
|
|
|
|
else {
|
814
|
0
|
|
|
|
|
|
print $FH "int cdr_",$self->{itf},"_",$node->{c_name},"(void * _ref, char *_is, char **_os)\n";
|
815
|
|
|
|
|
|
|
}
|
816
|
0
|
|
|
|
|
|
print $FH "{\n";
|
817
|
0
|
|
|
|
|
|
print $FH "\tCORBA_Environment _Ev;\n";
|
818
|
0
|
|
|
|
|
|
$type = $self->_get_defn($node->{type});
|
819
|
0
|
0
|
|
|
|
|
unless ($type->isa('VoidType')) {
|
820
|
0
|
|
|
|
|
|
print $FH "\t",$self->_get_c_decl_var($type, 'return', '_ret'),";\n";
|
821
|
|
|
|
|
|
|
}
|
822
|
0
|
|
|
|
|
|
foreach (@{$node->{list_param}}) { # parameter
|
|
0
|
|
|
|
|
|
|
823
|
0
|
|
|
|
|
|
$type = $self->_get_defn($_->{type});
|
824
|
0
|
|
|
|
|
|
print $FH "\t",$self->_get_c_decl_var($type, $_->{attr}, $_->{c_name}),";\n";
|
825
|
|
|
|
|
|
|
}
|
826
|
0
|
0
|
0
|
|
|
|
if ($nb_param_in or $nb_param_out or $nb_user_except) {
|
|
|
|
0
|
|
|
|
|
827
|
0
|
|
|
|
|
|
print $FH "\tCORBA_char *_p;\n";
|
828
|
0
|
|
|
|
|
|
print $FH "\tunsigned _align = 4;\n";
|
829
|
|
|
|
|
|
|
}
|
830
|
0
|
0
|
|
|
|
|
unless (exists $node->{modifier}) { # oneway
|
831
|
0
|
|
|
|
|
|
print $FH "\tint _size = 0;\n";
|
832
|
|
|
|
|
|
|
}
|
833
|
0
|
|
|
|
|
|
print $FH "\n";
|
834
|
0
|
|
|
|
|
|
$type = $self->_get_defn($node->{type});
|
835
|
0
|
0
|
|
|
|
|
unless ($type->isa('VoidType')) {
|
836
|
0
|
|
|
|
|
|
my @init = $self->_get_c_init_var($type, 'return', '_ret');
|
837
|
0
|
|
|
|
|
|
foreach (@init) {
|
838
|
0
|
|
|
|
|
|
print $FH "\t",$_,";\n";
|
839
|
|
|
|
|
|
|
}
|
840
|
|
|
|
|
|
|
}
|
841
|
0
|
|
|
|
|
|
foreach (@{$node->{list_param}}) { # parameter
|
|
0
|
|
|
|
|
|
|
842
|
0
|
|
|
|
|
|
$type = $self->_get_defn($_->{type});
|
843
|
0
|
|
|
|
|
|
my @init = $self->_get_c_init_var($type, $_->{attr}, $_->{c_name});
|
844
|
0
|
|
|
|
|
|
foreach (@init) {
|
845
|
0
|
|
|
|
|
|
print $FH "\t",$_,";\n";
|
846
|
|
|
|
|
|
|
}
|
847
|
|
|
|
|
|
|
}
|
848
|
0
|
|
|
|
|
|
print $FH "\tmemset(&_Ev, 0, sizeof _Ev);\n";
|
849
|
0
|
0
|
|
|
|
|
if ($nb_param_in) {
|
850
|
0
|
|
|
|
|
|
print $FH "\t_p = _is;\n";
|
851
|
0
|
|
|
|
|
|
foreach (@{$node->{list_param}}) { # parameter
|
|
0
|
|
|
|
|
|
|
852
|
0
|
0
|
0
|
|
|
|
if ( $_->{attr} eq 'in'
|
853
|
|
|
|
|
|
|
or $_->{attr} eq 'inout' ) {
|
854
|
0
|
|
|
|
|
|
$type = $self->_get_defn($_->{type});
|
855
|
0
|
|
|
|
|
|
print $FH "\tGET_",$type->{c_name},"(_p,",$_->{c_get_ptr_name},");\n";
|
856
|
|
|
|
|
|
|
}
|
857
|
|
|
|
|
|
|
}
|
858
|
0
|
|
|
|
|
|
print $FH "\n";
|
859
|
|
|
|
|
|
|
}
|
860
|
0
|
|
|
|
|
|
$type = $self->_get_defn($node->{type});
|
861
|
0
|
0
|
|
|
|
|
if ($type->isa('VoidType')) {
|
862
|
0
|
|
|
|
|
|
print $FH "\t",$self->{prefix},$self->{itf},"_",$node->{c_name},"(\n";
|
863
|
|
|
|
|
|
|
}
|
864
|
|
|
|
|
|
|
else {
|
865
|
0
|
|
|
|
|
|
print $FH "\t",$self->_get_c_name_call($type, 'return'),"_ret = ";
|
866
|
0
|
|
|
|
|
|
print $FH $self->{prefix},$self->{itf},"_",$node->{c_name},"(\n";
|
867
|
|
|
|
|
|
|
}
|
868
|
0
|
|
|
|
|
|
print $FH "\t\t_ref,\n";
|
869
|
0
|
|
|
|
|
|
foreach (@{$node->{list_param}}) {
|
|
0
|
|
|
|
|
|
|
870
|
0
|
|
|
|
|
|
$type = $self->_get_defn($_->{type});
|
871
|
0
|
|
|
|
|
|
print $FH "\t\t",$self->_get_c_name_call($type, $_->{attr}),$_->{c_name},",";
|
872
|
0
|
0
|
|
|
|
|
print $FH " /* ",$_->{attr}," (variable length) */\n" if (defined $type->{length});
|
873
|
0
|
0
|
|
|
|
|
print $FH " /* ",$_->{attr}," (fixed length) */\n" unless (defined $type->{length});
|
874
|
|
|
|
|
|
|
}
|
875
|
0
|
|
|
|
|
|
print $FH "\t\t&_Ev\n";
|
876
|
0
|
|
|
|
|
|
print $FH "\t);\n";
|
877
|
0
|
0
|
|
|
|
|
unless (exists $node->{modifier}) { # oneway
|
878
|
0
|
|
|
|
|
|
print $FH "\n";
|
879
|
0
|
|
|
|
|
|
print $FH "\tif (CORBA_NO_EXCEPTION == _Ev._major)\n";
|
880
|
0
|
|
|
|
|
|
print $FH "\t{\n";
|
881
|
0
|
|
|
|
|
|
print $FH "\t\t_align = 4;\n";
|
882
|
0
|
|
|
|
|
|
print $FH "\t\tADD_SIZE_CORBA_long(_size,CORBA_NO_EXCEPTION);\n";
|
883
|
0
|
0
|
|
|
|
|
if ($nb_param_out) {
|
884
|
0
|
|
|
|
|
|
$type = $self->_get_defn($node->{type});
|
885
|
0
|
0
|
|
|
|
|
unless ($type->isa('VoidType')) {
|
886
|
0
|
|
|
|
|
|
print $FH "\t\tADD_SIZE_",$type->{c_name},"(_size,",$node->{c_put_name},");\n";
|
887
|
|
|
|
|
|
|
}
|
888
|
0
|
|
|
|
|
|
foreach (@{$node->{list_param}}) { # parameter
|
|
0
|
|
|
|
|
|
|
889
|
0
|
0
|
0
|
|
|
|
if ( $_->{attr} eq 'inout'
|
890
|
|
|
|
|
|
|
or $_->{attr} eq 'out' ) {
|
891
|
0
|
|
|
|
|
|
$type = $self->_get_defn($_->{type});
|
892
|
0
|
|
|
|
|
|
print $FH "\t\tADD_SIZE_",$type->{c_name},"(_size,",$_->{c_put_name},");\n";
|
893
|
|
|
|
|
|
|
}
|
894
|
|
|
|
|
|
|
}
|
895
|
|
|
|
|
|
|
}
|
896
|
0
|
|
|
|
|
|
print $FH "\n";
|
897
|
0
|
|
|
|
|
|
print $FH "\t\tif (NULL == (*_os = CORBA_alloc(_size)))\n";
|
898
|
0
|
|
|
|
|
|
print $FH "\t\t{\n";
|
899
|
0
|
|
|
|
|
|
print $FH "\t\t\treturn -1;\n";
|
900
|
0
|
|
|
|
|
|
print $FH "\t\t}\n";
|
901
|
0
|
|
|
|
|
|
print $FH "\t\telse\n";
|
902
|
0
|
|
|
|
|
|
print $FH "\t\t{\n";
|
903
|
0
|
|
|
|
|
|
print $FH "\t\t\t_align = 4;\n";
|
904
|
0
|
|
|
|
|
|
print $FH "\t\t\t_p = *_os;\n";
|
905
|
0
|
|
|
|
|
|
print $FH "\t\t\tPUT_CORBA_long(_p,CORBA_NO_EXCEPTION);\n";
|
906
|
0
|
0
|
|
|
|
|
if ($nb_param_out) {
|
907
|
0
|
|
|
|
|
|
$type = $self->_get_defn($node->{type});
|
908
|
0
|
0
|
|
|
|
|
unless ($type->isa('VoidType')) {
|
909
|
0
|
|
|
|
|
|
print $FH "\t\t\tPUT_",$type->{c_name},"(_p,",$node->{c_put_name},");\n";
|
910
|
|
|
|
|
|
|
}
|
911
|
0
|
|
|
|
|
|
foreach (@{$node->{list_param}}) { # parameter
|
|
0
|
|
|
|
|
|
|
912
|
0
|
0
|
0
|
|
|
|
if ( $_->{attr} eq 'inout'
|
913
|
|
|
|
|
|
|
or $_->{attr} eq 'out' ) {
|
914
|
0
|
|
|
|
|
|
$type = $self->_get_defn($_->{type});
|
915
|
0
|
|
|
|
|
|
print $FH "\t\t\tPUT_",$type->{c_name},"(_p,",$_->{c_put_name},");\n";
|
916
|
|
|
|
|
|
|
}
|
917
|
|
|
|
|
|
|
}
|
918
|
|
|
|
|
|
|
}
|
919
|
0
|
|
|
|
|
|
print $FH "\t\t}\n";
|
920
|
0
|
|
|
|
|
|
print $FH "\t}\n";
|
921
|
0
|
0
|
|
|
|
|
if (exists $node->{list_raise}) {
|
922
|
0
|
|
|
|
|
|
print $FH "\telse if (CORBA_USER_EXCEPTION == _Ev._major)\n";
|
923
|
0
|
|
|
|
|
|
print $FH "\t{\n";
|
924
|
0
|
|
|
|
|
|
my $condition = "if ";
|
925
|
0
|
|
|
|
|
|
foreach (@{$node->{list_raise}}) {
|
|
0
|
|
|
|
|
|
|
926
|
0
|
|
|
|
|
|
my $defn = $self->_get_defn($_);
|
927
|
0
|
0
|
|
|
|
|
if ($nb_user_except > 1) {
|
928
|
0
|
|
|
|
|
|
print $FH "\t\t",$condition,"(0 == strcmp(ex_",$defn->{c_name},",CORBA_exception_id(&_Ev)))\n";
|
929
|
0
|
|
|
|
|
|
print $FH "\t\t{\n";
|
930
|
|
|
|
|
|
|
}
|
931
|
0
|
0
|
|
|
|
|
print $FH "\t\t\t",$defn->{c_name}," * _",$defn->{c_name}," = CORBA_exception_value(&_Ev);\n"
|
932
|
|
|
|
|
|
|
if (exists $defn->{list_expr});
|
933
|
0
|
|
|
|
|
|
print $FH "\t\t\t_align = 4;\n";
|
934
|
0
|
|
|
|
|
|
print $FH "\t\t\tADD_SIZE_CORBA_long(_size,CORBA_USER_EXCEPTION);\n";
|
935
|
0
|
|
|
|
|
|
print $FH "\t\t\tADD_SIZE_CORBA_string(_size,ex_",$defn->{c_name},");\n";
|
936
|
0
|
0
|
|
|
|
|
print $FH "\t\t\tADD_SIZE_",$defn->{c_name},"(_size,*_",$defn->{c_name},");\n"
|
937
|
|
|
|
|
|
|
if (exists $defn->{list_expr});
|
938
|
0
|
|
|
|
|
|
print $FH "\n";
|
939
|
0
|
|
|
|
|
|
print $FH "\t\t\tif (NULL == (*_os = CORBA_alloc(_size)))\n";
|
940
|
0
|
|
|
|
|
|
print $FH "\t\t\t{\n";
|
941
|
0
|
|
|
|
|
|
print $FH "\t\t\t\treturn -1;\n";
|
942
|
0
|
|
|
|
|
|
print $FH "\t\t\t}\n";
|
943
|
0
|
|
|
|
|
|
print $FH "\t\t\telse\n";
|
944
|
0
|
|
|
|
|
|
print $FH "\t\t\t{\n";
|
945
|
0
|
|
|
|
|
|
print $FH "\t\t\t\t_align = 4;\n";
|
946
|
0
|
|
|
|
|
|
print $FH "\t\t\t\t_p = *_os;\n";
|
947
|
0
|
|
|
|
|
|
print $FH "\t\t\t\tPUT_CORBA_long(_p,CORBA_USER_EXCEPTION);\n";
|
948
|
0
|
|
|
|
|
|
print $FH "\t\t\t\tPUT_CORBA_string(_p,ex_",$defn->{c_name},");\n";
|
949
|
0
|
0
|
|
|
|
|
print $FH "\t\t\t\tPUT_",$defn->{c_name},"(_p,*_",$defn->{c_name},");\n"
|
950
|
|
|
|
|
|
|
if (exists $defn->{list_expr});
|
951
|
0
|
|
|
|
|
|
print $FH "\t\t\t}\n";
|
952
|
0
|
|
|
|
|
|
$condition = "else if ";
|
953
|
0
|
0
|
|
|
|
|
if ($nb_user_except > 1) {
|
954
|
0
|
|
|
|
|
|
print $FH "\t\t}\n";
|
955
|
|
|
|
|
|
|
}
|
956
|
|
|
|
|
|
|
}
|
957
|
0
|
|
|
|
|
|
print $FH "\t}\n";
|
958
|
|
|
|
|
|
|
}
|
959
|
0
|
|
|
|
|
|
print $FH "\telse if (CORBA_SYSTEM_EXCEPTION == _Ev._major)\n";
|
960
|
0
|
|
|
|
|
|
print $FH "\t{\n";
|
961
|
0
|
|
|
|
|
|
print $FH "\t\tCORBA_SystemException *_pSE;\n";
|
962
|
0
|
|
|
|
|
|
print $FH "\t\t_pSE = CORBA_exception_value(&_Ev);\n";
|
963
|
0
|
|
|
|
|
|
print $FH "\t\t_align = 4;\n";
|
964
|
0
|
|
|
|
|
|
print $FH "\t\tADD_SIZE_CORBA_long(_size,CORBA_SYSTEM_EXCEPTION);\n";
|
965
|
0
|
|
|
|
|
|
print $FH "\t\tADD_SIZE_CORBA_string(_size,CORBA_exception_id(&_Ev));\n";
|
966
|
0
|
|
|
|
|
|
print $FH "\t\tADD_SIZE_CORBA_long(_size,_pSE->minor);\n";
|
967
|
0
|
|
|
|
|
|
print $FH "\t\tADD_SIZE_CORBA_long(_size,_pSE->completed);\n";
|
968
|
0
|
|
|
|
|
|
print $FH "\t\tif (NULL == (*_os = CORBA_alloc(4)))\n";
|
969
|
0
|
|
|
|
|
|
print $FH "\t\t{\n";
|
970
|
0
|
|
|
|
|
|
print $FH "\t\t\treturn -1;\n";
|
971
|
0
|
|
|
|
|
|
print $FH "\t\t}\n";
|
972
|
0
|
|
|
|
|
|
print $FH "\t\telse\n";
|
973
|
0
|
|
|
|
|
|
print $FH "\t\t{\n";
|
974
|
0
|
|
|
|
|
|
print $FH "\t\t\t_align = 4;\n";
|
975
|
0
|
|
|
|
|
|
print $FH "\t\t\t_p = *_os;\n";
|
976
|
0
|
|
|
|
|
|
print $FH "\t\t\tPUT_CORBA_long(_p,CORBA_SYSTEM_EXCEPTION);\n";
|
977
|
0
|
|
|
|
|
|
print $FH "\t\t\tPUT_CORBA_string(_p,CORBA_exception_id(&_Ev));\n";
|
978
|
0
|
|
|
|
|
|
print $FH "\t\t\tPUT_CORBA_long(_p,_pSE->minor);\n";
|
979
|
0
|
|
|
|
|
|
print $FH "\t\t\tPUT_CORBA_long(_p,_pSE->completed);\n";
|
980
|
0
|
|
|
|
|
|
print $FH "\t\t}\n";
|
981
|
0
|
|
|
|
|
|
print $FH "\t}\n";
|
982
|
0
|
|
|
|
|
|
print $FH "\treturn _size;\n";
|
983
|
|
|
|
|
|
|
}
|
984
|
0
|
0
|
|
|
|
|
if ($label_err) {
|
985
|
0
|
|
|
|
|
|
print $FH "\n";
|
986
|
0
|
|
|
|
|
|
print $FH "err:\n";
|
987
|
0
|
|
|
|
|
|
foreach (@{$node->{list_param}}) { # parameter
|
|
0
|
|
|
|
|
|
|
988
|
0
|
|
|
|
|
|
$type = $self->_get_defn($_->{type});
|
989
|
0
|
0
|
|
|
|
|
print $FH "\tFREE_",$_->{attr},"_",$type->{c_name},"(",$_->{c_get_ptr_name},");\n"
|
990
|
|
|
|
|
|
|
if (defined $type->{length});
|
991
|
|
|
|
|
|
|
}
|
992
|
0
|
0
|
|
|
|
|
unless (exists $node->{modifier}) { # oneway
|
993
|
0
|
|
|
|
|
|
print $FH "\treturn -1;\n";
|
994
|
|
|
|
|
|
|
}
|
995
|
|
|
|
|
|
|
}
|
996
|
0
|
|
|
|
|
|
print $FH "}\n";
|
997
|
|
|
|
|
|
|
}
|
998
|
|
|
|
|
|
|
|
999
|
|
|
|
|
|
|
#
|
1000
|
|
|
|
|
|
|
# 3.14 Attribute Declaration (inherited)
|
1001
|
|
|
|
|
|
|
#
|
1002
|
|
|
|
|
|
|
|
1003
|
|
|
|
|
|
|
1;
|
1004
|
|
|
|
|
|
|
|