-
Notifications
You must be signed in to change notification settings - Fork 0
/
swig-pointers.ads
408 lines (316 loc) · 18 KB
/
swig-pointers.ads
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
with
interfaces.C.Pointers,
interfaces.C.Strings,
system.Address_to_Access_conversions;
package swig.Pointers
--
-- Contains pointers to Swig related C type definitions not available in the 'interfaces.C' family.
--
is
use Interfaces;
------------
-- void_ptr
--
package C_void_ptr_Pointers is new C.Pointers (Index => C.size_t,
Element => swig.void_ptr,
element_Array => void_ptr_Array,
default_Terminator => system.null_Address);
subtype void_ptr_Pointer is C_void_ptr_Pointers.Pointer;
---------------------
-- opaque struct_ptr
--
type opaque_structure_ptr is access swig.opaque_structure;
type opaque_structure_ptr_array is array (C.Size_t range <>) of aliased opaque_structure_ptr;
package C_opaque_structure_ptr_Pointers is new C.Pointers (Index => C.size_t,
Element => opaque_structure_ptr,
element_Array => opaque_structure_ptr_array,
default_Terminator => null);
subtype opaque_structure_ptr_Pointer is C_opaque_structure_ptr_Pointers.Pointer;
--------------------
-- incomplete class
--
type incomplete_class_ptr is access swig.incomplete_class;
type incomplete_class_ptr_array is array (C.Size_t range <>) of aliased incomplete_class_ptr;
package C_incomplete_class_ptr_Pointers is new C.Pointers (Index => C.size_t,
Element => incomplete_class_ptr,
element_Array => incomplete_class_ptr_array,
default_Terminator => null);
subtype incomplete_class_ptr_Pointer is C_incomplete_class_ptr_Pointers.Pointer;
---------
-- bool*
--
package c_bool_Pointers is new C.Pointers (Index => C.size_t,
Element => swig.bool,
element_Array => bool_Array,
default_Terminator => 0);
subtype bool_Pointer is c_bool_Pointers.Pointer;
type bool_Pointer_array is array (C.Size_t range <>) of aliased bool_Pointer;
-- bool**
--
package C_bool_pointer_Pointers is new C.Pointers (Index => C.size_t,
Element => bool_Pointer,
element_Array => bool_Pointer_array,
default_Terminator => null);
subtype bool_pointer_Pointer is C_bool_pointer_Pointers.Pointer;
------------
-- char* []
--
type chars_ptr_array is array (C.Size_t range <>) of aliased C.strings.chars_Ptr; -- Standard Ada does not have 'aliased'.
package C_chars_ptr_Pointers is new C.Pointers (Index => C.size_t,
Element => C.strings.chars_ptr,
element_Array => chars_ptr_array,
default_Terminator => C.strings.Null_Ptr);
subtype chars_ptr_Pointer is C_chars_ptr_Pointers.Pointer;
-- char** []
--
type chars_ptr_Pointer_array is array (C.Size_t range <>) of aliased chars_ptr_Pointer;
package C_chars_ptr_pointer_Pointers is new C.Pointers (Index => C.size_t,
Element => chars_ptr_Pointer,
element_Array => chars_ptr_Pointer_array,
default_Terminator => null);
subtype chars_ptr_pointer_Pointer is C_chars_ptr_pointer_Pointers.Pointer;
-----------
-- wchar_t*
--
package c_wchar_t_Pointers is new C.Pointers (Index => C.size_t,
Element => C.wchar_t,
element_Array => C.wchar_array,
default_Terminator => C.wchar_t'First);
subtype wchar_t_Pointer is c_wchar_t_Pointers.Pointer;
----------------
-- signed char*
--
package c_signed_char_Pointers is new C.Pointers (Index => C.size_t,
Element => C.signed_Char,
element_Array => swig.signed_char_Array,
default_Terminator => 0);
subtype signed_char_Pointer is c_signed_char_Pointers.Pointer;
------------------
-- unsigned char*
--
package c_unsigned_char_Pointers is new C.Pointers (Index => C.size_t,
Element => C.unsigned_Char,
element_Array => unsigned_char_Array,
default_Terminator => 0);
subtype unsigned_char_Pointer is c_unsigned_char_Pointers.Pointer;
----------
-- short*
--
package c_short_Pointers is new C.Pointers (Index => C.size_t,
Element => C.Short,
element_Array => short_Array,
default_Terminator => 0);
subtype short_Pointer is c_short_Pointers.Pointer;
-------------------
-- unsigned short*
--
package c_unsigned_short_Pointers is new C.Pointers (Index => C.size_t,
Element => C.unsigned_Short,
element_Array => unsigned_short_Array,
default_Terminator => 0);
subtype unsigned_short_Pointer is c_unsigned_short_Pointers.Pointer;
--------
-- int*
--
package c_int_Pointers is new C.Pointers (Index => C.size_t,
Element => C.Int,
element_Array => int_Array,
default_Terminator => 0);
subtype int_Pointer is c_int_Pointers.Pointer;
-- int**
--
type int_pointer_Array is array (C.size_t range <>) of aliased int_Pointer;
package c_int_pointer_Pointers is new C.Pointers (Index => C.size_t,
Element => int_Pointer,
element_Array => int_pointer_Array,
default_Terminator => null);
subtype int_pointer_Pointer is c_int_pointer_Pointers.Pointer;
-----------
-- size_t*
--
package c_size_t_Pointers is new C.Pointers (Index => C.size_t,
Element => C.Size_t,
element_Array => size_t_Array,
default_Terminator => 0);
subtype size_t_Pointer is c_size_t_Pointers.Pointer;
-------------
-- unsigned*
--
package c_unsigned_Pointers is new C.Pointers (Index => C.size_t,
Element => C.Unsigned,
element_Array => unsigned_Array,
default_Terminator => 0);
subtype unsigned_Pointer is c_unsigned_Pointers.Pointer;
---------
-- long*
--
package c_long_Pointers is new C.Pointers (Index => C.size_t,
Element => C.Long,
element_Array => long_Array,
default_Terminator => 0);
subtype long_Pointer is c_long_Pointers.Pointer;
------------------
-- unsigned long*
--
package c_unsigned_long_Pointers is new C.Pointers (Index => C.size_t,
Element => C.unsigned_Long,
element_Array => unsigned_long_Array,
default_Terminator => 0);
subtype unsigned_long_Pointer is c_unsigned_long_Pointers.Pointer;
--------------
-- long long*
--
package c_long_long_Pointers is new C.Pointers (Index => C.size_t,
Element => swig.long_Long,
element_Array => long_long_Array,
default_Terminator => 0);
subtype long_long_Pointer is c_long_long_Pointers.Pointer;
-----------------------
-- unsigned long long*
--
package c_unsigned_long_long_Pointers is new C.Pointers (Index => C.size_t,
Element => swig.unsigned_long_Long,
element_Array => unsigned_long_long_Array,
default_Terminator => 0);
subtype unsigned_long_long_Pointer is c_unsigned_long_long_Pointers.Pointer;
-----------
-- int8_t*
--
package c_int8_t_Pointers is new C.Pointers (Index => C.size_t,
Element => swig.int8_t,
element_Array => swig.int8_t_Array,
default_Terminator => 0);
subtype int8_t_Pointer is c_int8_t_Pointers.Pointer;
------------
-- int16_t*
--
package c_int16_t_Pointers is new C.Pointers (Index => C.size_t,
Element => swig.int16_t,
element_Array => swig.int16_t_Array,
default_Terminator => 0);
subtype int16_t_Pointer is c_int16_t_Pointers.Pointer;
------------
-- int32_t*
--
package c_int32_t_Pointers is new C.Pointers (Index => C.size_t,
Element => swig.int32_t,
element_Array => swig.int32_t_Array,
default_Terminator => 0);
subtype int32_t_Pointer is c_int32_t_Pointers.Pointer;
------------
-- int64_t*
--
package c_int64_t_Pointers is new C.Pointers (Index => C.size_t,
Element => swig.int64_t,
element_Array => swig.int64_t_Array,
default_Terminator => 0);
subtype int64_t_Pointer is c_int64_t_Pointers.Pointer;
-- int64_t**
--
type int64_t_pointer_Array is array (C.size_t range <>) of aliased int64_t_Pointer;
package c_int64_t_pointer_Pointers is new C.Pointers (Index => C.size_t,
Element => int64_t_Pointer,
element_Array => int64_t_pointer_Array,
default_Terminator => null);
subtype int64_t_pointer_Pointer is c_int64_t_pointer_Pointers.Pointer;
------------
-- uint8_t*
--
package c_uint8_t_Pointers is new C.Pointers (Index => C.size_t,
Element => swig.uint8_t,
element_Array => swig.uint8_t_Array,
default_Terminator => 0);
subtype uint8_t_Pointer is c_uint8_t_Pointers.Pointer;
-------------
-- uint16_t*
--
package c_uint16_t_Pointers is new C.Pointers (Index => C.size_t,
Element => swig.uint16_t,
element_Array => swig.uint16_t_Array,
default_Terminator => 0);
subtype uint16_t_Pointer is c_uint16_t_Pointers.Pointer;
-------------
-- uint32_t*
--
package c_uint32_t_Pointers is new C.Pointers (Index => C.size_t,
Element => swig.uint32_t,
element_Array => swig.uint32_t_Array,
default_Terminator => 0);
subtype uint32_t_Pointer is c_uint32_t_Pointers.Pointer;
-------------
-- uint64_t*
--
package c_uint64_t_Pointers is new C.Pointers (Index => C.size_t,
Element => swig.uint64_t,
element_Array => swig.uint64_t_Array,
default_Terminator => 0);
subtype uint64_t_Pointer is c_uint64_t_Pointers.Pointer;
----------
-- float*
package c_float_Pointers is new C.Pointers (Index => C.size_t,
Element => C.c_Float,
element_Array => float_Array,
default_Terminator => 0.0);
subtype float_Pointer is c_float_Pointers.Pointer;
-- float**
--
type float_pointer_Array is array (C.size_t range <>) of aliased float_Pointer;
package c_float_pointer_Pointers is new C.Pointers (Index => C.size_t,
Element => float_Pointer,
element_Array => float_pointer_Array,
default_Terminator => null);
subtype float_pointer_Pointer is c_float_pointer_Pointers.Pointer;
-----------
-- double*
--
package c_double_Pointers is new C.Pointers (Index => C.size_t,
Element => C.Double,
element_Array => double_Array,
default_Terminator => 0.0);
subtype double_Pointer is c_double_Pointers.Pointer;
-- double**
--
type double_pointer_Array is array (C.size_t range <>) of aliased double_Pointer;
package c_double_pointer_Pointers is new C.Pointers (Index => C.size_t,
Element => double_Pointer,
element_Array => double_pointer_Array,
default_Terminator => null);
subtype double_pointer_Pointer is c_double_pointer_Pointers.Pointer;
----------------
-- long double*
--
package c_long_double_Pointers is new C.Pointers (Index => C.size_t,
Element => C.long_Double,
element_Array => long_double_Array,
default_Terminator => 0.0);
subtype long_double_Pointer is c_long_double_Pointers.Pointer;
-- long double**
--
type long_double_pointer_Array is array (C.size_t range <>) of aliased long_double_Pointer;
package c_long_double_pointer_Pointers is new C.Pointers (Index => C.size_t,
Element => long_double_Pointer,
element_Array => long_double_pointer_Array,
default_Terminator => null);
subtype long_double_pointer_Pointer is c_long_double_pointer_Pointers.Pointer;
---------------
-- std::string*
--
null_std_string : constant std_string := (M_dataplus => system.null_Address);
package c_std_string_Pointers is new C.Pointers (Index => C.size_t,
Element => std_string,
element_Array => std_string_Array,
default_Terminator => null_std_string);
subtype std_string_Pointer is c_std_string_Pointers.Pointer;
-- std::string**
--
type std_string_pointer_Array is array (C.size_t range <>) of aliased std_string_Pointer;
package c_std_string_pointer_Pointers is new C.Pointers (Index => C.size_t,
Element => std_string_Pointer,
element_Array => std_string_pointer_Array,
default_Terminator => null);
subtype std_string_pointer_Pointer is c_std_string_pointer_Pointers.Pointer;
-----------
-- Utility
--
package void_Conversions is new system.Address_to_Access_conversions (swig.Void);
end Swig.Pointers;