LCOV - code coverage report
Current view: top level - contrib/bool_plperl - bool_plperl.c (source / functions) Hit Total Coverage
Test: PostgreSQL 14devel Lines: 11 11 100.0 %
Date: 2020-09-25 16:06:32 Functions: 5 5 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : #include "postgres.h"
       2             : 
       3             : #include "fmgr.h"
       4             : #include "plperl.h"
       5             : 
       6             : 
       7           4 : PG_MODULE_MAGIC;
       8             : 
       9           8 : PG_FUNCTION_INFO_V1(bool_to_plperl);
      10             : 
      11             : Datum
      12          16 : bool_to_plperl(PG_FUNCTION_ARGS)
      13             : {
      14          16 :     dTHX;
      15          16 :     bool        in = PG_GETARG_BOOL(0);
      16             : 
      17          16 :     return PointerGetDatum(in ? &PL_sv_yes : &PL_sv_no);
      18             : }
      19             : 
      20             : 
      21           8 : PG_FUNCTION_INFO_V1(plperl_to_bool);
      22             : 
      23             : Datum
      24          16 : plperl_to_bool(PG_FUNCTION_ARGS)
      25             : {
      26          16 :     dTHX;
      27          16 :     SV         *in = (SV *) PG_GETARG_POINTER(0);
      28             : 
      29          16 :     PG_RETURN_BOOL(SvTRUE(in));
      30             : }

Generated by: LCOV version 1.13