summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/ChangeLog5
-rw-r--r--lib/stream.c4
-rw-r--r--lib/stream.h4
3 files changed, 9 insertions, 4 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog
index d8eb06ec..681bdebc 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,8 @@
+2008-06-07 Paul Jakma <paul@jakma.org>
+
+ * stream.{c,h}: (stream_{put,write}) add const qualifier to source
+ argument. Change u_char to void *.
+
2008-06-02 Denis Ovsienko
* workqueue.[ch]: completely drop WQ_AIM_HEAD flag and
diff --git a/lib/stream.c b/lib/stream.c
index 7034d904..983330ff 100644
--- a/lib/stream.c
+++ b/lib/stream.c
@@ -458,7 +458,7 @@ stream_get_ipv4 (struct stream *s)
* stream_write() is saner
*/
void
-stream_put (struct stream *s, void *src, size_t size)
+stream_put (struct stream *s, const void *src, size_t size)
{
/* XXX: CHECK_SIZE has strange semantics. It should be deprecated */
@@ -833,7 +833,7 @@ stream_recvmsg (struct stream *s, int fd, struct msghdr *msgh, int flags,
/* Write data to buffer. */
size_t
-stream_write (struct stream *s, u_char *ptr, size_t size)
+stream_write (struct stream *s, const void *ptr, size_t size)
{
CHECK_SIZE(s, size);
diff --git a/lib/stream.h b/lib/stream.h
index 715a083d..3e4ba7b4 100644
--- a/lib/stream.h
+++ b/lib/stream.h
@@ -150,7 +150,7 @@ extern void stream_forward_getp (struct stream *, size_t);
extern void stream_forward_endp (struct stream *, size_t);
/* steam_put: NULL source zeroes out size_t bytes of stream */
-extern void stream_put (struct stream *, void *, size_t);
+extern void stream_put (struct stream *, const void *, size_t);
extern int stream_putc (struct stream *, u_char);
extern int stream_putc_at (struct stream *, size_t, u_char);
extern int stream_putw (struct stream *, u_int16_t);
@@ -200,7 +200,7 @@ extern ssize_t stream_recvmsg (struct stream *s, int fd, struct msghdr *,
extern ssize_t stream_recvfrom (struct stream *s, int fd, size_t len,
int flags, struct sockaddr *from,
socklen_t *fromlen);
-extern size_t stream_write (struct stream *, u_char *, size_t);
+extern size_t stream_write (struct stream *, const void *, size_t);
/* reset the stream. See Note above */
extern void stream_reset (struct stream *);