diff options
| author | Franklin Wei <git@fwei.tk> | 2016-01-31 19:53:45 -0500 |
|---|---|---|
| committer | Franklin Wei <git@fwei.tk> | 2016-01-31 19:53:45 -0500 |
| commit | 7e223238ec9d6711290b1718c44cfe8158477b71 (patch) | |
| tree | 495d79d0dc26e39c9065c6ceb7d16b9a3e76561d /src/util.c | |
| parent | c87ef9230be5e52c9fa532ee0a3eba63960fc76d (diff) | |
| download | netcosm-7e223238ec9d6711290b1718c44cfe8158477b71.zip netcosm-7e223238ec9d6711290b1718c44cfe8158477b71.tar.gz netcosm-7e223238ec9d6711290b1718c44cfe8158477b71.tar.bz2 netcosm-7e223238ec9d6711290b1718c44cfe8158477b71.tar.xz | |
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
Diffstat (limited to 'src/util.c')
| -rw-r--r-- | src/util.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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"); +} |