2 * Copyright (C) 1994, Index Data.
3 * See the file LICENSE for details.
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.1 1995-05-15 12:12:22 quinn
14 * Simple queue management.
16 * We also use the request-freelist to store encoding buffers, rather than
17 * freeing and malloc'ing them on each cycle.
25 static request *request_list = 0; /* global freelist for requests */
27 void request_enq(request_q *q, request *r)
37 request *request_head(request_q *q)
42 request *request_deq(request_q *q)
48 q->head = q->head->next;
55 void request_initq(request_q *q)
57 q->head = q->tail = 0;
61 request *request_get(void)
63 request *r = request_list;
66 request_list = r->next;
69 if (!(r = malloc(sizeof(*r))))
78 r->state = REQUEST_IDLE;
83 void request_release(request *r)
85 r->next = request_list;