Starting with Perl 5.16, you can embed typemaps into your XS code
instead of or in addition to typemaps in a separate file. Multiple
such embedded typemaps will be processed in order of appearance in
-the XS code and like local typemap files take precendence over the
+the XS code and like local typemap files take precedence over the
default typemap, the embedded typemaps may overwrite previous
definitions of TYPEMAP, INPUT, and OUTPUT stanzas. The syntax for
embedded typemaps is
=item MY_CXT_INIT
-The MY_CXT_INIT macro initialises storage for the C<my_cxt_t> struct.
+The MY_CXT_INIT macro initializes storage for the C<my_cxt_t> struct.
It I<must> be called exactly once, typically in a BOOT: section. If you
are maintaining multiple interpreters, it should be called once in each
you simply return a C<char *> from your XSUB, the core typemap will
have this C type associated with the T_PV XS type. That means your
C string will be copied into the PV (pointer value) slot of a new scalar
-that will be returned from your XSUB to to Perl.
+that will be returned from your XSUB to Perl.
If you're developing a CPAN distribution using XS, you may add your own
file called F<typemap> to the distribution. That file may contain
=item T_PACKEDARRAY
T_PACKEDARRAY is similar to T_PACKED. In fact, the C<INPUT> (Perl
-to XSUB) typemap is indentical, but the C<OUTPUT> typemap passes
+to XSUB) typemap is identical, 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
Of course, unless you know the number of elements in the
C<sometype **> C array, within your XSUB, the return value from
-C<foo_t ** XS_unpack_foo_tPtrPtr(...)> will be hard to decypher.
+C<foo_t ** XS_unpack_foo_tPtrPtr(...)> will be hard to decipher.
Since the details are all up to the XS author (the typemap user),
there are several solutions, none of which particularly elegant.
The most commonly seen solution has been to allocate memory for
iteration.
Alternatively, using a customized typemap for your purposes in
-the first place is probably preferrable.
+the first place is probably preferable.
=item T_DATAUNIT