remove the object from the built-in doubly linked list * * @param head * @param tail * @param cache_obj */
| 55 | * @param cache_obj |
| 56 | */ |
| 57 | void remove_obj_from_list(cache_obj_t **head, cache_obj_t **tail, |
| 58 | cache_obj_t *cache_obj) { |
| 59 | if (head != NULL && cache_obj == *head) { |
| 60 | *head = cache_obj->queue.next; |
| 61 | if (cache_obj->queue.next != NULL) cache_obj->queue.next->queue.prev = NULL; |
| 62 | } |
| 63 | if (tail != NULL && cache_obj == *tail) { |
| 64 | *tail = cache_obj->queue.prev; |
| 65 | if (cache_obj->queue.prev != NULL) cache_obj->queue.prev->queue.next = NULL; |
| 66 | } |
| 67 | |
| 68 | if (cache_obj->queue.prev != NULL) |
| 69 | cache_obj->queue.prev->queue.next = cache_obj->queue.next; |
| 70 | |
| 71 | if (cache_obj->queue.next != NULL) |
| 72 | cache_obj->queue.next->queue.prev = cache_obj->queue.prev; |
| 73 | |
| 74 | cache_obj->queue.prev = NULL; |
| 75 | cache_obj->queue.next = NULL; |
| 76 | } |
| 77 | |
| 78 | /** |
| 79 | * move an object to the tail of the doubly linked list |
no outgoing calls
no test coverage detected