TYPEMAP
pdl *	T_PDL
pdl_trans * T_PDLTRANS
PDL_Indx  T_IV
float	T_NV
PDL_Anyval  T_PDL_ANYVAL
pdl_slice_args * T_PDL_SLICEARGS
PDL_Indx * T_PDL_DIMLIST
pdl ** T_PDL_LIST

INPUT

T_PDL
  $var = PDL_CORE_(SvPDLV)($arg)

T_PDL_ANYVAL
  ANYVAL_FROM_SV($var, $arg, FALSE, -1)

T_PDLTRANS
  if(sv_isa($arg,\"PDL::Trans\"))
    $var = INT2PTR(pdl_trans *,SvIV(SvRV($arg)));
  else
    croak(\"$var is not of type PDL::Trans\");

T_PDL_SLICEARGS
  $var = PDL_CORE_(slice_args_parse_sv)($arg)

T_PDL_DIMLIST
  $var = PDL_CORE_(packdims)($arg, &${var}_count)

T_PDL_LIST
  $var = PDL_CORE_(packpdls)($arg, &${var}_count)

OUTPUT

T_PDL
  PDL_CORE_(SetSV_PDL)($arg,$var);

T_PDL_ANYVAL
  ANYVAL_TO_SV($arg, $var);

T_PDLTRANS
  sv_setref_pv($arg, \"PDL::Trans\", (void*)$var);

T_PDL_LIST
  if ($var) {
    $arg = PDL_CORE_(unpackpdls)($var, ${var}_count);
    free($var);
  }
