PostgreSQL Source Code  git master
value.c
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * value.c
4  * implementation of value nodes
5  *
6  *
7  * Copyright (c) 2003-2022, 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/value.h"
18 
19 /*
20  * makeInteger
21  */
22 Integer *
24 {
25  Integer *v = makeNode(Integer);
26 
27  v->ival = i;
28  return v;
29 }
30 
31 /*
32  * makeFloat
33  *
34  * Caller is responsible for passing a palloc'd string.
35  */
36 Float *
37 makeFloat(char *numericStr)
38 {
39  Float *v = makeNode(Float);
40 
41  v->fval = numericStr;
42  return v;
43 }
44 
45 /*
46  * makeBoolean
47  */
48 Boolean *
50 {
51  Boolean *v = makeNode(Boolean);
52 
53  v->boolval = val;
54  return v;
55 }
56 
57 /*
58  * makeString
59  *
60  * Caller is responsible for passing a palloc'd string.
61  */
62 String *
64 {
65  String *v = makeNode(String);
66 
67  v->sval = str;
68  return v;
69 }
70 
71 /*
72  * makeBitString
73  *
74  * Caller is responsible for passing a palloc'd string.
75  */
76 BitString *
78 {
80 
81  v->bsval = str;
82  return v;
83 }
long val
Definition: informix.c:664
int i
Definition: isn.c:73
#define makeNode(_type_)
Definition: nodes.h:621
char * bsval
Definition: value.h:66
Definition: value.h:52
bool boolval
Definition: value.h:54
Definition: value.h:46
char * fval
Definition: value.h:48
Definition: value.h:29
int ival
Definition: value.h:31
Definition: value.h:58
char * sval
Definition: value.h:60
Boolean * makeBoolean(bool val)
Definition: value.c:49
Float * makeFloat(char *numericStr)
Definition: value.c:37
String * makeString(char *str)
Definition: value.c:63
BitString * makeBitString(char *str)
Definition: value.c:77
Integer * makeInteger(int i)
Definition: value.c:23