/* iteration open-coded to due to the use of const */ for (cur = head->head.next; cur != &head->head; cur = cur->next)
{ if (cur == node) return;
}
elog(ERROR, "double linked list member check failure");
}
if (head == NULL)
elog(ERROR, "doubly linked list head address is NULL");
if (head->head.next == NULL && head->head.prev == NULL) return; /* OK, initialized as zeroes */
/* iterate in forward direction */ for (cur = head->head.next; cur != &head->head; cur = cur->next)
{ if (cur == NULL ||
cur->next == NULL ||
cur->prev == NULL ||
cur->prev->next != cur ||
cur->next->prev != cur)
elog(ERROR, "doubly linked list is corrupted");
}
/* iterate in backward direction */ for (cur = head->head.prev; cur != &head->head; cur = cur->prev)
{ if (cur == NULL ||
cur->next == NULL ||
cur->prev == NULL ||
cur->prev->next != cur ||
cur->next->prev != cur)
elog(ERROR, "doubly linked list is corrupted");
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.