summaryrefslogtreecommitdiff
path: root/src/backend/nodes/nodes.c
diff options
context:
space:
mode:
authorMarc G. Fournier <scrappy@hub.org>1996-07-09 06:22:35 +0000
committerMarc G. Fournier <scrappy@hub.org>1996-07-09 06:22:35 +0000
commitd31084e9d1118b25fd16580d9d8c2924b5740dff (patch)
tree3179e66307d54df9c7b966543550e601eb55e668 /src/backend/nodes/nodes.c
downloadpostgresql-d31084e9d1118b25fd16580d9d8c2924b5740dff.tar.gz
Postgres95 1.01 Distribution - Virgin SourcesPG95-1_01
Diffstat (limited to 'src/backend/nodes/nodes.c')
-rw-r--r--src/backend/nodes/nodes.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/backend/nodes/nodes.c b/src/backend/nodes/nodes.c
new file mode 100644
index 0000000000..82845cca15
--- /dev/null
+++ b/src/backend/nodes/nodes.c
@@ -0,0 +1,45 @@
+/*-------------------------------------------------------------------------
+ *
+ * nodes.c--
+ * support code for nodes (now that we get rid of the home-brew
+ * inheritance system, our support code for nodes get much simpler)
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ *
+ * IDENTIFICATION
+ * $Header: /cvsroot/pgsql/src/backend/nodes/nodes.c,v 1.1.1.1 1996/07/09 06:21:33 scrappy Exp $
+ *
+ * HISTORY
+ * Andrew Yu Oct 20, 1994 file creation
+ *
+ *-------------------------------------------------------------------------
+ */
+#include <string.h>
+#include "postgres.h"
+#include "utils/palloc.h"
+#include "utils/elog.h"
+#include "nodes/nodes.h" /* where func declarations of this file goes */
+
+/*
+ * newNode -
+ * create a new node of the specified size and tag the node with the
+ * specified tag.
+ *
+ * !WARNING!: Avoid using newNode directly. You should be using the
+ * macro makeNode. eg. to create a Resdom node, use makeNode(Resdom)
+ *
+ */
+Node *
+newNode(Size size, NodeTag tag)
+{
+ Node *newNode;
+
+ Assert(size >= 4); /* need the tag, at least */
+
+ newNode = (Node *)palloc(size);
+ memset((char *)newNode, 0, size);
+ newNode->type = tag;
+ return(newNode);
+}
+