- if( tpptr->next != NULL ) {
- tpptr->next->prev = tpptr->prev; // point next one back behind this one
+/*
+ It is safe to remove the block from the list; if it was in the list
+ in the first place.
+*/
+extern void SIrm_tpb( struct ginfo_blk *gptr, struct tp_blk *tpptr ) {
+
+ if( tpptr != NULL ) {
+ if( tpptr->prev != NULL || tpptr->next != NULL ) { // in the list
+ if( tpptr->prev != NULL ) { // remove from the list
+ tpptr->prev->next = tpptr->next; // point previous at the next
+ } else {
+ gptr->tplist = tpptr->next; // this was head, make next new head
+ }
+
+ if( tpptr->next != NULL ) {
+ tpptr->next->prev = tpptr->prev; // point next one back behind this one
+ }