diff options
author | Steffen Mueller <smueller@cpan.org> | 2012-01-23 18:33:26 +0100 |
---|---|---|
committer | Steffen Mueller <smueller@cpan.org> | 2012-02-01 08:07:49 +0100 |
commit | 6b86c0f12023e04ae017a72ac616c3041e2a1d11 (patch) | |
tree | d226c377606e64618b4492d21867bc5dd544c09a | |
parent | f018eb7c0f5a828ef91fbc3e9bbde6a5f7582ba9 (diff) | |
download | perl-6b86c0f12023e04ae017a72ac616c3041e2a1d11.tar.gz |
Document T_PACKEDARRAY
-rw-r--r-- | ext/XS-Typemap/Typemap.xs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/ext/XS-Typemap/Typemap.xs b/ext/XS-Typemap/Typemap.xs index f53f84ac9f..75cc2acbf9 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<INPUT> (Perl +to XSUB) typemap is indentical, but the C<OUTPUT> typemap passes +an additional argument to the C<XS_pack_$ntype> 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<count_$ntype> 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<foo_t **>: + + 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 |