Header And Logo

PostgreSQL
| The world's most advanced open source database.

Defines | Functions

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.

Defines

#define ILIST_INCLUDE_DEFINITIONS

Functions

void slist_delete (slist_head *head, slist_node *node)

Define Documentation

#define ILIST_INCLUDE_DEFINITIONS

Definition at line 22 of file ilist.c.


Function Documentation

void slist_delete ( slist_head head,
slist_node node 
)

Definition at line 34 of file ilist.c.

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

{
    slist_node *last = &head->head;
    slist_node *cur;
    bool found  PG_USED_FOR_ASSERTS_ONLY = false;

    while ((cur = last->next) != NULL)
    {
        if (cur == node)
        {
            last->next = cur->next;
#ifdef USE_ASSERT_CHECKING
            found = true;
#endif
            break;
        }
        last = cur;
    }
    Assert(found);

    slist_check(head);
}