if (head == NULL) { /* if empty list, */
head = item; /* item is head as well */
}
+ num_items++;
}
/*
if (tail == NULL) { /* if empty list, */
tail = item; /* item is tail too */
}
+ num_items++;
}
void dlist::insert_before(void *item, void *where)
if (head == where) {
head = item;
}
+ num_items++;
}
void dlist::insert_after(void *item, void *where)
if (tail == where) {
tail = item;
}
+ num_items++;
}
xitem = ilink->prev;
((dlink *)((char *)xitem+loffset))->next = ilink->next;
}
+ num_items--;
}
void * dlist::next(void *item)
}
-/* Destroy the list and its contents */
+/* Destroy the list contents */
void dlist::destroy()
{
for (void *n=head; n; ) {
free(n);
n = ni;
}
+ num_items = 0;
}