summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorniallo <niallo@openbsd.org>2006-01-10 14:57:53 +0000
committerniallo <niallo@openbsd.org>2006-01-10 14:57:53 +0000
commitbd274dd128bf56b0eb5b0a1fee2ced33889dd5fc (patch)
tree8ac2be6b55f80a3e656fab47816420d12d7de5f5
parentPowerBook3,5 has snapper too; (diff)
downloadwireguard-openbsd-bd274dd128bf56b0eb5b0a1fee2ced33889dd5fc.tar.xz
wireguard-openbsd-bd274dd128bf56b0eb5b0a1fee2ced33889dd5fc.zip
- add cvs_buf_getc() function; returns byte at specified buffer position.
needed for the next commit. ok xsa@ joris@
-rw-r--r--usr.bin/cvs/buf.c14
-rw-r--r--usr.bin/cvs/buf.h3
2 files changed, 15 insertions, 2 deletions
diff --git a/usr.bin/cvs/buf.c b/usr.bin/cvs/buf.c
index be37ce36b69..8eeb11a4848 100644
--- a/usr.bin/cvs/buf.c
+++ b/usr.bin/cvs/buf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: buf.c,v 1.28 2006/01/02 08:11:56 xsa Exp $ */
+/* $OpenBSD: buf.c,v 1.29 2006/01/10 14:57:53 niallo Exp $ */
/*
* Copyright (c) 2003 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -236,6 +236,18 @@ cvs_buf_putc(BUF *b, int c)
}
/*
+ * cvs_buf_getc()
+ *
+ * Return u_char at buffer position <pos>.
+ *
+ */
+u_char
+cvs_buf_getc(BUF *b, u_int pos)
+{
+ return (b->cb_cur[pos]);
+}
+
+/*
* cvs_buf_append()
*
* Append <len> bytes of data pointed to by <data> to the buffer <b>. If the
diff --git a/usr.bin/cvs/buf.h b/usr.bin/cvs/buf.h
index b721890696a..f336ccea9c4 100644
--- a/usr.bin/cvs/buf.h
+++ b/usr.bin/cvs/buf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: buf.h,v 1.7 2006/01/02 08:11:56 xsa Exp $ */
+/* $OpenBSD: buf.h,v 1.8 2006/01/10 14:57:53 niallo Exp $ */
/*
* Copyright (c) 2003 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -49,6 +49,7 @@ BUF *cvs_buf_alloc(size_t, u_int);
BUF *cvs_buf_load(const char *, u_int);
void cvs_buf_free(BUF *);
void *cvs_buf_release(BUF *);
+u_char cvs_buf_getc(BUF *, u_int);
void cvs_buf_empty(BUF *);
ssize_t cvs_buf_copy(BUF *, size_t, void *, size_t);
ssize_t cvs_buf_set(BUF *, const void *, size_t, size_t);