1 /* This file is part of the YAZ toolkit.
2 * Copyright (C) 1995-2013 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.
18 #include <yaz/xmalloc.h>
21 void request_enq(request_q *q, request *r)
31 request *request_head(request_q *q)
36 request *request_deq(request_q *q)
42 q->head = q->head->next;
49 void request_initq(request_q *q)
51 q->head = q->tail = q->list = 0;
55 void request_delq(request_q *q)
57 request *r1, *r = q->list;
67 request *request_get(request_q *q)
75 if (!(r = (request *)xmalloc(sizeof(*r))))
86 r->state = REQUEST_IDLE;
91 void request_release(request *r)
95 nmem_destroy(r->request_mem);
103 * c-file-style: "Stroustrup"
104 * indent-tabs-mode: nil
106 * vim: shiftwidth=4 tabstop=8 expandtab