OSDN Git Service

Break parser functions into smaller files, group together.
[pg-rex/syncrep.git] / src / include / parser / parse_func.h
1 /*-------------------------------------------------------------------------
2  *
3  * catalog_utils.h--
4  *
5  *
6  *
7  * Copyright (c) 1994, Regents of the University of California
8  *
9  * $Id: parse_func.h,v 1.1 1997/11/25 22:06:56 momjian 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  *      This structure is used to explore the inheritance hierarchy above
25  *      nodes in the type tree in order to disambiguate among polymorphic
26  *      functions.
27  */
28 typedef struct _InhPaths
29 {
30         int                     nsupers;                /* number of superclasses */
31         Oid                     self;                   /* this class */
32         Oid                *supervec;           /* vector of superclasses */
33 } InhPaths;
34
35 /*
36  *      This structure holds a list of possible functions or operators that
37  *      agree with the known name and argument types of the function/operator.
38  */
39 typedef struct _CandidateList
40 {
41         Oid                *args;
42         struct _CandidateList *next;
43 }                  *CandidateList;
44
45 Node *ParseFunc(ParseState *pstate, char *funcname, List *fargs,
46         int *curr_resno);
47
48 Oid funcid_get_rettype(Oid funcid);
49
50 CandidateList func_get_candidates(char *funcname, int nargs);
51
52 bool can_coerce(int nargs, Oid *input_typeids, Oid *func_typeids);
53
54 int match_argtypes(int nargs,
55                                    Oid *input_typeids,
56                                    CandidateList function_typeids,
57                                    CandidateList *candidates);
58
59 Oid * func_select_candidate(int nargs,
60                                                   Oid *input_typeids,
61                                                   CandidateList candidates);
62
63 bool func_get_detail(char *funcname,
64                                         int nargs,
65                                         Oid *oid_array,
66                                         Oid *funcid,    /* return value */
67                                         Oid *rettype,   /* return value */
68                                         bool *retset,   /* return value */
69                                         Oid **true_typeids);
70
71 Oid ** argtype_inherit(int nargs, Oid *oid_array);
72
73 int findsupers(Oid relid, Oid **supervec);
74
75 Oid **genxprod(InhPaths *arginh, int nargs);
76
77 void make_arguments(int nargs,
78                                    List *fargs,
79                                    Oid *input_typeids,
80                                    Oid *function_typeids);
81
82 List *setup_tlist(char *attname, Oid relid);
83
84 List *setup_base_tlist(Oid typeid);
85
86 Node *ParseComplexProjection(ParseState *pstate,
87                                                    char *funcname,
88                                                    Node *first_arg,
89                                                    bool *attisset);
90         
91 void func_error(char *caller, char *funcname, int nargs, Oid *argtypes);
92
93                                    
94
95
96 #endif                                                  /* PARSE_FUNC_H */
97