OSDN Git Service

Cleanup up include files.
[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.2 1997/11/26 01:14:04 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 extern Node *ParseFunc(ParseState *pstate, char *funcname, List *fargs,
46         int *curr_resno);
47 extern Oid funcid_get_rettype(Oid funcid);
48 extern CandidateList func_get_candidates(char *funcname, int nargs);
49 extern bool can_coerce(int nargs, Oid *input_typeids, Oid *func_typeids);
50 extern int match_argtypes(int nargs,
51                                    Oid *input_typeids,
52                                    CandidateList function_typeids,
53                                    CandidateList *candidates);
54 extern Oid * func_select_candidate(int nargs,
55                                                   Oid *input_typeids,
56                                                   CandidateList candidates);
57 extern bool func_get_detail(char *funcname,
58                                         int nargs,
59                                         Oid *oid_array,
60                                         Oid *funcid,    /* return value */
61                                         Oid *rettype,   /* return value */
62                                         bool *retset,   /* return value */
63                                         Oid **true_typeids);
64 extern Oid ** argtype_inherit(int nargs, Oid *oid_array);
65 extern int findsupers(Oid relid, Oid **supervec);
66 extern Oid **genxprod(InhPaths *arginh, int nargs);
67 extern void make_arguments(int nargs,
68                                    List *fargs,
69                                    Oid *input_typeids,
70                                    Oid *function_typeids);
71
72 extern List *setup_tlist(char *attname, Oid relid);
73 extern List *setup_base_tlist(Oid typeid);
74 extern Node *ParseComplexProjection(ParseState *pstate,
75                                                    char *funcname,
76                                                    Node *first_arg,
77                                                    bool *attisset);
78 extern void func_error(char *caller, char *funcname, int nargs, Oid *argtypes);
79
80 #endif                                                  /* PARSE_FUNC_H */
81