################################################################################
#
# $Project: /Convert-Binary-C $
# $Author: mhx $
# $Date: 2004/03/22 20:38:05 +0100 $
# $Revision: 6 $
# $Snapshot: /Convert-Binary-C/0.50 $
# $Source: /typemap $
#
################################################################################
# 
# Copyright (c) 2002-2004 Marcus Holland-Moritz. All rights reserved.
# This program is free software; you can redistribute it and/or modify
# it under the same terms as Perl itself.
# 
################################################################################

TYPEMAP
const char *	T_PV
CBC *		T_OBJECT

OUTPUT
T_OBJECT
	sv_setref_pv($arg, CLASS, (void*)$var);

INPUT
T_OBJECT
	if (sv_isobject($arg) && SvTYPE(SvRV($arg)) == SVt_PVMG) {
	  IV tmp = SvIV((SV*)SvRV($arg));
	  $var = INT2PTR($type, tmp);
	}
	else
	  Perl_croak(aTHX_ \"${Package}::$func_name(): $var is not a blessed SV reference\");

