... xsubpp -typemap "...lib\ExtUtils\typemap" -typemap "...inline-c-mytypemap-null\mytypemap.txt" #### typemap typemap Indicates that a user-supplied typemap should take precedence over the default typemaps. This option may be used multiple times, with the last typemap having the highest precedence. #### #!/usr/bin/perl -- use strict; use warnings; use Path::Tiny qw/ path /; use Inline C => Config => BUILD_NOISY => 1, CLEAN_AFTER_BUILD => 0, typemaps => path( __FILE__ )->realpath->parent->path('mytypemap.txt'), NAME => 'markong', FORCE_BUILD => 1, ## debuggery ;;;;;;;;;;;;; use Inline 'C' => <<'CODE'; typedef unsigned char * unmapped; unmapped foo(unmapped name) { if(name) printf("True\n"); else printf("False\n"); return(NULL); } unsigned char * bar() { return (foo(NULL)); } CODE use Devel::Peek qw/ Dump /; foo(undef); bar(); exit( 0 ); __END__ #### ## cannot redefine T_PTR INPUT/OUTPUT # unmapped T_PTR unmapped Too_PTR brokenmapped T_PTR # cannot redefine typemap for "unsigned char*" unsigned char * Foo_PTR INPUT T_PTR $var = BROKEN_INT2PTR($type,SvIV($arg)) Too_PTR STMT_START { Perl_warn(aTHX_ \"INPUT Too_PTR=%s\", $arg); $var = INT2PTR($type,SvIV($arg)); } STMT_END ; Foo_PTR STMT_START { Perl_warn(aTHX_ \"INPUT Foo_PTR=%s\", $arg); $var = INT2PTR($type,SvIV($arg)); } STMT_END ; OUTPUT Too_PTR STMT_START { Perl_warn(aTHX_ \"OUTPUT Too_PTR=%s\", $arg); sv_setiv($arg, PTR2IV($var)); } STMT_END ; Foo_PTR STMT_START { Perl_warn(aTHX_ \"OUTPUT Foo_PTR=%s\", $arg); sv_setiv($arg, PTR2IV($var)); } STMT_END ; T_PTR sv_setiv($arg, BROKEN_PTR2IV($var)); #### #!/usr/bin/perl -- use strict; use warnings; use ExtUtils::ParseXS::Utilities qw/ process_typemaps /; use Data::Dump qw/ dd /; dd( process_typemaps( './mytypemap.txt', ) ); __END__