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-2021, 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->val = 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->val = numericStr;
42  return v;
43 }
44 
45 /*
46  * makeString
47  *
48  * Caller is responsible for passing a palloc'd string.
49  */
50 String *
52 {
53  String *v = makeNode(String);
54 
55  v->val = str;
56  return v;
57 }
58 
59 /*
60  * makeBitString
61  *
62  * Caller is responsible for passing a palloc'd string.
63  */
64 BitString *
66 {
68 
69  v->val = str;
70  return v;
71 }
Definition: value.h:51
String * makeString(char *str)
Definition: value.c:51
BitString * makeBitString(char *str)
Definition: value.c:65
Definition: value.h:28
char * val
Definition: value.h:54
Definition: value.h:45
char * val
Definition: value.h:60
Integer * makeInteger(int i)
Definition: value.c:23
#define makeNode(_type_)
Definition: nodes.h:584
int val
Definition: value.h:31
Float * makeFloat(char *numericStr)
Definition: value.c:37
int i
char * val
Definition: value.h:48