-
-
16 Apr 2012 21:20:13 UTC
- Distribution: KinoSearch
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues (5)
- Testers (536 / 133 / 8)
- Kwalitee
Bus factor: 0- 85.27% Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (852.87KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 1 contributors- Marvin Humphrey <marvin at rectangular dot com>
- Dependencies
- JSON::XS
- Lingua::Stem::Snowball
- Lingua::StopWords
- Parse::RecDescent
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Clownfish::Binding::Perl::TypeMap - Convert between Clownfish and Perl via XS.
DESCRIPTION
TypeMap serves up C code fragments for translating between Perl data structures and Clownfish data structures. The functions to_perl() and from_perl() achieve this for individual types; write_xs_typemap() exports all types using the XS "typemap" format documented in
perlxs
.FUNCTIONS
from_perl
my $c_code = from_perl( $type, $cf_var, $xs_var );
Return C code which converts from a Perl scalar to a variable of type $type.
Variable declarations must precede the returned code, as from_perl() won't make any declarations itself.
type - A Clownfish::Type, which will be used to select the mapping code.
cf_var - The name of the variable being assigned to.
xs_var - The C name of the Perl scalar from which we are extracting a value.
to_perl
my $c_code = to_perl( $type, $xs_var, $cf_var );
Return C code which converts from a variable of type $type to a Perl scalar.
Variable declarations must precede the returned code, as to_perl() won't make any declarations itself.
type - A Clownfish::Type, which will be used to select the mapping code.
xs_var - The C name of the Perl scalar being assigned to.
cf_var - The name of the variable from which we are extracting a value.
CLASS METHODS
write_xs_typemap
Clownfish::Binding::Perl::Typemap->write_xs_typemap( hierarchy => $hierarchy, );
hierarchy - A Clownfish::Hierarchy.
Auto-generate a "typemap" file that adheres to the conventions documented in perlxs.
We generate this file on the fly rather than maintain a static copy because we want an entry for each Clownfish type so that we can differentiate between them when checking arguments. Keeping the entries up-to-date manually as classes come and go would be a pain.
COPYRIGHT AND LICENSE
Copyright 2008-2011 Marvin Humphrey
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Module Install Instructions
To install KSx::Simple, copy and paste the appropriate command in to your terminal.
cpanm KSx::Simple
perl -MCPAN -e shell install KSx::Simple
For more information on module installation, please visit the detailed CPAN module installation guide.