Doubly linked list: helper function and macros for searching a list more easily.