2 * Copyright (C) 1995-2007, Index Data ApS
3 * See the file LICENSE for details.
5 * $Id: requestq.c,v 1.5 2007-01-03 08:42:15 adam Exp $
9 * \brief Implements Simple queue management for GFS.
11 * We also use the request-freelist to store encoding buffers, rather than
12 * freeing and xmalloc'ing them on each cycle.
17 #include <yaz/xmalloc.h>
20 void request_enq(request_q *q, request *r)
30 request *request_head(request_q *q)
35 request *request_deq(request_q *q)
41 q->head = q->head->next;
48 void request_initq(request_q *q)
50 q->head = q->tail = q->list = 0;
54 void request_delq(request_q *q)
56 request *r1, *r = q->list;
66 request *request_get(request_q *q)
74 if (!(r = (request *)xmalloc(sizeof(*r))))
87 r->state = REQUEST_IDLE;
92 void request_release(request *r)
102 * indent-tabs-mode: nil
104 * vim: shiftwidth=4 tabstop=8 expandtab