-
Notifications
You must be signed in to change notification settings - Fork 21
/
typemap
171 lines (122 loc) · 3.87 KB
/
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
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
TYPEMAP
char * T_PV
unsigned char * T_PV
const char * T_PV
AV * T_AVREF
time_t T_TIME_T
size_t T_SIZE_T
long T_LONG
SSH2 * O_SESSION
SSH2_CHANNEL * O_CHANNEL
SSH2_LISTENER * O_LISTENER
SSH2_SFTP * O_SFTP
SSH2_FILE * O_FILE
SSH2_DIR * O_DIR
SSH2_PUBLICKEY* O_PUBLICKEY
SSH2_KNOWNHOSTS* O_KNOWNHOSTS
SSH2_RC T_SSH2_RC
SSH2_ERROR T_SSH2_ERROR
SSH2_NERROR T_SSH2_NERROR
SSH2_BYTES T_SSH2_BYTES
SSH2_BYTES64 T_SSH2_BYTES64
SSH2_BYTESU64 T_SSH2_BYTESU64
SSH2_BOOL T_SSH2_BOOL
SSH2_METHOD T_SSH2_METHOD
SSH2_FLAG T_SSH2_FLAG
SSH2_CALLBACK T_SSH2_CALLBACK
SSH2_HOSTKEY_HASH T_SSH2_HOSTKEY_HASH
SSH2_CHANNEL_EXTENDED_DATA T_SSH2_CHANNEL_EXTENDED_DATA
SSH2_CHARP T_SSH2_CHARP
SSH2_CHARP_OR_NULL T_SSH2_CHARP_OR_NULL
SSH2_STREAM_ID T_SSH2_STREAM_ID
OUTPUT
T_PV
sv_setpv((SV*)$arg, $var);
T_AVREF
$arg = newRV((SV*)$var);
T_SSH2_BYTES
$arg = ( (($var) < 0) ? &PL_sv_undef : newSVuv($var) );
T_SSH2_BYTES64
$arg = ( (($var) < 0) ? &PL_sv_undef : ((IVSIZE >= 8) ? newSVuv($var) : newSVnv($var)) );
T_SSH2_BYTESU64
$arg = ((IVSIZE >= 8) ? newSVuv($var) : newSVnv($var));
T_SSH2_BOOL
$arg = (($var) ? &PL_sv_yes : &PL_sv_no);
T_SSH2_RC
$arg = (($var) ? &PL_sv_yes : &PL_sv_undef);
T_SSH2_ERROR
$arg = newSViv($var);
T_SSH2_NERROR
$arg = ( (($var) < 0) ? &PL_sv_undef : &PL_sv_yes );
T_SSH2_CHARP_OR_NULL
$arg = ($var ? newSVpv($var, 0) : &PL_sv_undef);
O_SESSION
sv_setref_pv($arg, "Net::SSH2", (void *)$var);
O_CHANNEL
wrap_tied_into($arg, "Net::SSH2::Channel", (void *)$var);
O_LISTENER
sv_setref_pv($arg, "Net::SSH2::Listener", (void *)$var);
O_SFTP
sv_setref_pv($arg, "Net::SSH2::SFTP", (void *)$var);
O_FILE
wrap_tied_into($arg, "Net::SSH2::File", (void *)$var);
O_DIR
sv_setref_pv($arg, "Net::SSH2::Dir", (void *)$var);
O_PUBLICKEY
sv_setref_pv($arg, "Net::SSH2::PublicKey", (void *)$var);
O_KNOWNHOSTS
sv_setref_pv($arg, "Net::SSH2::KnownHosts", (void *)$var);
INPUT
T_PV
$var = ($type)SvPV_nolen($arg)
T_AVREF
if(SvROK($arg) && SvTYPE(SvRV($arg)) == SVt_PVAV)
$var = (AV*)SvRV($arg);
else
croak(\"$var is not an array reference\");
O_SESSION
$var = INT2PTR($type, unwrap($arg, \"$Package\", \"$func_name\"));
O_CHANNEL
$var = INT2PTR($type, unwrap_tied($arg, \"$Package\", \"$func_name\"));
O_LISTENER
$var = INT2PTR($type, unwrap($arg, \"$Package\", \"$func_name\"));
O_SFTP
$var = INT2PTR($type, unwrap($arg, \"$Package\", \"$func_name\"));
O_FILE
$var = INT2PTR($type, unwrap_tied($arg, \"$Package\", \"$func_name\"));
O_DIR
$var = INT2PTR($type, unwrap($arg, \"$Package\", \"$func_name\"));
O_PUBLICKEY
$var = INT2PTR($type, unwrap($arg, \"$Package\", \"$func_name\"));
O_KNOWNHOSTS
$var = INT2PTR($type, unwrap($arg, \"$Package\", \"$func_name\"));
T_SSH2_BOOL
$var = SvTRUE($arg);
T_SSH2_METHOD
$var = sv2iv_constant_or_croak(\"METHOD\", $arg);
T_SSH2_FLAG
$var = sv2iv_constant_or_croak(\"FLAG\", $arg);
T_SSH2_CALLBACK
$var = sv2iv_constant_or_croak(\"CALLBACK\", $arg);
T_SSH2_HOSTKEY_HASH
$var = sv2iv_constant_or_croak(\"HOSTKEY_HASH\", $arg);
T_SSH2_CHANNEL_EXTENDED_DATA
$var = sv2iv_constant_or_croak(\"CHANNEL_EXTENDED_DATA\", $arg);
T_SSH2_CHARP
$var = SvPVbyte_nolen($arg);
T_SSH2_CHARP_OR_NULL
$var = (SvOK($arg) ? SvPVbyte_nolen($arg) : NULL);
T_TIME_T
$var = SV2TYPE($arg, time_t);
T_SIZE_T
$var = SV2TYPE($arg, size_t);
T_INT
$var = my_sv2int($arg);
T_LONG
$var = SV2TYPE($arg, long);
T_SSH2_BYTES64
$var = SV2TYPE($arg, SSH2_BYTES64);
T_SSH2_BYTESU64
$var = SV2UTYPE($arg, SSH2_BYTESU64);
T_SSH2_STREAM_ID
$var = sv2iv_constant_or_croak(\"CHANNEL_FLUSH\", $arg);