-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypemap
66 lines (57 loc) · 1.46 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
# objects
Barcode::ZBar::Error T_PTROBJ
Barcode::ZBar::Symbol T_PTROBJ
Barcode::ZBar::Image T_PTROBJ
Barcode::ZBar::Processor T_PTROBJ
Barcode::ZBar::Video T_PTROBJ
Barcode::ZBar::Window T_PTROBJ
Barcode::ZBar::ImageScanner T_PTROBJ
Barcode::ZBar::Decoder T_PTROBJ
Barcode::ZBar::Scanner T_PTROBJ
# enums
zbar_color_t T_ENUM
zbar_error_t T_ENUM
zbar_symbol_type_t T_ENUM
zbar_config_t T_ENUM
zbar_modifier_t T_ENUM
zbar_orientation_t T_ENUM
# special scalars
fourcc_t T_FOURCC
timeout_t T_TIMEOUT
# error handling
config_error T_CONFIG_ERROR
INPUT
T_ENUM
$var = ($type)SvIV($arg)
T_FOURCC
{
if(SvPOK($arg)) {
char *str = SvPV_nolen($arg);
$var = zbar_fourcc_parse(str);
}
else
$var = SvUV($arg);
}
T_TIMEOUT
if(($var = ($type)(SvNV($arg) * 1000.)) < 0)
$var = -1;
T_PV
$var = SvOK($arg) ? SvPV_nolen($arg) : NULL;
OUTPUT
T_ENUM
$arg = SvREFCNT_inc(lookup_enum(LOOKUP_$ntype, (int)$var));
T_FOURCC
{
char str[4] = {
$var & 0xff,
($var >> 8) & 0xff,
($var >> 16) & 0xff,
($var >> 24) & 0xff,
};
sv_setuv($arg, $var);
sv_setpvn($arg, str, 4);
SvIOK_on($arg);
}
T_CONFIG_ERROR
if($var)
croak("invalid configuration setting: %s", config_string);