From a382a84ba7f959ceab7ecbf75e7c937153ebb603 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Fri, 12 Nov 2010 03:19:29 -0600 Subject: implement some helper functions --- typemap | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 typemap (limited to 'typemap') diff --git a/typemap b/typemap new file mode 100644 index 0000000..3ea935e --- /dev/null +++ b/typemap @@ -0,0 +1,17 @@ +TYPEMAP +varspec_t T_VARSPEC +vartype_t T_VARTYPE + +INPUT +T_VARSPEC + if (SvPOK($arg)) + _deconstruct_variable_name(SvPV_nolen($arg), &$var); + else if (SvROK($arg) && SvTYPE(SvRV($arg)) == SVt_PVHV) + _deconstruct_variable_hash((HV*)SvRV($arg), &$var); + else + croak(\"varspec must be a string or a hashref\"); + +T_VARTYPE + if (!SvPOK($arg)) + croak(\"vartype must be a string\"); + $var = string_to_vartype(SvPV_nolen($arg)); -- cgit v1.2.3-54-g00ecf