return insertCell(l, GLIST_TAIL(l), makeCell(ptr));
}
+GList*
+GListPushCell(GList *l, GListCell* c) {
+ return insertCell(l, GLIST_TAIL(l), c);
+}
+
GList*
GListUnshift(GList *l, void *ptr) {
return insertCell(l, NULL, makeCell(ptr));
}
+GList*
+GListUnshiftCell(GList *l, GListCell* c) {
+ return insertCell(l, NULL, c);
+}
+
GList*
GListDelete(GList *l, GListCell *c) {
if (GLIST_LENGTH(l) <= 0)
l->head = c->next;
if ( l->head )
l->head->prev = NULL;
+ else
+ l->tail = NULL;
} else if ( l->tail == c ) {
tassert( c->next == NULL );
l->tail = c->prev;
if ( l->tail )
l->tail->next = NULL;
+ else
+ l->head = NULL;
} else {
c->prev->next = c->next;
c->next->prev = c->prev;