OSDN Git Service

Defend against function calls with more than 8 arguments (code
[pg-rex/syncrep.git] / src / include / parser / parse_func.h
1 /*-------------------------------------------------------------------------
2  *
3  * parse_func.h
4  *
5  *
6  *
7  * Copyright (c) 1994, Regents of the University of California
8  *
9  * $Id: parse_func.h,v 1.16 1999/06/17 22:21:40 tgl Exp $
10  *
11  *-------------------------------------------------------------------------
12  */
13 #ifndef PARSER_FUNC_H
14 #define PARSER_FUNC_H
15
16 #include <nodes/nodes.h>
17 #include <nodes/pg_list.h>
18 #include <nodes/parsenodes.h>
19 #include <nodes/primnodes.h>
20 #include <parser/parse_func.h>
21 #include <parser/parse_node.h>
22
23
24 #define MAXFARGS 8                              /* max # args to a c or postquel function */
25
26 /*
27  *      This structure is used to explore the inheritance hierarchy above
28  *      nodes in the type tree in order to disambiguate among polymorphic
29  *      functions.
30  */
31 typedef struct _InhPaths
32 {
33         int                     nsupers;                /* number of superclasses */
34         Oid                     self;                   /* this class */
35         Oid                *supervec;           /* vector of superclasses */
36 } InhPaths;
37
38 /*
39  *      This structure holds a list of possible functions or operators that
40  *      agree with the known name and argument types of the function/operator.
41  */
42 typedef struct _CandidateList
43 {
44         Oid                *args;
45         struct _CandidateList *next;
46 }                  *CandidateList;
47
48 extern Node *ParseNestedFuncOrColumn(ParseState *pstate, Attr *attr,
49                                                 int *curr_resno, int precedence);
50 extern Node *ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs,
51                                   int *curr_resno, int precedence);
52
53 extern void func_error(char *caller, char *funcname,
54                                            int nargs, Oid *argtypes, char *msg);
55
56 #endif   /* PARSE_FUNC_H */