File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,8 @@ likely grow with time).
69
69
Str (C string)
70
70
CArray[int32] (int* in C, an array of integers)
71
71
Pointer[void] (void* in C, can point to all other types)
72
+ bool (bool from C99)
73
+ size_t (size_t in C)
72
74
73
75
Note that the lack of a C < returns > trait is used to indicate void return type.
74
76
Do I < not > use the 'void' type anywhere except in the Pointer parameterization.
@@ -271,7 +273,21 @@ instead:
271
273
272
274
= comment TODO
273
275
274
- TBD
276
+ TBD more
277
+
278
+ You can type your C < Pointer > with passing the type as parameter. It works with native type
279
+ but also C < CArray > and C < CStruct > defined type. NativeCall will not implicitly alloc the memory for it
280
+ even when calling new on them.
281
+ It's mostly useful in the case of a C routine returning one or if emebeded in a C < CStruct > .
282
+
283
+ You have to call C < .deref > on it to access the embeded type.
284
+
285
+ my Pointer[int32] $p; #For a pointer on int32;
286
+ my Pointer[MyCstruct] $p2 = some_c_routine();
287
+ my MyCstruct $mc = $p2.deref;
288
+ say $mc.field1;
289
+
290
+
275
291
276
292
= head1 Buffers and Blobs
277
293
You can’t perform that action at this time.
0 commit comments