Avoid mislabeling of lateral references, redux.
[pgsql.git] / contrib / bool_plperl / bool_plperl.c
blob0fa1eee8e57ebf921a8a5a1446f3cdc749db1d38
1 #include "postgres.h"
3 #include "fmgr.h"
4 #include "plperl.h"
7 PG_MODULE_MAGIC;
9 PG_FUNCTION_INFO_V1(bool_to_plperl);
11 Datum
12 bool_to_plperl(PG_FUNCTION_ARGS)
14 dTHX;
15 bool in = PG_GETARG_BOOL(0);
17 return PointerGetDatum(in ? &PL_sv_yes : &PL_sv_no);
21 PG_FUNCTION_INFO_V1(plperl_to_bool);
23 Datum
24 plperl_to_bool(PG_FUNCTION_ARGS)
26 dTHX;
27 SV *in = (SV *) PG_GETARG_POINTER(0);
29 PG_RETURN_BOOL(SvTRUE(in));