c_func(undef); # NULL param c_func(''); # empty string param c_func(123); # string '123' param c_func('qwe'); # string 'qwe' param
Current XS realization:
void c_func(param) char * param = SvOK(ST(0)) ? SvPV_nolen(ST(0)) : NULL;
This task sounds like standard opration, so is there exists simpler way, without ugly "SvOK ? SvPV_nolen : NULL" chain?
In reply to XS: SvOK ? SvPV_nolen : NULL by powerman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |