diff options
-rw-r--r-- | lf_fifo.c | 4 | ||||
-rw-r--r-- | lf_fifo.h | 4 | ||||
-rw-r--r-- | lf_fifo_test.c | 6 |
3 files changed, 7 insertions, 7 deletions
@@ -36,7 +36,7 @@ void lf_fifo_init( lf_fifo_t *q ) { } /* push a node at the tail of q */ -void lf_fifo_push_tail( lf_fifo_t *q, pointer_t *node ) { +void lf_fifo_push( lf_fifo_t *q, pointer_t *node ) { pointer_t tail; pointer_t last; pointer_t tmp; @@ -80,7 +80,7 @@ void lf_fifo_push_tail( lf_fifo_t *q, pointer_t *node ) { } /* pop a node from the head of q */ -pointer_t* pop_head( lf_fifo_t *q ) { +pointer_t* pop( lf_fifo_t *q ) { pointer_t head; pointer_t tail; pointer_t tmp; @@ -50,10 +50,10 @@ typedef struct queue { void lf_fifo_init( lf_fifo_t *q ); /* push a node at the tail of q */ -void lf_fifo_push_tail( lf_fifo_t *q, pointer_t *node ); +void lf_fifo_push( lf_fifo_t *q, pointer_t *node ); /* pop a node from the head of q */ -pointer_t* pop_head( lf_fifo_t *q ); +pointer_t* pop( lf_fifo_t *q ); # ifdef __cplusplus } diff --git a/lf_fifo_test.c b/lf_fifo_test.c index e212197..9d5a6bc 100644 --- a/lf_fifo_test.c +++ b/lf_fifo_test.c @@ -72,8 +72,8 @@ int main(int argc, char *argv[]) { /* check lf_fifo */ lf_fifo_init( &q); - printf("pop %X\n",(unsigned int)pop_head( &q )); - for(i=0; i<10; i++) lf_fifo_push_tail( &q, &data[i].link ); + printf("pop %X\n",(unsigned int)pop( &q )); + for(i=0; i<10; i++) lf_fifo_push( &q, &data[i].link ); it = (pointer_t*)q.head.split.next; while(it!=NULL) { @@ -82,7 +82,7 @@ int main(int argc, char *argv[]) { } for(i=0; i<5; i++) { - it = pop_head( &q ); + it = pop( &q ); printf("pop %X %d\n",(unsigned int)it,container_of(it,struct node,link)->data); } it = (pointer_t*)q.head.split.next; |