aura  0.1
 All Data Structures Functions Variables Modules Pages
queue.c
1 #include <aura/aura.h>
2 
16 void aura_queue_buffer(struct list_head *queue, struct aura_buffer *buf)
17 {
18  list_add_tail(&buf->qentry, queue);
19  aura_buffer_rewind(buf);
20 }
21 
22 
28 struct aura_buffer *aura_peek_buffer(struct list_head *head)
29 {
30  struct aura_buffer *ret;
31 
32  if (list_empty(head))
33  return NULL;
34  ret = list_entry(head->next, struct aura_buffer, qentry);
35  return ret;
36 }
37 
46 {
47  struct aura_buffer *ret;
48  ret = aura_peek_buffer(head);
49  if (ret) {
50  list_del(head->next);
51  aura_buffer_rewind(ret);
52  }
53  return ret;
54 }
55 
62 void aura_requeue_buffer(struct list_head *list, struct aura_buffer *buf)
63 {
64  list_add(&buf->qentry, list);
65 }
66 
void aura_requeue_buffer(struct list_head *list, struct aura_buffer *buf)
Definition: queue.c:62
struct aura_buffer * aura_dequeue_buffer(struct list_head *head)
Definition: queue.c:45
Definition: list.h:61
struct list_head qentry
Definition: aura.h:345
static void aura_buffer_rewind(struct aura_buffer *buf)
Definition: inlines.h:93
void aura_queue_buffer(struct list_head *queue, struct aura_buffer *buf)
Definition: queue.c:16
struct aura_buffer * aura_peek_buffer(struct list_head *head)
Definition: queue.c:28