From: Steffen Mueller Date: Mon, 23 Jan 2012 17:33:26 +0000 (+0100) Subject: Document T_PACKEDARRAY X-Git-Tag: v5.15.8~285 X-Git-Url: https://perl5.git.perl.org/perl5.git/commitdiff_plain/6b86c0f12023e04ae017a72ac616c3041e2a1d11 Document T_PACKEDARRAY --- diff --git a/ext/XS-Typemap/Typemap.xs b/ext/XS-Typemap/Typemap.xs index f53f84a..75cc2ac 100644 --- a/ext/XS-Typemap/Typemap.xs +++ b/ext/XS-Typemap/Typemap.xs @@ -1055,7 +1055,21 @@ but the prototype would be: =item T_PACKEDARRAY -NOT YET +T_PACKEDARRAY is similar to T_PACKED. In fact, the C (Perl +to XSUB) typemap is indentical, but the C typemap passes +an additional argument to the C function. This +third parameter indicates the number of elements in the output +so that the function can handle C arrays sanely. The variable +needs to be declared by the user and must have the name +C where C<$ntype> is the normalized C type name +as explained above. The signature of the function would be for +the example above and C: + + static void + XS_pack_foo_tPtrPtr(SV *out, foo_t *in, UV count_foo_tPtrPtr); + +The type of the third parameter is arbitrary as far as the typemap +is concerned. It just has to be in line with the declared variable. =item T_DATAUNIT