7 static bool ck_sv_defined(SV*);
8 static bool ck_sv_is_ref(SV*);
9 static bool ck_sv_ref_type(SV*, int);
12 ck_sv_defined(SV* value){
13 return SvOK(value) ? 1 : 0;
17 ck_sv_is_ref(SV* value){
19 if( ck_sv_defined(value) && SvROK(value) ){
26 ck_sv_ref_type(SV* value, int sv_type){
28 if( ck_sv_is_ref(value) && SvTYPE( SvRV(value) ) == sv_type){
34 static const char *regclass = "Regexp";
36 MODULE = Moose PACKAGE = Moose::Util::TypeConstraints::OptimizedConstraints
43 RETVAL = !ck_sv_defined(value);
51 RETVAL = ck_sv_defined(value);
59 RETVAL = (ck_sv_defined(value) && !ck_sv_is_ref(value)) ? 1 : 0;
67 RETVAL = (ck_sv_defined(value) && !ck_sv_is_ref(value)) ? 1 : 0;
75 RETVAL = ck_sv_is_ref(value);
85 SvOK(value) && SvROK(value)
87 int type = SvTYPE(SvRV(value));
104 RETVAL = ck_sv_ref_type(value, SVt_PVAV);
112 RETVAL = (ck_sv_ref_type(value, SVt_PVHV) && !sv_isobject(value)) ? 1 : 0;
120 RETVAL = ck_sv_ref_type(value, SVt_PVCV);
128 RETVAL = ck_sv_ref_type(value, SVt_PVGV);
137 if( ck_sv_is_ref(value)
138 && sv_isobject(value)
139 && !sv_isa(value, regclass)
151 if( ck_sv_is_ref(value)
152 && sv_isobject(value)
153 && sv_isa(value, regclass)