# typemap for Perl 5 interface to Berkeley 
#
# written by Paul Marquess <Paul.Marquess@btinternet.com>
# last modified 21st February 1999
# version 1.65
#
#################################### DB SECTION
#
# 

u_int			T_U_INT
DB_File			T_PTROBJ
DBT			T_dbtdatum
DBTKEY			T_dbtkeydatum

INPUT
T_dbtkeydatum
	if (db->type != DB_RECNO) {
	    $var.data = SvPV($arg, PL_na);
	    $var.size = (int)PL_na;
	    DBT_flags($var);
	}
	else {
	    Value =  GetRecnoKey(db, SvIV($arg)) ; 
	    $var.data = & Value; 
	    $var.size = (int)sizeof(recno_t);
	    DBT_flags($var);
	}
T_dbtdatum
	$var.data = SvPV($arg, PL_na);
	$var.size = (int)PL_na;
	DBT_flags($var);

OUTPUT

T_dbtkeydatum
	OutputKey($arg, $var)
T_dbtdatum
	OutputValue($arg, $var)
T_PTROBJ
        sv_setref_pv($arg, dbtype, (void*)$var);
