1# typemap for Perl 5 interface to Berkeley 2# 3# written by Paul Marquess <pmqs@cpan.org> 4# last modified 20th June 2004 5# version 1.809 6# 7#################################### DB SECTION 8# 9# 10 11u_int T_U_INT 12DB_File T_PTROBJ 13DBT T_dbtdatum 14DBTKEY T_dbtkeydatum 15 16INPUT 17T_dbtkeydatum 18 { 19 SV * my_sv = $arg; 20 DBM_ckFilter(my_sv, filter_store_key, \"filter_store_key\"); 21 DBT_clear($var) ; 22 SvGETMAGIC(my_sv) ; 23 if (db->type == DB_RECNO) { 24 if (SvOK(my_sv)) 25 Value = GetRecnoKey(aTHX_ db, SvIV(my_sv)) ; 26 else 27 Value = 1 ; 28 $var.data = & Value; 29 $var.size = (int)sizeof(recno_t); 30 } 31 else if (SvOK(my_sv)) { 32 STRLEN len; 33 $var.data = SvPVbyte(my_sv, len); 34 $var.size = (int)len; 35 } 36 } 37T_dbtdatum 38 { 39 SV * my_sv = $arg; 40 DBM_ckFilter(my_sv, filter_store_value, \"filter_store_value\"); 41 DBT_clear($var) ; 42 SvGETMAGIC(my_sv) ; 43 if (SvOK(my_sv)) { 44 STRLEN len; 45 $var.data = SvPVbyte(my_sv, len); 46 $var.size = (int)len; 47 } 48 } 49 50OUTPUT 51 52T_dbtkeydatum 53 OutputKey($arg, $var) 54T_dbtdatum 55 OutputValue($arg, $var) 56T_PTROBJ 57 sv_setref_pv($arg, dbtype, (void*)$var); 58