1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-29 10:41:53 +03:00

Cleanup: move the 'Value' node into a separate file, rather than putting

it in the same file as the 'List' node.
This commit is contained in:
Neil Conway
2004-01-07 18:43:36 +00:00
parent 7f5e12a84c
commit afca5d50dc
7 changed files with 146 additions and 128 deletions

75
src/backend/nodes/value.c Normal file
View File

@ -0,0 +1,75 @@
/*-------------------------------------------------------------------------
*
* value.c
* implementation of Value nodes
*
*
* Copyright (c) 2003, PostgreSQL Global Development Group
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/nodes/value.c,v 1.1 2004/01/07 18:43:36 neilc Exp $
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "nodes/parsenodes.h"
/*
* makeInteger
*/
Value *
makeInteger(long i)
{
Value *v = makeNode(Value);
v->type = T_Integer;
v->val.ival = i;
return v;
}
/*
* makeFloat
*
* Caller is responsible for passing a palloc'd string.
*/
Value *
makeFloat(char *numericStr)
{
Value *v = makeNode(Value);
v->type = T_Float;
v->val.str = numericStr;
return v;
}
/*
* makeString
*
* Caller is responsible for passing a palloc'd string.
*/
Value *
makeString(char *str)
{
Value *v = makeNode(Value);
v->type = T_String;
v->val.str = str;
return v;
}
/*
* makeBitString
*
* Caller is responsible for passing a palloc'd string.
*/
Value *
makeBitString(char *str)
{
Value *v = makeNode(Value);
v->type = T_BitString;
v->val.str = str;
return v;
}