mirror of
https://github.com/postgres/postgres.git
synced 2026-02-27 11:50:33 -05:00
Since C99, there can be a trailing comma after the last value in an enum definition. A lot of new code has been introducing this style on the fly. Some new patches are now taking an inconsistent approach to this. Some add the last comma on the fly if they add a new last value, some are trying to preserve the existing style in each place, some are even dropping the last comma if there was one. We could nudge this all in a consistent direction if we just add the trailing commas everywhere once. I omitted a few places where there was a fixed "last" value that will always stay last. I also skipped the header files of libpq and ecpg, in case people want to use those with older compilers. There were also a small number of cases where the enum type wasn't used anywhere (but the enum values were), which ended up confusing pgindent a bit, so I left those alone. Discussion: https://www.postgresql.org/message-id/flat/386f8c45-c8ac-4681-8add-e3b0852c1620%40eisentraut.org
74 lines
2.4 KiB
C
74 lines
2.4 KiB
C
/*-------------------------------------------------------------------------
|
|
*
|
|
* parse_func.h
|
|
*
|
|
*
|
|
*
|
|
* Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
|
*
|
|
* src/include/parser/parse_func.h
|
|
*
|
|
*-------------------------------------------------------------------------
|
|
*/
|
|
#ifndef PARSE_FUNC_H
|
|
#define PARSE_FUNC_H
|
|
|
|
#include "catalog/namespace.h"
|
|
#include "parser/parse_node.h"
|
|
|
|
|
|
/* Result codes for func_get_detail */
|
|
typedef enum
|
|
{
|
|
FUNCDETAIL_NOTFOUND, /* no matching function */
|
|
FUNCDETAIL_MULTIPLE, /* too many matching functions */
|
|
FUNCDETAIL_NORMAL, /* found a matching regular function */
|
|
FUNCDETAIL_PROCEDURE, /* found a matching procedure */
|
|
FUNCDETAIL_AGGREGATE, /* found a matching aggregate function */
|
|
FUNCDETAIL_WINDOWFUNC, /* found a matching window function */
|
|
FUNCDETAIL_COERCION, /* it's a type coercion request */
|
|
} FuncDetailCode;
|
|
|
|
|
|
extern Node *ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs,
|
|
Node *last_srf, FuncCall *fn, bool proc_call,
|
|
int location);
|
|
|
|
extern FuncDetailCode func_get_detail(List *funcname,
|
|
List *fargs, List *fargnames,
|
|
int nargs, Oid *argtypes,
|
|
bool expand_variadic, bool expand_defaults,
|
|
bool include_out_arguments,
|
|
Oid *funcid, Oid *rettype,
|
|
bool *retset, int *nvargs, Oid *vatype,
|
|
Oid **true_typeids, List **argdefaults);
|
|
|
|
extern int func_match_argtypes(int nargs,
|
|
Oid *input_typeids,
|
|
FuncCandidateList raw_candidates,
|
|
FuncCandidateList *candidates);
|
|
|
|
extern FuncCandidateList func_select_candidate(int nargs,
|
|
Oid *input_typeids,
|
|
FuncCandidateList candidates);
|
|
|
|
extern void make_fn_arguments(ParseState *pstate,
|
|
List *fargs,
|
|
Oid *actual_arg_types,
|
|
Oid *declared_arg_types);
|
|
|
|
extern const char *funcname_signature_string(const char *funcname, int nargs,
|
|
List *argnames, const Oid *argtypes);
|
|
extern const char *func_signature_string(List *funcname, int nargs,
|
|
List *argnames, const Oid *argtypes);
|
|
|
|
extern Oid LookupFuncName(List *funcname, int nargs, const Oid *argtypes,
|
|
bool missing_ok);
|
|
extern Oid LookupFuncWithArgs(ObjectType objtype, ObjectWithArgs *func,
|
|
bool missing_ok);
|
|
|
|
extern void check_srf_call_placement(ParseState *pstate, Node *last_srf,
|
|
int location);
|
|
|
|
#endif /* PARSE_FUNC_H */
|