-/*
- * Copyright (C) 1994-2004, Index Data.
+/* This file is part of the YAZ toolkit.
+ * Copyright (C) 1995-2011 Index Data
* See the file LICENSE for details.
- *
- * $Id: requestq.c,v 1.2 2004-10-15 00:19:00 adam Exp $
*/
/**
* \file requestq.c
* We also use the request-freelist to store encoding buffers, rather than
* freeing and xmalloc'ing them on each cycle.
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <stdlib.h>
void request_enq(request_q *q, request *r)
{
if (q->tail)
- q->tail->next = r;
+ q->tail->next = r;
else
- q->head = r;
+ q->head = r;
q->tail = r;
q->num++;
}
request *r = q->head;
if (!r)
- return 0;
+ return 0;
q->head = q->head->next;
if (!q->head)
- q->tail = 0;
+ q->tail = 0;
q->num--;
return r;
}
request *r1, *r = q->list;
while (r)
{
- xfree (r->response);
+ xfree (r->response);
r1 = r;
r = r->next;
xfree (r1);
request *r = q->list;
if (r)
- q->list = r->next;
+ q->list = r->next;
else
{
- if (!(r = (request *)xmalloc(sizeof(*r))))
- abort();
- r->response = 0;
- r->size_response = 0;
+ if (!(r = (request *)xmalloc(sizeof(*r))))
+ abort();
+ r->response = 0;
+ r->size_response = 0;
}
r->q = q;
- r->len_refid = 0;
- r->refid = 0;
r->gdu_request = 0;
r->apdu_request = 0;
r->request_mem = 0;
q->list = r;
}
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * c-file-style: "Stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
+