File: typemap

package info (click to toggle)
pilot-link 0.12.5-dfsg-2
  • links: PTS
  • area: main
  • in suites: buster, stretch
  • size: 6,868 kB
  • ctags: 5,811
  • sloc: ansic: 53,153; sh: 10,459; java: 2,584; perl: 2,247; python: 1,044; makefile: 991; yacc: 662; cpp: 551; xml: 39
file content (58 lines) | stat: -rw-r--r-- 994 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
TYPEMAP
PDA::Pilot::File *	T_PTROBJ
PDA::Pilot::DLP *	T_PTROBJ
PDA::Pilot::DLP::DB *	T_PTROBJ
PDA::Pilot::DLP::ResourceDB *	T_PTROBJ
PDA::Pilot::DLP::RecordDB *	T_PTROBJ
DlpDB	T_PTROBJ
DBInfo	T_DBInfo
UserInfo	T_UserInfo
Char4	T_CHAR4
Result	T_RESULT

INPUT
T_DBInfo
	unpack_dbinfo($arg, $var);

T_UserInfo
	unpack_userinfo($arg, $var);

T_CHAR4
	{
		if (SvIOKp($arg) || SvNOKp($arg))
			$var = SvIV($arg);
		else {
		    STRLEN len;
		    char * c = SvPV($arg, len);
		    $var = makelong(c);
		}
	}
T_PTROBJ
	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_DBInfo
	pack_dbinfo($arg, $var, 0);

T_UserInfo
	pack_userinfo($arg, $var, 0);

T_CHAR4
	{
		char * c = printlong($var);
		sv_setpvn($arg, c, 4);
	}

T_RESULT
	if ($var < 0) {
		sv_setsv($arg, &PL_sv_no);
		self->errnop = $var;
	} else
		sv_setsv($arg, &PL_sv_yes);
T_PTROBJ
	sv_setref_pv($arg, \"${ntype}\", (void*)$var);