Hide struct io and implementation of struct ioqueue
Move struct io and struct ioqueue from ioqueue.h to ioqueue.c. Declare incomplete struct ioqueue in ioqueue.h.
This commit is contained in:
parent
6f6c90d406
commit
55c53b9add
2 changed files with 15 additions and 14 deletions
|
@ -35,21 +35,8 @@
|
||||||
#define IOQUEUE_H
|
#define IOQUEUE_H
|
||||||
|
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
#include "queue.h"
|
|
||||||
|
|
||||||
struct io {
|
struct ioqueue;
|
||||||
struct emp_qelem queue;
|
|
||||||
int size;
|
|
||||||
int nbytes;
|
|
||||||
int offset;
|
|
||||||
char *data;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct ioqueue {
|
|
||||||
struct io list;
|
|
||||||
int bufsize;
|
|
||||||
int cc;
|
|
||||||
};
|
|
||||||
|
|
||||||
extern struct ioqueue *ioq_create(int size);
|
extern struct ioqueue *ioq_create(int size);
|
||||||
extern void ioq_destroy(struct ioqueue *ioq);
|
extern void ioq_destroy(struct ioqueue *ioq);
|
||||||
|
|
|
@ -46,6 +46,20 @@
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "queue.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 ioqtocbuf(struct ioqueue *ioq, char *buf, int cc, int stopc);
|
||||||
static int ioqtoiov(struct ioqueue *ioq, struct iovec *iov, int max);
|
static int ioqtoiov(struct ioqueue *ioq, struct iovec *iov, int max);
|
||||||
static int ioqtobuf(struct ioqueue *ioq, char *buf, int cc);
|
static int ioqtobuf(struct ioqueue *ioq, char *buf, int cc);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue