# 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);
