/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2007, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2010, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
* ---
*
* ioqueue.c: Read and write i/o queues
- *
+ *
* Known contributors to this file:
- *
+ *
*/
/*
#include "misc.h"
#include "queue.h"
+struct io {
+ struct emp_qelem queue;
+ int size;
+ int nbytes;
+ int offset;
+ char *data;
+};
+
+struct ioqueue {
+ struct io list;
+ int bufsize;
+ int cc;
+};
+
static int ioqtocbuf(struct ioqueue *ioq, char *buf, int cc, int stopc);
static int ioqtoiov(struct ioqueue *ioq, struct iovec *iov, int max);
static int ioqtobuf(struct ioqueue *ioq, char *buf, int cc);
ioq->list.nbytes = 0;
ioq->list.offset = 0;
ioq->list.size = 0;
- ioq->list.data = 0;
+ ioq->list.data = NULL;
ioq->bufsize = size;
ioq->cc = 0;
return ioq;