LCOV - code coverage report
Current view: top level - netio-next/src - subscription_list.c (source / functions) Hit Total Coverage
Test: coverage.info Lines: 14 14 100.0 %
Date: 2025-08-12 04:15:35 Functions: 2 2 100.0 %

          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             : 

Generated by: LCOV version 1.0