PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
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, slist_node *node)
 

Function Documentation

void slist_delete ( slist_head head,
slist_node node 
)

Definition at line 31 of file ilist.c.

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

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 }
slist_node head
Definition: ilist.h:205
struct cursor * cur
Definition: ecpg.c:28
#define slist_check(head)
Definition: ilist.h:268
slist_node * next
Definition: ilist.h:193
#define Assert(condition)
Definition: c.h:664
#define PG_USED_FOR_ASSERTS_ONLY
Definition: c.h:979