ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/TDB_FileX/typemap
Revision: 1.2
Committed: Tue Apr 29 21:27:54 2025 UTC (16 months, 4 weeks ago) by root
Branch: MAIN
CVS Tags: rel-0_97, HEAD
Changes since 1.1: +26 -24 lines
Log Message:
*** empty log message ***

File Contents

# Content
1 TDB_CONTEXT * T_PTROBJ_CLASS
2 TDB_DATA T_TDB_DATA
3 mone_on_fail T_TDB_MONE_ON_FAIL
4 const char * T_PV
5 enum TDB_ERROR T_UV
6 tdb_traverse_func T_SV
7
8 #############################################################################
9
10 INPUT
11
12 T_PTROBJ_CLASS
13 if (!sv_derived_from ($arg, \"$Package\"))
14 croak (\"$var is not of type $Package\");
15
16 $var = INT2PTR ($type, SvIV ((SV*)SvRV ($arg)));
17
18 T_TDB_DATA
19 if (SvOK ($arg))
20 {
21 STRLEN len;
22 $var.dptr = SvPVbyte ($arg, len);
23 $var.dsize = len;
24 }
25 else
26 {
27 $var.dptr = 0;
28 $var.dsize = 0;
29 }
30
31 #############################################################################
32
33 OUTPUT
34
35 T_PTROBJ_CLASS
36 sv_setref_pv ($arg, class, (void*)$var);
37
38 T_TDB_DATA
39 if ($var.dptr)
40 {
41 /* TODO: reuse data, if perl uses malloc */
42 sv_setpvn ((SV*)$arg, $var.dptr, $var.dsize);
43 free ($var.dptr);
44 }
45 else
46 $arg = &PL_sv_undef;
47
48 T_TDB_MONE_ON_FAIL
49 $arg = ($var == -1) ? &PL_sv_no : &PL_sv_yes;