File tree Expand file tree Collapse file tree 1 file changed +0
-6
lines changed Expand file tree Collapse file tree 1 file changed +0
-6
lines changed Original file line number Diff line number Diff line change @@ -388,7 +388,6 @@ for 0..$native-array.elems - 1 -> $position {
388
388
say "Element at position $position is "
389
389
~ $native-array[ $position ];
390
390
}
391
-
392
391
=end code
393
392
394
393
that produces the following output
@@ -526,7 +525,6 @@ function.
526
525
=head3 In your Raku code...
527
526
528
527
=begin code :skip-test<external dependency>
529
-
530
528
class AStringAndAnInt is repr("CStruct") {
531
529
has Str $.a_string;
532
530
has int32 $.an_int32;
@@ -551,25 +549,21 @@ C<$.an_int32>. You can always bind native types this way.
551
549
=head3 In your C code...
552
550
553
551
=begin code :lang<C>
554
-
555
552
typedef struct a_string_and_an_int32_t_ {
556
553
char *a_string;
557
554
int32_t an_int32;
558
555
} a_string_and_an_int32_t;
559
-
560
556
=end code
561
557
562
558
Here's the structure. Notice how we've got a C<char *> there.
563
559
564
560
=begin code :lang<C>
565
-
566
561
void init_struct(a_string_and_an_int32_t *target, char *str, int32_t int32) {
567
562
target->an_int32 = int32;
568
563
target->a_string = strdup(str);
569
564
570
565
return;
571
566
}
572
-
573
567
=end code
574
568
575
569
In this function we initialize the C structure by assigning an integer
You can’t perform that action at this time.
0 commit comments