Revision 275
implementing transmission with queues
list.c | ||
---|---|---|
52 | 52 |
list_node_t* (list_begin )( list_t *l){ return l->begin_->n; } |
53 | 53 |
list_node_t* (list_end )( list_t *l){ return l->end_; } |
54 | 54 |
size_t (list_size )(const list_t *l){ return l->sz; } |
55 |
int (list_empty )(const list_t *l){ return !(l->sz); } |
|
55 | 56 |
list_node_t* (list_insert)(list_t *l, list_node_t *position, void *val){ |
56 | 57 |
list_node_t *node = list_node_ctor(position->p, position, val); |
57 | 58 |
position->p->n = node; |
... | ... | |
67 | 68 |
--l->sz; |
68 | 69 |
return ret; |
69 | 70 |
} |
71 |
void (list_push_back)(list_t *l, void *val){ |
|
72 |
list_insert(l, list_end(l), val); |
|
73 |
} |
|
74 |
void** (list_front)(list_t *l){ |
|
75 |
return list_node_val(list_begin(l)); |
|
76 |
} |
|
77 |
void (list_pop_front)(list_t *l){ |
|
78 |
list_erase(l, list_begin(l)); |
|
79 |
} |
Also available in: Unified diff