Line data Source code
1 : #include "netio.h" 2 : 3 46 : void push_back_subscription(struct deferred_subscription** list, netio_tag_t tag) 4 : { 5 46 : struct deferred_subscription* new_item = malloc(sizeof(struct deferred_subscription)); 6 46 : new_item->tag = tag; 7 46 : new_item->next = NULL; 8 : 9 46 : if(*list == NULL){ 10 45 : *list = new_item; 11 : } else { 12 : struct deferred_subscription* iterator = *list; 13 1 : while(iterator->next){ 14 : iterator = iterator->next; 15 : } 16 1 : iterator->next = new_item; 17 : } 18 46 : } 19 : 20 46 : void pop_subscription(struct deferred_subscription** list) 21 : { 22 46 : if(*list == NULL) return; 23 46 : struct deferred_subscription* current_head = *list; 24 46 : *list = (*list)->next; 25 46 : free(current_head); 26 : } 27 :