PostgreSQL Source Code  git master
ilist.c File Reference
#include "postgres.h"
#include "lib/ilist.h"
Include dependency graph for ilist.c:

Go to the source code of this file.

Functions

void slist_delete (slist_head *head, const slist_node *node)
 

Function Documentation

◆ slist_delete()

void slist_delete ( slist_head head,
const slist_node node 
)

Definition at line 31 of file ilist.c.

32 {
33  slist_node *last = &head->head;
34  slist_node *cur;
35  bool found PG_USED_FOR_ASSERTS_ONLY = false;
36 
37  while ((cur = last->next) != NULL)
38  {
39  if (cur == node)
40  {
41  last->next = cur->next;
42 #ifdef USE_ASSERT_CHECKING
43  found = true;
44 #endif
45  break;
46  }
47  last = cur;
48  }
49  Assert(found);
50 
51  slist_check(head);
52 }
#define PG_USED_FOR_ASSERTS_ONLY
Definition: c.h:185
#define Assert(condition)
Definition: c.h:861
struct cursor * cur
Definition: ecpg.c:28
#define slist_check(head)
Definition: ilist.h:304
struct cursor * next
Definition: type.h:147
slist_node head
Definition: ilist.h:238
slist_node * next
Definition: ilist.h:226

References Assert, cur, slist_head::head, slist_node::next, cursor::next, PG_USED_FOR_ASSERTS_ONLY, and slist_check.

Referenced by reapply_stacked_values(), and RemoveGUCFromLists().