* i n s e r t * * Create a list element and rearange the pointers so that the first * element in the list is the second aurgment. **********************************************************************/
| 213 | * element in the list is the second aurgment. |
| 214 | **********************************************************************/ |
| 215 | void insert(LIST list, void *node) { |
| 216 | LIST element; |
| 217 | |
| 218 | if (list != NIL_LIST) { |
| 219 | element = push (NIL_LIST, node); |
| 220 | set_rest (element, list_rest (list)); |
| 221 | set_rest(list, element); |
| 222 | node = first_node (list); |
| 223 | list->node = first_node (list_rest (list)); |
| 224 | list->next->node = (LIST) node; |
| 225 | } |
| 226 | } |
| 227 | |
| 228 | |
| 229 | /********************************************************************** |