Commit d5f23af6 authored by Peter Eisentraut's avatar Peter Eisentraut

Add const qualifiers to node inspection functions

Thomas Munro
parent 0d0ec527
This diff is collapsed.
This diff is collapsed.
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
* Check that the specified List is valid (so far as we can tell). * Check that the specified List is valid (so far as we can tell).
*/ */
static void static void
check_list_invariants(List *list) check_list_invariants(const List *list)
{ {
if (list == NIL) if (list == NIL)
return; return;
...@@ -383,7 +383,7 @@ list_truncate(List *list, int new_size) ...@@ -383,7 +383,7 @@ list_truncate(List *list, int new_size)
* failure if there is no such cell. * failure if there is no such cell.
*/ */
static ListCell * static ListCell *
list_nth_cell(List *list, int n) list_nth_cell(const List *list, int n)
{ {
ListCell *match; ListCell *match;
...@@ -407,7 +407,7 @@ list_nth_cell(List *list, int n) ...@@ -407,7 +407,7 @@ list_nth_cell(List *list, int n)
* specified list. (List elements begin at 0.) * specified list. (List elements begin at 0.)
*/ */
void * void *
list_nth(List *list, int n) list_nth(const List *list, int n)
{ {
Assert(IsPointerList(list)); Assert(IsPointerList(list));
return lfirst(list_nth_cell(list, n)); return lfirst(list_nth_cell(list, n));
...@@ -418,7 +418,7 @@ list_nth(List *list, int n) ...@@ -418,7 +418,7 @@ list_nth(List *list, int n)
* specified list. * specified list.
*/ */
int int
list_nth_int(List *list, int n) list_nth_int(const List *list, int n)
{ {
Assert(IsIntegerList(list)); Assert(IsIntegerList(list));
return lfirst_int(list_nth_cell(list, n)); return lfirst_int(list_nth_cell(list, n));
...@@ -429,7 +429,7 @@ list_nth_int(List *list, int n) ...@@ -429,7 +429,7 @@ list_nth_int(List *list, int n)
* list. * list.
*/ */
Oid Oid
list_nth_oid(List *list, int n) list_nth_oid(const List *list, int n)
{ {
Assert(IsOidList(list)); Assert(IsOidList(list));
return lfirst_oid(list_nth_cell(list, n)); return lfirst_oid(list_nth_cell(list, n));
...@@ -441,9 +441,9 @@ list_nth_oid(List *list, int n) ...@@ -441,9 +441,9 @@ list_nth_oid(List *list, int n)
* Node as 'datum'. * Node as 'datum'.
*/ */
bool bool
list_member(List *list, void *datum) list_member(const List *list, const void *datum)
{ {
ListCell *cell; const ListCell *cell;
Assert(IsPointerList(list)); Assert(IsPointerList(list));
check_list_invariants(list); check_list_invariants(list);
...@@ -462,9 +462,9 @@ list_member(List *list, void *datum) ...@@ -462,9 +462,9 @@ list_member(List *list, void *datum)
* determined by using simple pointer comparison. * determined by using simple pointer comparison.
*/ */
bool bool
list_member_ptr(List *list, void *datum) list_member_ptr(const List *list, const void *datum)
{ {
ListCell *cell; const ListCell *cell;
Assert(IsPointerList(list)); Assert(IsPointerList(list));
check_list_invariants(list); check_list_invariants(list);
...@@ -482,9 +482,9 @@ list_member_ptr(List *list, void *datum) ...@@ -482,9 +482,9 @@ list_member_ptr(List *list, void *datum)
* Return true iff the integer 'datum' is a member of the list. * Return true iff the integer 'datum' is a member of the list.
*/ */
bool bool
list_member_int(List *list, int datum) list_member_int(const List *list, int datum)
{ {
ListCell *cell; const ListCell *cell;
Assert(IsIntegerList(list)); Assert(IsIntegerList(list));
check_list_invariants(list); check_list_invariants(list);
...@@ -502,9 +502,9 @@ list_member_int(List *list, int datum) ...@@ -502,9 +502,9 @@ list_member_int(List *list, int datum)
* Return true iff the OID 'datum' is a member of the list. * Return true iff the OID 'datum' is a member of the list.
*/ */
bool bool
list_member_oid(List *list, Oid datum) list_member_oid(const List *list, Oid datum)
{ {
ListCell *cell; const ListCell *cell;
Assert(IsOidList(list)); Assert(IsOidList(list));
check_list_invariants(list); check_list_invariants(list);
...@@ -694,10 +694,10 @@ list_delete_first(List *list) ...@@ -694,10 +694,10 @@ list_delete_first(List *list)
* performance bottleneck. * performance bottleneck.
*/ */
List * List *
list_union(List *list1, List *list2) list_union(const List *list1, const List *list2)
{ {
List *result; List *result;
ListCell *cell; const ListCell *cell;
Assert(IsPointerList(list1)); Assert(IsPointerList(list1));
Assert(IsPointerList(list2)); Assert(IsPointerList(list2));
...@@ -718,10 +718,10 @@ list_union(List *list1, List *list2) ...@@ -718,10 +718,10 @@ list_union(List *list1, List *list2)
* pointer comparison. * pointer comparison.
*/ */
List * List *
list_union_ptr(List *list1, List *list2) list_union_ptr(const List *list1, const List *list2)
{ {
List *result; List *result;
ListCell *cell; const ListCell *cell;
Assert(IsPointerList(list1)); Assert(IsPointerList(list1));
Assert(IsPointerList(list2)); Assert(IsPointerList(list2));
...@@ -741,10 +741,10 @@ list_union_ptr(List *list1, List *list2) ...@@ -741,10 +741,10 @@ list_union_ptr(List *list1, List *list2)
* This variant of list_union() operates upon lists of integers. * This variant of list_union() operates upon lists of integers.
*/ */
List * List *
list_union_int(List *list1, List *list2) list_union_int(const List *list1, const List *list2)
{ {
List *result; List *result;
ListCell *cell; const ListCell *cell;
Assert(IsIntegerList(list1)); Assert(IsIntegerList(list1));
Assert(IsIntegerList(list2)); Assert(IsIntegerList(list2));
...@@ -764,10 +764,10 @@ list_union_int(List *list1, List *list2) ...@@ -764,10 +764,10 @@ list_union_int(List *list1, List *list2)
* This variant of list_union() operates upon lists of OIDs. * This variant of list_union() operates upon lists of OIDs.
*/ */
List * List *
list_union_oid(List *list1, List *list2) list_union_oid(const List *list1, const List *list2)
{ {
List *result; List *result;
ListCell *cell; const ListCell *cell;
Assert(IsOidList(list1)); Assert(IsOidList(list1));
Assert(IsOidList(list2)); Assert(IsOidList(list2));
...@@ -797,10 +797,10 @@ list_union_oid(List *list1, List *list2) ...@@ -797,10 +797,10 @@ list_union_oid(List *list1, List *list2)
* to in the result. * to in the result.
*/ */
List * List *
list_intersection(List *list1, List *list2) list_intersection(const List *list1, const List *list2)
{ {
List *result; List *result;
ListCell *cell; const ListCell *cell;
if (list1 == NIL || list2 == NIL) if (list1 == NIL || list2 == NIL)
return NIL; return NIL;
...@@ -829,9 +829,9 @@ list_intersection(List *list1, List *list2) ...@@ -829,9 +829,9 @@ list_intersection(List *list1, List *list2)
* membership via equal() * membership via equal()
*/ */
List * List *
list_difference(List *list1, List *list2) list_difference(const List *list1, const List *list2)
{ {
ListCell *cell; const ListCell *cell;
List *result = NIL; List *result = NIL;
Assert(IsPointerList(list1)); Assert(IsPointerList(list1));
...@@ -855,9 +855,9 @@ list_difference(List *list1, List *list2) ...@@ -855,9 +855,9 @@ list_difference(List *list1, List *list2)
* simple pointer equality. * simple pointer equality.
*/ */
List * List *
list_difference_ptr(List *list1, List *list2) list_difference_ptr(const List *list1, const List *list2)
{ {
ListCell *cell; const ListCell *cell;
List *result = NIL; List *result = NIL;
Assert(IsPointerList(list1)); Assert(IsPointerList(list1));
...@@ -880,9 +880,9 @@ list_difference_ptr(List *list1, List *list2) ...@@ -880,9 +880,9 @@ list_difference_ptr(List *list1, List *list2)
* This variant of list_difference() operates upon lists of integers. * This variant of list_difference() operates upon lists of integers.
*/ */
List * List *
list_difference_int(List *list1, List *list2) list_difference_int(const List *list1, const List *list2)
{ {
ListCell *cell; const ListCell *cell;
List *result = NIL; List *result = NIL;
Assert(IsIntegerList(list1)); Assert(IsIntegerList(list1));
...@@ -905,9 +905,9 @@ list_difference_int(List *list1, List *list2) ...@@ -905,9 +905,9 @@ list_difference_int(List *list1, List *list2)
* This variant of list_difference() operates upon lists of OIDs. * This variant of list_difference() operates upon lists of OIDs.
*/ */
List * List *
list_difference_oid(List *list1, List *list2) list_difference_oid(const List *list1, const List *list2)
{ {
ListCell *cell; const ListCell *cell;
List *result = NIL; List *result = NIL;
Assert(IsOidList(list1)); Assert(IsOidList(list1));
...@@ -1131,7 +1131,7 @@ list_free_deep(List *list) ...@@ -1131,7 +1131,7 @@ list_free_deep(List *list)
* Return a shallow copy of the specified list. * Return a shallow copy of the specified list.
*/ */
List * List *
list_copy(List *oldlist) list_copy(const List *oldlist)
{ {
List *newlist; List *newlist;
ListCell *newlist_prev; ListCell *newlist_prev;
...@@ -1174,7 +1174,7 @@ list_copy(List *oldlist) ...@@ -1174,7 +1174,7 @@ list_copy(List *oldlist)
* Return a shallow copy of the specified list, without the first N elements. * Return a shallow copy of the specified list, without the first N elements.
*/ */
List * List *
list_copy_tail(List *oldlist, int nskip) list_copy_tail(const List *oldlist, int nskip)
{ {
List *newlist; List *newlist;
ListCell *newlist_prev; ListCell *newlist_prev;
...@@ -1230,7 +1230,7 @@ list_copy_tail(List *oldlist, int nskip) ...@@ -1230,7 +1230,7 @@ list_copy_tail(List *oldlist, int nskip)
#ifndef USE_INLINE #ifndef USE_INLINE
ListCell * ListCell *
list_head(List *l) list_head(const List *l)
{ {
return l ? l->head : NULL; return l ? l->head : NULL;
} }
...@@ -1242,7 +1242,7 @@ list_tail(List *l) ...@@ -1242,7 +1242,7 @@ list_tail(List *l)
} }
int int
list_length(List *l) list_length(const List *l)
{ {
return l ? l->length : 0; return l ? l->length : 0;
} }
...@@ -1264,10 +1264,10 @@ list_length(List *l) ...@@ -1264,10 +1264,10 @@ list_length(List *l)
* list_length() macro in order to avoid the overhead of a function * list_length() macro in order to avoid the overhead of a function
* call. * call.
*/ */
int length(List *list); int length(const List *list);
int int
length(List *list) length(const List *list)
{ {
return list_length(list); return list_length(list);
} }
This diff is collapsed.
This diff is collapsed.
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
* print contents of Node to stdout * print contents of Node to stdout
*/ */
void void
print(void *obj) print(const void *obj)
{ {
char *s; char *s;
char *f; char *f;
...@@ -49,7 +49,7 @@ print(void *obj) ...@@ -49,7 +49,7 @@ print(void *obj)
* pretty-print contents of Node to stdout * pretty-print contents of Node to stdout
*/ */
void void
pprint(void *obj) pprint(const void *obj)
{ {
char *s; char *s;
char *f; char *f;
...@@ -67,7 +67,7 @@ pprint(void *obj) ...@@ -67,7 +67,7 @@ pprint(void *obj)
* send pretty-printed contents of Node to postmaster log * send pretty-printed contents of Node to postmaster log
*/ */
void void
elog_node_display(int lev, const char *title, void *obj, bool pretty) elog_node_display(int lev, const char *title, const void *obj, bool pretty)
{ {
char *s; char *s;
char *f; char *f;
...@@ -249,9 +249,9 @@ pretty_format_node_dump(const char *dump) ...@@ -249,9 +249,9 @@ pretty_format_node_dump(const char *dump)
* print contents of range table * print contents of range table
*/ */
void void
print_rt(List *rtable) print_rt(const List *rtable)
{ {
ListCell *l; const ListCell *l;
int i = 1; int i = 1;
printf("resno\trefname \trelid\tinFromCl\n"); printf("resno\trefname \trelid\tinFromCl\n");
...@@ -304,7 +304,7 @@ print_rt(List *rtable) ...@@ -304,7 +304,7 @@ print_rt(List *rtable)
* print an expression * print an expression
*/ */
void void
print_expr(Node *expr, List *rtable) print_expr(const Node *expr, const List *rtable)
{ {
if (expr == NULL) if (expr == NULL)
{ {
...@@ -314,7 +314,7 @@ print_expr(Node *expr, List *rtable) ...@@ -314,7 +314,7 @@ print_expr(Node *expr, List *rtable)
if (IsA(expr, Var)) if (IsA(expr, Var))
{ {
Var *var = (Var *) expr; const Var *var = (const Var *) expr;
char *relname, char *relname,
*attname; *attname;
...@@ -348,7 +348,7 @@ print_expr(Node *expr, List *rtable) ...@@ -348,7 +348,7 @@ print_expr(Node *expr, List *rtable)
} }
else if (IsA(expr, Const)) else if (IsA(expr, Const))
{ {
Const *c = (Const *) expr; const Const *c = (const Const *) expr;
Oid typoutput; Oid typoutput;
bool typIsVarlena; bool typIsVarlena;
char *outputstr; char *outputstr;
...@@ -368,26 +368,26 @@ print_expr(Node *expr, List *rtable) ...@@ -368,26 +368,26 @@ print_expr(Node *expr, List *rtable)
} }
else if (IsA(expr, OpExpr)) else if (IsA(expr, OpExpr))
{ {
OpExpr *e = (OpExpr *) expr; const OpExpr *e = (const OpExpr *) expr;
char *opname; char *opname;
opname = get_opname(e->opno); opname = get_opname(e->opno);
if (list_length(e->args) > 1) if (list_length(e->args) > 1)
{ {
print_expr(get_leftop((Expr *) e), rtable); print_expr(get_leftop((const Expr *) e), rtable);
printf(" %s ", ((opname != NULL) ? opname : "(invalid operator)")); printf(" %s ", ((opname != NULL) ? opname : "(invalid operator)"));
print_expr(get_rightop((Expr *) e), rtable); print_expr(get_rightop((const Expr *) e), rtable);
} }
else else
{ {
/* we print prefix and postfix ops the same... */ /* we print prefix and postfix ops the same... */
printf("%s ", ((opname != NULL) ? opname : "(invalid operator)")); printf("%s ", ((opname != NULL) ? opname : "(invalid operator)"));
print_expr(get_leftop((Expr *) e), rtable); print_expr(get_leftop((const Expr *) e), rtable);
} }
} }
else if (IsA(expr, FuncExpr)) else if (IsA(expr, FuncExpr))
{ {
FuncExpr *e = (FuncExpr *) expr; const FuncExpr *e = (const FuncExpr *) expr;
char *funcname; char *funcname;
ListCell *l; ListCell *l;
...@@ -410,9 +410,9 @@ print_expr(Node *expr, List *rtable) ...@@ -410,9 +410,9 @@ print_expr(Node *expr, List *rtable)
* pathkeys list of PathKeys * pathkeys list of PathKeys
*/ */
void void
print_pathkeys(List *pathkeys, List *rtable) print_pathkeys(const List *pathkeys, const List *rtable)
{ {
ListCell *i; const ListCell *i;
printf("("); printf("(");
foreach(i, pathkeys) foreach(i, pathkeys)
...@@ -450,9 +450,9 @@ print_pathkeys(List *pathkeys, List *rtable) ...@@ -450,9 +450,9 @@ print_pathkeys(List *pathkeys, List *rtable)
* print targetlist in a more legible way. * print targetlist in a more legible way.
*/ */
void void
print_tl(List *tlist, List *rtable) print_tl(const List *tlist, const List *rtable)
{ {
ListCell *tl; const ListCell *tl;
printf("(\n"); printf("(\n");
foreach(tl, tlist) foreach(tl, tlist)
......
...@@ -181,9 +181,9 @@ make_opclause(Oid opno, Oid opresulttype, bool opretset, ...@@ -181,9 +181,9 @@ make_opclause(Oid opno, Oid opresulttype, bool opretset,
* or (op expr) * or (op expr)
*/ */
Node * Node *
get_leftop(Expr *clause) get_leftop(const Expr *clause)
{ {
OpExpr *expr = (OpExpr *) clause; const OpExpr *expr = (const OpExpr *) clause;
if (expr->args != NIL) if (expr->args != NIL)
return linitial(expr->args); return linitial(expr->args);
...@@ -198,9 +198,9 @@ get_leftop(Expr *clause) ...@@ -198,9 +198,9 @@ get_leftop(Expr *clause)
* NB: result will be NULL if applied to a unary op clause. * NB: result will be NULL if applied to a unary op clause.
*/ */
Node * Node *
get_rightop(Expr *clause) get_rightop(const Expr *clause)
{ {
OpExpr *expr = (OpExpr *) clause; const OpExpr *expr = (const OpExpr *) clause;
if (list_length(expr->args) >= 2) if (list_length(expr->args) >= 2)
return lsecond(expr->args); return lsecond(expr->args);
......
...@@ -26,17 +26,17 @@ ...@@ -26,17 +26,17 @@
#define QTW_DONT_COPY_QUERY 0x20 /* do not copy top Query */ #define QTW_DONT_COPY_QUERY 0x20 /* do not copy top Query */
extern Oid exprType(Node *expr); extern Oid exprType(const Node *expr);
extern int32 exprTypmod(Node *expr); extern int32 exprTypmod(const Node *expr);
extern bool exprIsLengthCoercion(Node *expr, int32 *coercedTypmod); extern bool exprIsLengthCoercion(const Node *expr, int32 *coercedTypmod);
extern bool expression_returns_set(Node *clause); extern bool expression_returns_set(Node *clause);
extern Oid exprCollation(Node *expr); extern Oid exprCollation(const Node *expr);
extern Oid exprInputCollation(Node *expr); extern Oid exprInputCollation(const Node *expr);
extern void exprSetCollation(Node *expr, Oid collation); extern void exprSetCollation(Node *expr, Oid collation);
extern void exprSetInputCollation(Node *expr, Oid inputcollation); extern void exprSetInputCollation(Node *expr, Oid inputcollation);
extern int exprLocation(Node *expr); extern int exprLocation(const Node *expr);
extern bool expression_tree_walker(Node *node, bool (*walker) (), extern bool expression_tree_walker(Node *node, bool (*walker) (),
void *context); void *context);
......
...@@ -431,7 +431,7 @@ typedef struct Node ...@@ -431,7 +431,7 @@ typedef struct Node
NodeTag type; NodeTag type;
} Node; } Node;
#define nodeTag(nodeptr) (((Node*)(nodeptr))->type) #define nodeTag(nodeptr) (((const Node*)(nodeptr))->type)
/* /*
* newNode - * newNode -
...@@ -487,7 +487,7 @@ extern PGDLLIMPORT Node *newNodeMacroHolder; ...@@ -487,7 +487,7 @@ extern PGDLLIMPORT Node *newNodeMacroHolder;
/* /*
* nodes/{outfuncs.c,print.c} * nodes/{outfuncs.c,print.c}
*/ */
extern char *nodeToString(void *obj); extern char *nodeToString(const void *obj);
/* /*
* nodes/{readfuncs.c,read.c} * nodes/{readfuncs.c,read.c}
...@@ -497,12 +497,12 @@ extern void *stringToNode(char *str); ...@@ -497,12 +497,12 @@ extern void *stringToNode(char *str);
/* /*
* nodes/copyfuncs.c * nodes/copyfuncs.c
*/ */
extern void *copyObject(void *obj); extern void *copyObject(const void *obj);
/* /*
* nodes/equalfuncs.c * nodes/equalfuncs.c
*/ */
extern bool equal(void *a, void *b); extern bool equal(const void *a, const void *b);
/* /*
......
...@@ -77,7 +77,7 @@ struct ListCell ...@@ -77,7 +77,7 @@ struct ListCell
#ifdef USE_INLINE #ifdef USE_INLINE
static inline ListCell * static inline ListCell *
list_head(List *l) list_head(const List *l)
{ {
return l ? l->head : NULL; return l ? l->head : NULL;
} }
...@@ -89,15 +89,15 @@ list_tail(List *l) ...@@ -89,15 +89,15 @@ list_tail(List *l)
} }
static inline int static inline int
list_length(List *l) list_length(const List *l)
{ {
return l ? l->length : 0; return l ? l->length : 0;
} }
#else #else
extern ListCell *list_head(List *l); extern ListCell *list_head(const List *l);
extern ListCell *list_tail(List *l); extern ListCell *list_tail(List *l);
extern int list_length(List *l); extern int list_length(const List *l);
#endif /* USE_INLINE */ #endif /* USE_INLINE */
/* /*
...@@ -206,14 +206,14 @@ extern List *lcons_oid(Oid datum, List *list); ...@@ -206,14 +206,14 @@ extern List *lcons_oid(Oid datum, List *list);
extern List *list_concat(List *list1, List *list2); extern List *list_concat(List *list1, List *list2);
extern List *list_truncate(List *list, int new_size); extern List *list_truncate(List *list, int new_size);
extern void *list_nth(List *list, int n); extern void *list_nth(const List *list, int n);
extern int list_nth_int(List *list, int n); extern int list_nth_int(const List *list, int n);
extern Oid list_nth_oid(List *list, int n); extern Oid list_nth_oid(const List *list, int n);
extern bool list_member(List *list, void *datum); extern bool list_member(const List *list, const void *datum);
extern bool list_member_ptr(List *list, void *datum); extern bool list_member_ptr(const List *list, const void *datum);
extern bool list_member_int(List *list, int datum); extern bool list_member_int(const List *list, int datum);
extern bool list_member_oid(List *list, Oid datum); extern bool list_member_oid(const List *list, Oid datum);
extern List *list_delete(List *list, void *datum); extern List *list_delete(List *list, void *datum);
extern List *list_delete_ptr(List *list, void *datum); extern List *list_delete_ptr(List *list, void *datum);
...@@ -222,19 +222,19 @@ extern List *list_delete_oid(List *list, Oid datum); ...@@ -222,19 +222,19 @@ extern List *list_delete_oid(List *list, Oid datum);
extern List *list_delete_first(List *list); extern List *list_delete_first(List *list);
extern List *list_delete_cell(List *list, ListCell *cell, ListCell *prev); extern List *list_delete_cell(List *list, ListCell *cell, ListCell *prev);
extern List *list_union(List *list1, List *list2); extern List *list_union(const List *list1, const List *list2);
extern List *list_union_ptr(List *list1, List *list2); extern List *list_union_ptr(const List *list1, const List *list2);
extern List *list_union_int(List *list1, List *list2); extern List *list_union_int(const List *list1, const List *list2);
extern List *list_union_oid(List *list1, List *list2); extern List *list_union_oid(const List *list1, const List *list2);
extern List *list_intersection(List *list1, List *list2); extern List *list_intersection(const List *list1, const List *list2);
/* currently, there's no need for list_intersection_int etc */ /* currently, there's no need for list_intersection_int etc */
extern List *list_difference(List *list1, List *list2); extern List *list_difference(const List *list1, const List *list2);
extern List *list_difference_ptr(List *list1, List *list2); extern List *list_difference_ptr(const List *list1, const List *list2);
extern List *list_difference_int(List *list1, List *list2); extern List *list_difference_int(const List *list1, const List *list2);
extern List *list_difference_oid(List *list1, List *list2); extern List *list_difference_oid(const List *list1, const List *list2);
extern List *list_append_unique(List *list, void *datum); extern List *list_append_unique(List *list, void *datum);
extern List *list_append_unique_ptr(List *list, void *datum); extern List *list_append_unique_ptr(List *list, void *datum);
...@@ -249,8 +249,8 @@ extern List *list_concat_unique_oid(List *list1, List *list2); ...@@ -249,8 +249,8 @@ extern List *list_concat_unique_oid(List *list1, List *list2);
extern void list_free(List *list); extern void list_free(List *list);
extern void list_free_deep(List *list); extern void list_free_deep(List *list);
extern List *list_copy(List *list); extern List *list_copy(const List *list);
extern List *list_copy_tail(List *list, int nskip); extern List *list_copy_tail(const List *list, int nskip);
/* /*
* To ease migration to the new list API, a set of compatibility * To ease migration to the new list API, a set of compatibility
......
...@@ -19,16 +19,16 @@ ...@@ -19,16 +19,16 @@
#define nodeDisplay(x) pprint(x) #define nodeDisplay(x) pprint(x)
extern void print(void *obj); extern void print(const void *obj);
extern void pprint(void *obj); extern void pprint(const void *obj);
extern void elog_node_display(int lev, const char *title, extern void elog_node_display(int lev, const char *title,
void *obj, bool pretty); const void *obj, bool pretty);
extern char *format_node_dump(const char *dump); extern char *format_node_dump(const char *dump);
extern char *pretty_format_node_dump(const char *dump); extern char *pretty_format_node_dump(const char *dump);
extern void print_rt(List *rtable); extern void print_rt(const List *rtable);
extern void print_expr(Node *expr, List *rtable); extern void print_expr(const Node *expr, const List *rtable);
extern void print_pathkeys(List *pathkeys, List *rtable); extern void print_pathkeys(const List *pathkeys, const List *rtable);
extern void print_tl(List *tlist, List *rtable); extern void print_tl(const List *tlist, const List *rtable);
extern void print_slot(TupleTableSlot *slot); extern void print_slot(TupleTableSlot *slot);
#endif /* PRINT_H */ #endif /* PRINT_H */
...@@ -31,8 +31,8 @@ typedef struct ...@@ -31,8 +31,8 @@ typedef struct
extern Expr *make_opclause(Oid opno, Oid opresulttype, bool opretset, extern Expr *make_opclause(Oid opno, Oid opresulttype, bool opretset,
Expr *leftop, Expr *rightop, Expr *leftop, Expr *rightop,
Oid opcollid, Oid inputcollid); Oid opcollid, Oid inputcollid);
extern Node *get_leftop(Expr *clause); extern Node *get_leftop(const Expr *clause);
extern Node *get_rightop(Expr *clause); extern Node *get_rightop(const Expr *clause);
extern bool not_clause(Node *clause); extern bool not_clause(Node *clause);
extern Expr *make_notclause(Expr *notclause); extern Expr *make_notclause(Expr *notclause);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment