mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +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:
@@ -4,7 +4,7 @@
|
||||
# Makefile for backend/nodes
|
||||
#
|
||||
# IDENTIFICATION
|
||||
# $PostgreSQL: pgsql/src/backend/nodes/Makefile,v 1.15 2003/11/29 19:51:49 pgsql Exp $
|
||||
# $PostgreSQL: pgsql/src/backend/nodes/Makefile,v 1.16 2004/01/07 18:43:36 neilc Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
@@ -14,7 +14,7 @@ include $(top_builddir)/src/Makefile.global
|
||||
|
||||
OBJS = nodeFuncs.o nodes.o list.o bitmapset.o \
|
||||
copyfuncs.o equalfuncs.o makefuncs.o \
|
||||
outfuncs.o readfuncs.o print.o read.o
|
||||
outfuncs.o readfuncs.o print.o read.o value.o
|
||||
|
||||
all: SUBSYS.o
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* list.c
|
||||
* POSTGRES generic list package
|
||||
* implementation for PostgreSQL generic linked list package
|
||||
*
|
||||
*
|
||||
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
|
||||
@@ -9,17 +9,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/list.c,v 1.55 2003/11/29 19:51:49 pgsql Exp $
|
||||
*
|
||||
* NOTES
|
||||
* XXX a few of the following functions are duplicated to handle
|
||||
* List of pointers and List of integers separately. Some day,
|
||||
* someone should unify them. - ay 11/2/94
|
||||
* This file needs cleanup.
|
||||
*
|
||||
* HISTORY
|
||||
* AUTHOR DATE MAJOR EVENT
|
||||
* Andrew Yu Oct, 1994 file creation
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/list.c,v 1.56 2004/01/07 18:43:36 neilc Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -27,67 +17,6 @@
|
||||
|
||||
#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;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* lcons
|
||||
*
|
||||
|
||||
75
src/backend/nodes/value.c
Normal file
75
src/backend/nodes/value.c
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user