From 6b86c0f12023e04ae017a72ac616c3041e2a1d11 Mon Sep 17 00:00:00 2001 From: Steffen Mueller Date: Mon, 23 Jan 2012 18:33:26 +0100 Subject: [PATCH] Document T_PACKEDARRAY --- ext/XS-Typemap/Typemap.xs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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 -- 2.7.4