aboutsummaryrefslogtreecommitdiff
path: root/src/backend/nodes/nodeFuncs.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>1997-09-07 05:04:48 +0000
committerBruce Momjian <bruce@momjian.us>1997-09-07 05:04:48 +0000
commit1ccd423235a48739d6f7a4d7889705b5f9ecc69b (patch)
tree8001c4e839dfad8f29ceda7f8c5f5dbb8759b564 /src/backend/nodes/nodeFuncs.c
parent8fecd4febf8357f3cc20383ed29ced484877d5ac (diff)
downloadpostgresql-1ccd423235a48739d6f7a4d7889705b5f9ecc69b.tar.gz
postgresql-1ccd423235a48739d6f7a4d7889705b5f9ecc69b.zip
Massive commit to run PGINDENT on all *.c and *.h files.
Diffstat (limited to 'src/backend/nodes/nodeFuncs.c')
-rw-r--r--src/backend/nodes/nodeFuncs.c119
1 files changed, 58 insertions, 61 deletions
diff --git a/src/backend/nodes/nodeFuncs.c b/src/backend/nodes/nodeFuncs.c
index e1e6bc6f140..081760eaca2 100644
--- a/src/backend/nodes/nodeFuncs.c
+++ b/src/backend/nodes/nodeFuncs.c
@@ -1,18 +1,18 @@
/*-------------------------------------------------------------------------
*
* nodeFuncs.c--
- * All node routines more complicated than simple access/modification
+ * All node routines more complicated than simple access/modification
*
* Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/nodeFuncs.c,v 1.3 1997/08/19 21:31:41 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/nodeFuncs.c,v 1.4 1997/09/07 04:42:49 momjian Exp $
*
*-------------------------------------------------------------------------
*/
-#include <sys/types.h>
+#include <sys/types.h>
#include "postgres.h"
@@ -23,99 +23,96 @@
#include "nodes/nodeFuncs.h"
#include "utils/lsyscache.h"
-static bool var_is_inner(Var *var);
+static bool var_is_inner(Var * var);
-/*
+/*
* single_node -
- * Returns t if node corresponds to a single-noded expression
+ * Returns t if node corresponds to a single-noded expression
*/
bool
-single_node(Node *node)
+single_node(Node * node)
{
- if(IsA(node,Ident) || IsA(node,Const) || IsA(node,Var) || IsA(node,Param))
- return(true);
- else
- return(false);
+ if (IsA(node, Ident) || IsA(node, Const) || IsA(node, Var) || IsA(node, Param))
+ return (true);
+ else
+ return (false);
}
/*****************************************************************************
- * VAR nodes
+ * VAR nodes
*****************************************************************************/
-/*
- * var_is_outer
- * var_is_inner
- * var_is_mat
- * var_is_rel
- *
- * Returns t iff the var node corresponds to (respectively):
- * the outer relation in a join
- * the inner relation of a join
- * a materialized relation
- * a base relation (i.e., not an attribute reference, a variable from
- * some lower join level, or a sort result)
- * var node is an array reference
- *
+/*
+ * var_is_outer
+ * var_is_inner
+ * var_is_mat
+ * var_is_rel
+ *
+ * Returns t iff the var node corresponds to (respectively):
+ * the outer relation in a join
+ * the inner relation of a join
+ * a materialized relation
+ * a base relation (i.e., not an attribute reference, a variable from
+ * some lower join level, or a sort result)
+ * var node is an array reference
+ *
*/
bool
-var_is_outer (Var *var)
+var_is_outer(Var * var)
{
- return((bool)(var->varno == OUTER));
+ return ((bool) (var->varno == OUTER));
}
-static bool
-var_is_inner (Var *var)
+static bool
+var_is_inner(Var * var)
{
- return ( (bool) (var->varno == INNER));
+ return ((bool) (var->varno == INNER));
}
bool
-var_is_rel (Var *var)
+var_is_rel(Var * var)
{
- return (bool)
- ! (var_is_inner (var) || var_is_outer (var));
+ return (bool)
+ ! (var_is_inner(var) || var_is_outer(var));
}
/*****************************************************************************
- * OPER nodes
+ * OPER nodes
*****************************************************************************/
-/*
+/*
* replace_opid -
- *
- * Given a oper node, resets the opfid field with the
- * procedure OID (regproc id).
- *
- * Returns the modified oper node.
- *
+ *
+ * Given a oper node, resets the opfid field with the
+ * procedure OID (regproc id).
+ *
+ * Returns the modified oper node.
+ *
*/
-Oper *
-replace_opid (Oper *oper)
+Oper *
+replace_opid(Oper * oper)
{
- oper->opid = get_opcode(oper->opno);
- oper->op_fcache = NULL;
- return(oper);
+ oper->opid = get_opcode(oper->opno);
+ oper->op_fcache = NULL;
+ return (oper);
}
/*****************************************************************************
- * constant (CONST, PARAM) nodes
+ * constant (CONST, PARAM) nodes
*****************************************************************************/
-/*
+/*
* non_null -
- * Returns t if the node is a non-null constant, e.g., if the node has a
- * valid `constvalue' field.
- *
+ * Returns t if the node is a non-null constant, e.g., if the node has a
+ * valid `constvalue' field.
+ *
*/
bool
-non_null (Expr *c)
+non_null(Expr * c)
{
-
- if ( IsA(c,Const) && ! ((Const*)c)->constisnull )
- return(true);
- else
- return(false);
-}
-
-
+ if (IsA(c, Const) && !((Const *) c)->constisnull)
+ return (true);
+ else
+ return (false);
+}