summaryrefslogtreecommitdiff
path: root/usr.sbin/dvmrpd/imsg.h
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2010-05-26 13:56:09 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2010-05-26 13:56:09 +0000
commit4b9cf3ab192c7e5b1ee8b915d25de6b18cbd1f7e (patch)
treec8f546660680faabd30571e97e67f49483698059 /usr.sbin/dvmrpd/imsg.h
parentf11125202098e763efa8b52b0e92bfac7a124175 (diff)
Rename some imsg bits to make namespace collisions less likely buf to
ibuf, buf_read to ibuf_read, READ_BUF_SIZE to IBUF_READ_SIZE. ok henning gilles claudio jacekm deraadt
Diffstat (limited to 'usr.sbin/dvmrpd/imsg.h')
-rw-r--r--usr.sbin/dvmrpd/imsg.h42
1 files changed, 21 insertions, 21 deletions
diff --git a/usr.sbin/dvmrpd/imsg.h b/usr.sbin/dvmrpd/imsg.h
index 9fd3f2f4964..43564710bb2 100644
--- a/usr.sbin/dvmrpd/imsg.h
+++ b/usr.sbin/dvmrpd/imsg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: imsg.h,v 1.5 2010/04/27 21:04:04 nicm Exp $ */
+/* $OpenBSD: imsg.h,v 1.6 2010/05/26 13:56:07 nicm Exp $ */
/*
* Copyright (c) 2006, 2007 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -18,12 +18,12 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define READ_BUF_SIZE 65535
+#define IBUF_READ_SIZE 65535
#define IMSG_HEADER_SIZE sizeof(struct imsg_hdr)
#define MAX_IMSGSIZE 16384
-struct buf {
- TAILQ_ENTRY(buf) entry;
+struct ibuf {
+ TAILQ_ENTRY(ibuf) entry;
u_char *buf;
size_t size;
size_t max;
@@ -33,13 +33,13 @@ struct buf {
};
struct msgbuf {
- TAILQ_HEAD(, buf) bufs;
+ TAILQ_HEAD(, ibuf) bufs;
u_int32_t queued;
int fd;
};
-struct buf_read {
- u_char buf[READ_BUF_SIZE];
+struct ibuf_read {
+ u_char buf[IBUF_READ_SIZE];
u_char *rptr;
size_t wpos;
};
@@ -51,7 +51,7 @@ struct imsg_fd {
struct imsgbuf {
TAILQ_HEAD(, imsg_fd) fds;
- struct buf_read r;
+ struct ibuf_read r;
struct msgbuf w;
int fd;
pid_t pid;
@@ -75,16 +75,16 @@ struct imsg {
/* buffer.c */
-struct buf *buf_open(size_t);
-struct buf *buf_dynamic(size_t, size_t);
-int buf_add(struct buf *, const void *, size_t);
-void *buf_reserve(struct buf *, size_t);
-void *buf_seek(struct buf *, size_t, size_t);
-size_t buf_size(struct buf *);
-size_t buf_left(struct buf *);
-void buf_close(struct msgbuf *, struct buf *);
-int buf_write(struct msgbuf *);
-void buf_free(struct buf *);
+struct ibuf *ibuf_open(size_t);
+struct ibuf *ibuf_dynamic(size_t, size_t);
+int ibuf_add(struct ibuf *, const void *, size_t);
+void *ibuf_reserve(struct ibuf *, size_t);
+void *ibuf_seek(struct ibuf *, size_t, size_t);
+size_t ibuf_size(struct ibuf *);
+size_t ibuf_left(struct ibuf *);
+void ibuf_close(struct msgbuf *, struct ibuf *);
+int ibuf_write(struct msgbuf *);
+void ibuf_free(struct ibuf *);
void msgbuf_init(struct msgbuf *);
void msgbuf_clear(struct msgbuf *);
int msgbuf_write(struct msgbuf *);
@@ -98,10 +98,10 @@ int imsg_compose(struct imsgbuf *, u_int32_t, u_int32_t, pid_t,
int, void *, u_int16_t);
int imsg_composev(struct imsgbuf *, u_int32_t, u_int32_t, pid_t,
int, const struct iovec *, int);
-struct buf *imsg_create(struct imsgbuf *, u_int32_t, u_int32_t, pid_t,
+struct ibuf *imsg_create(struct imsgbuf *, u_int32_t, u_int32_t, pid_t,
u_int16_t);
-int imsg_add(struct buf *, void *, u_int16_t);
-void imsg_close(struct imsgbuf *, struct buf *);
+int imsg_add(struct ibuf *, void *, u_int16_t);
+void imsg_close(struct imsgbuf *, struct ibuf *);
void imsg_free(struct imsg *);
int imsg_flush(struct imsgbuf *);
void imsg_clear(struct imsgbuf *);