From 0730fc3924dd4e04efbe51287d1d69850404d05f Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Sun, 31 Jan 2016 19:53:45 -0500 Subject: bump version to 0.5.0-rc1 * implements objects using reference counts rather than copying * implements both room-local and global verbs * refactors the world_* functions into a separate module * numerous other changes --- src/util.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/util.c') diff --git a/src/util.c b/src/util.c index 85914ca..ffeae79 100644 --- a/src/util.c +++ b/src/util.c @@ -132,3 +132,17 @@ void write_uint32(int fd, uint32_t b) if(write(fd, &b, sizeof(b)) != sizeof(b)) error("write failed"); } + +size_t read_size(int fd) +{ + size_t ret; + if(read(fd, &ret, sizeof(ret)) != sizeof(ret)) + error("unexpected EOF"); + return ret; +} + +void write_size(int fd, size_t b) +{ + if(write(fd, &b, sizeof(b)) != sizeof(b)) + error("write failed"); +} -- cgit v1.1