-
Notifications
You must be signed in to change notification settings - Fork 4
/
typemap
40 lines (31 loc) · 1.06 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
###########################
TYPEMAP
#string (char*) with automatic NULL<->undef conversion on input/output
char * T_STR_OR_NULL
const char * T_STR_OR_NULL
#pointer with automatic NULL<->undef conversion on input/output
unsigned char * T_PTR_OR_NULL
Ihandle * T_PTR_OR_NULL
cdCanvas * T_PTR_OR_NULL
#structs with automatic conversion to perl classes
IUP::Canvas::Bitmap T_PTROBJ
IUP::Canvas::Palette T_PTROBJ
IUP::Canvas::Pattern T_PTROBJ
IUP::Canvas::Stipple T_PTROBJ
IUP::Canvas::InternalServerImage T_PTROBJ
IUP::Canvas::InternalState T_PTROBJ
IUP::Canvas::InternalContext T_PTROBJ
###########################
INPUT
T_PTR_OR_NULL
$var = (SvIOK($arg)) ? INT2PTR($type,SvIVX($arg)) : NULL;
T_STR_OR_NULL
$var = (SvOK($arg)) ? SvPV_nolen($arg) : NULL;
###########################
OUTPUT
T_PTR_OR_NULL
if ($var==NULL) XSRETURN_UNDEF;
else sv_setiv($arg, PTR2IV($var));
T_STR_OR_NULL
if ($var==NULL) XSRETURN_UNDEF;
else sv_setpv($arg, $var);