Download pgsql/include/server/nodes/nodeFuncs.h from codekingpro/portable-devtools: direct link, hf CLI and curl.
- Browser
- Download file 7.65 kB
-
https://huggingface.co/datasets/codekingpro/portable-devtools/resolve/df58e70f9edde36aaca2d2aacc2440dd6c2f807d/pgsql/include/server/nodes/nodeFuncs.h
- Command line
-
hf download hf://datasets/codekingpro/portable-devtools@df58e70f9edde36aaca2d2aacc2440dd6c2f807d/pgsql/include/server/nodes/nodeFuncs.h
-
curl -L -o nodeFuncs.h https://huggingface.co/datasets/codekingpro/portable-devtools/resolve/df58e70f9edde36aaca2d2aacc2440dd6c2f807d/pgsql/include/server/nodes/nodeFuncs.h
7.65 kB
| /*------------------------------------------------------------------------- | |
| * | |
| * nodeFuncs.h | |
| * Various general-purpose manipulations of Node trees | |
| * | |
| * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group | |
| * Portions Copyright (c) 1994, Regents of the University of California | |
| * | |
| * src/include/nodes/nodeFuncs.h | |
| * | |
| *------------------------------------------------------------------------- | |
| */ | |
| struct PlanState; /* avoid including execnodes.h too */ | |
| /* flags bits for query_tree_walker and query_tree_mutator */ | |
| /* callback function for check_functions_in_node */ | |
| typedef bool (*check_function_callback) (Oid func_id, void *context); | |
| /* callback functions for tree walkers */ | |
| typedef bool (*tree_walker_callback) (Node *node, void *context); | |
| typedef bool (*planstate_tree_walker_callback) (struct PlanState *planstate, | |
| void *context); | |
| /* callback functions for tree mutators */ | |
| typedef Node *(*tree_mutator_callback) (Node *node, void *context); | |
| extern Oid exprType(const Node *expr); | |
| extern int32 exprTypmod(const Node *expr); | |
| extern bool exprIsLengthCoercion(const Node *expr, int32 *coercedTypmod); | |
| extern Node *applyRelabelType(Node *arg, Oid rtype, int32 rtypmod, Oid rcollid, | |
| CoercionForm rformat, int rlocation, | |
| bool overwrite_ok); | |
| extern Node *relabel_to_typmod(Node *expr, int32 typmod); | |
| extern Node *strip_implicit_coercions(Node *node); | |
| extern bool expression_returns_set(Node *clause); | |
| extern Oid exprCollation(const Node *expr); | |
| extern Oid exprInputCollation(const Node *expr); | |
| extern void exprSetCollation(Node *expr, Oid collation); | |
| extern void exprSetInputCollation(Node *expr, Oid inputcollation); | |
| extern int exprLocation(const Node *expr); | |
| extern void fix_opfuncids(Node *node); | |
| extern void set_opfuncid(OpExpr *opexpr); | |
| extern void set_sa_opfuncid(ScalarArrayOpExpr *opexpr); | |
| /* Is clause a FuncExpr clause? */ | |
| static inline bool | |
| is_funcclause(const void *clause) | |
| { | |
| return clause != NULL && IsA(clause, FuncExpr); | |
| } | |
| /* Is clause an OpExpr clause? */ | |
| static inline bool | |
| is_opclause(const void *clause) | |
| { | |
| return clause != NULL && IsA(clause, OpExpr); | |
| } | |
| /* Extract left arg of a binary opclause, or only arg of a unary opclause */ | |
| static inline Node * | |
| get_leftop(const void *clause) | |
| { | |
| const OpExpr *expr = (const OpExpr *) clause; | |
| if (expr->args != NIL) | |
| return (Node *) linitial(expr->args); | |
| else | |
| return NULL; | |
| } | |
| /* Extract right arg of a binary opclause (NULL if it's a unary opclause) */ | |
| static inline Node * | |
| get_rightop(const void *clause) | |
| { | |
| const OpExpr *expr = (const OpExpr *) clause; | |
| if (list_length(expr->args) >= 2) | |
| return (Node *) lsecond(expr->args); | |
| else | |
| return NULL; | |
| } | |
| /* Is clause an AND clause? */ | |
| static inline bool | |
| is_andclause(const void *clause) | |
| { | |
| return (clause != NULL && | |
| IsA(clause, BoolExpr) && | |
| ((const BoolExpr *) clause)->boolop == AND_EXPR); | |
| } | |
| /* Is clause an OR clause? */ | |
| static inline bool | |
| is_orclause(const void *clause) | |
| { | |
| return (clause != NULL && | |
| IsA(clause, BoolExpr) && | |
| ((const BoolExpr *) clause)->boolop == OR_EXPR); | |
| } | |
| /* Is clause a NOT clause? */ | |
| static inline bool | |
| is_notclause(const void *clause) | |
| { | |
| return (clause != NULL && | |
| IsA(clause, BoolExpr) && | |
| ((const BoolExpr *) clause)->boolop == NOT_EXPR); | |
| } | |
| /* Extract argument from a clause known to be a NOT clause */ | |
| static inline Expr * | |
| get_notclausearg(const void *notclause) | |
| { | |
| return (Expr *) linitial(((const BoolExpr *) notclause)->args); | |
| } | |
| extern bool check_functions_in_node(Node *node, check_function_callback checker, | |
| void *context); | |
| /* | |
| * The following functions are usually passed walker or mutator callbacks | |
| * that are declared like "bool walker(Node *node, my_struct *context)" | |
| * rather than "bool walker(Node *node, void *context)" as a strict reading | |
| * of the C standard would require. Changing the callbacks' declarations | |
| * to "void *" would create serious hazards of passing them the wrong context | |
| * struct type, so we respectfully decline to support the standard's position | |
| * that a pointer to struct is incompatible with "void *". Instead, silence | |
| * related compiler warnings by inserting casts into these macro wrappers. | |
| */ | |
| extern bool expression_tree_walker_impl(Node *node, | |
| tree_walker_callback walker, | |
| void *context); | |
| extern Node *expression_tree_mutator_impl(Node *node, | |
| tree_mutator_callback mutator, | |
| void *context); | |
| extern bool query_tree_walker_impl(Query *query, | |
| tree_walker_callback walker, | |
| void *context, int flags); | |
| extern Query *query_tree_mutator_impl(Query *query, | |
| tree_mutator_callback mutator, | |
| void *context, int flags); | |
| extern bool range_table_walker_impl(List *rtable, | |
| tree_walker_callback walker, | |
| void *context, int flags); | |
| extern List *range_table_mutator_impl(List *rtable, | |
| tree_mutator_callback mutator, | |
| void *context, int flags); | |
| extern bool range_table_entry_walker_impl(RangeTblEntry *rte, | |
| tree_walker_callback walker, | |
| void *context, int flags); | |
| extern bool query_or_expression_tree_walker_impl(Node *node, | |
| tree_walker_callback walker, | |
| void *context, int flags); | |
| extern Node *query_or_expression_tree_mutator_impl(Node *node, | |
| tree_mutator_callback mutator, | |
| void *context, int flags); | |
| extern bool raw_expression_tree_walker_impl(Node *node, | |
| tree_walker_callback walker, | |
| void *context); | |
| extern bool planstate_tree_walker_impl(struct PlanState *planstate, | |
| planstate_tree_walker_callback walker, | |
| void *context); | |