OSDN Git Service

Another pgindent run. Fixes enum indenting, and improves #endif
[pg-rex/syncrep.git] / src / include / parser / parse_func.h
1 /*-------------------------------------------------------------------------
2  *
3  * parse_func.h
4  *
5  *
6  *
7  * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * $Id: parse_func.h,v 1.34 2001/10/28 06:26:08 momjian Exp $
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef PARSER_FUNC_H
15 #define PARSER_FUNC_H
16
17 #include "parser/parse_node.h"
18
19 /*
20  *      This structure is used to explore the inheritance hierarchy above
21  *      nodes in the type tree in order to disambiguate among polymorphic
22  *      functions.
23  */
24 typedef struct _InhPaths
25 {
26         int                     nsupers;                /* number of superclasses */
27         Oid                     self;                   /* this class */
28         Oid                *supervec;           /* vector of superclasses */
29 } InhPaths;
30
31 /*
32  *      This structure holds a list of possible functions or operators that
33  *      agree with the known name and argument types of the function/operator.
34  */
35 typedef struct _CandidateList
36 {
37         Oid                *args;
38         struct _CandidateList *next;
39 }                  *CandidateList;
40
41 /* Result codes for func_get_detail */
42 typedef enum
43 {
44         FUNCDETAIL_NOTFOUND,            /* no suitable interpretation */
45         FUNCDETAIL_NORMAL,                      /* found a matching function */
46         FUNCDETAIL_COERCION                     /* it's a type coercion request */
47 } FuncDetailCode;
48
49
50 extern Node *ParseNestedFuncOrColumn(ParseState *pstate, Attr *attr,
51                                                 int precedence);
52 extern Node *ParseFuncOrColumn(ParseState *pstate,
53                                   char *funcname, List *fargs,
54                                   bool agg_star, bool agg_distinct,
55                                   int precedence);
56
57 extern FuncDetailCode func_get_detail(char *funcname, List *fargs,
58                                 int nargs, Oid *argtypes,
59                                 Oid *funcid, Oid *rettype,
60                                 bool *retset, Oid **true_typeids);
61
62 extern bool typeInheritsFrom(Oid subclassTypeId, Oid superclassTypeId);
63
64 extern void func_error(char *caller, char *funcname,
65                    int nargs, Oid *argtypes, char *msg);
66
67 #endif   /* PARSE_FUNC_H */