1 /* This file is part of the YAZ toolkit.
2 * Copyright (C) 1995-2009 Index Data
3 * See the file LICENSE for details.
7 * \brief Implements Simple queue management for GFS.
9 * We also use the request-freelist to store encoding buffers, rather than
10 * freeing and xmalloc'ing them on each cycle.
15 #include <yaz/xmalloc.h>
18 void request_enq(request_q *q, request *r)
28 request *request_head(request_q *q)
33 request *request_deq(request_q *q)
39 q->head = q->head->next;
46 void request_initq(request_q *q)
48 q->head = q->tail = q->list = 0;
52 void request_delq(request_q *q)
54 request *r1, *r = q->list;
64 request *request_get(request_q *q)
72 if (!(r = (request *)xmalloc(sizeof(*r))))
85 r->state = REQUEST_IDLE;
90 void request_release(request *r)
100 * c-file-style: "Stroustrup"
101 * indent-tabs-mode: nil
103 * vim: shiftwidth=4 tabstop=8 expandtab