]> granicus.if.org Git - postgresql/blob - src/include/optimizer/clauses.h
Clean up #include in /include directory. Add scripts for checking includes.
[postgresql] / src / include / optimizer / clauses.h
1 /*-------------------------------------------------------------------------
2  *
3  * clauses.h
4  *        prototypes for clauses.c.
5  *
6  *
7  * Copyright (c) 1994, Regents of the University of California
8  *
9  * $Id: clauses.h,v 1.20 1999/07/15 15:21:19 momjian Exp $
10  *
11  *-------------------------------------------------------------------------
12  */
13 #ifndef CLAUSES_H
14 #define CLAUSES_H
15
16 #include <nodes/relation.h>
17
18 extern Expr *make_clause(int type, Node *oper, List *args);
19
20 extern bool is_opclause(Node *clause);
21 extern Expr *make_opclause(Oper *op, Var *leftop, Var *rightop);
22 extern Var *get_leftop(Expr *clause);
23 extern Var *get_rightop(Expr *clause);
24
25 extern bool is_funcclause(Node *clause);
26 extern Expr *make_funcclause(Func *func, List *funcargs);
27
28 extern bool or_clause(Node *clause);
29 extern Expr *make_orclause(List *orclauses);
30
31 extern bool not_clause(Node *clause);
32 extern Expr *make_notclause(Expr *notclause);
33 extern Expr *get_notclausearg(Expr *notclause);
34
35 extern bool and_clause(Node *clause);
36 extern Expr *make_andclause(List *andclauses);
37
38 extern bool case_clause(Node *clause);
39
40 extern List *pull_constant_clauses(List *quals, List **constantQual);
41 extern void clause_get_relids_vars(Node *clause, Relids *relids, List **vars);
42 extern int      NumRelids(Node *clause);
43 extern bool contains_not(Node *clause);
44 extern bool is_joinable(Node *clause);
45 extern bool qual_clause_p(Node *clause);
46 extern void fix_opid(Node *clause);
47 extern List *fix_opids(List *clauses);
48 extern void get_relattval(Node *clause, int *relid,
49                           AttrNumber *attno, Datum *constval, int *flag);
50 extern void get_rels_atts(Node *clause, int *relid1,
51                           AttrNumber *attno1, int *relid2, AttrNumber *attno2);
52 extern void CommuteClause(Node *clause);
53
54 extern bool expression_tree_walker(Node *node, bool (*walker) (),
55                                                                    void *context);
56
57 #define is_subplan(clause)      ((Node*) (clause) != NULL && \
58                                                 nodeTag((Node*) (clause)) == T_Expr && \
59                                                 ((Expr *) (clause))->opType == SUBPLAN_EXPR)
60
61 #endif   /* CLAUSES_H */