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