LCOV - code coverage report
Current view: top level - src/backend/nodes - value.c (source / functions) Hit Total Coverage
Test: PostgreSQL Lines: 15 20 75.0 %
Date: 2017-09-29 13:40:31 Functions: 3 4 75.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*-------------------------------------------------------------------------
       2             :  *
       3             :  * value.c
       4             :  *    implementation of Value nodes
       5             :  *
       6             :  *
       7             :  * Copyright (c) 2003-2017, PostgreSQL Global Development Group
       8             :  *
       9             :  *
      10             :  * IDENTIFICATION
      11             :  *    src/backend/nodes/value.c
      12             :  *
      13             :  *-------------------------------------------------------------------------
      14             :  */
      15             : #include "postgres.h"
      16             : 
      17             : #include "nodes/parsenodes.h"
      18             : 
      19             : /*
      20             :  *  makeInteger
      21             :  */
      22             : Value *
      23        1763 : makeInteger(long i)
      24             : {
      25        1763 :     Value      *v = makeNode(Value);
      26             : 
      27        1763 :     v->type = T_Integer;
      28        1763 :     v->val.ival = i;
      29        1763 :     return v;
      30             : }
      31             : 
      32             : /*
      33             :  *  makeFloat
      34             :  *
      35             :  * Caller is responsible for passing a palloc'd string.
      36             :  */
      37             : Value *
      38          11 : makeFloat(char *numericStr)
      39             : {
      40          11 :     Value      *v = makeNode(Value);
      41             : 
      42          11 :     v->type = T_Float;
      43          11 :     v->val.str = numericStr;
      44          11 :     return v;
      45             : }
      46             : 
      47             : /*
      48             :  *  makeString
      49             :  *
      50             :  * Caller is responsible for passing a palloc'd string.
      51             :  */
      52             : Value *
      53      480971 : makeString(char *str)
      54             : {
      55      480971 :     Value      *v = makeNode(Value);
      56             : 
      57      480971 :     v->type = T_String;
      58      480971 :     v->val.str = str;
      59      480971 :     return v;
      60             : }
      61             : 
      62             : /*
      63             :  *  makeBitString
      64             :  *
      65             :  * Caller is responsible for passing a palloc'd string.
      66             :  */
      67             : Value *
      68           0 : makeBitString(char *str)
      69             : {
      70           0 :     Value      *v = makeNode(Value);
      71             : 
      72           0 :     v->type = T_BitString;
      73           0 :     v->val.str = str;
      74           0 :     return v;
      75             : }

Generated by: LCOV version 1.11