TYPEMAP
BLADEENV	T_BLADEENV
BLADEHASH	T_BLADEHASH
CORBA_char *	T_CORBASTRING
CORBA_char_nodup *	T_STRING
CORBA_short	T_IV
char *	T_STRING

INPUT
T_STRING
	{
		if ($arg == &sv_undef)
			$var = ($type)NULL;
		else
			$var = ($type)SvPV($arg,PL_na);
	}

T_CORBASTRING
	{
		if ($arg == &sv_undef)
			$var = ($type)NULL;
		else
			$var = ($type)SvPV($arg,PL_na);
	}

T_BLADEHASH
	if (sv_derived_from($arg, \"${ntype}\")) {
		IV tmp = SvIV((SV*)SvRV($arg));
		$var = ($type) tmp;
	}
	else
		croak(\"$var is not of type ${ntype}\")

T_BLADEENV
	if (sv_derived_from($arg, \"${ntype}\")) {
		IV tmp = SvIV((SV*)SvRV($arg));
		$var = ($type) tmp;
	}
	else
		croak(\"$var is not of type ${ntype}\")

OUTPUT
T_STRING
	if ($var != NULL)
		sv_setpv((SV *)$arg, $var);

T_CORBASTRING
	if ($var != NULL) {
		sv_setpv((SV *)$arg, $var);
		CORBA_free($var);
	}

T_BLADEHASH
	if ($var == NULL)
		$arg = &PL_sv_undef;
	else
		sv_setref_pv($arg, \"${ntype}\", (void*)$var);

T_BLADEENV
	if ($var == NULL)
		$arg = &PL_sv_undef;
	else
		sv_setref_pv($arg, \"${ntype}\", (void*)$var);
