-
Notifications
You must be signed in to change notification settings - Fork 14
/
typemap
33 lines (27 loc) · 718 Bytes
/
typemap
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
# Typemap file for remctl Perl bindings.
#
# Written by Russ Allbery <[email protected]>
# Copyright 2007
# The Board of Trustees of the Leland Stanford Junior University
#
# SPDX-License-Identifier: MIT
TYPEMAP
Net::Remctl T_PTROBJ_NU
Net::Remctl::Result T_PTROBJ_NU
Net::Remctl::Output T_PTROBJ_NU
INPUT
T_PTROBJ_NU
if ($arg == &PL_sv_undef) {
$var = NULL;
} else if (sv_isa($arg, \"${ntype}\")) {
IV tmp = SvIV((SV *) SvRV($arg));
$var = INT2PTR($type, tmp);
} else {
croak(\"$var is not of type ${ntype}\");
}
OUTPUT
T_PTROBJ_NU
if ($var == NULL)
$arg = &PL_sv_undef;
else
sv_setref_pv($arg, \"${ntype}\", (void *) $var);