diff options
| author | Laurent Bercot <ska-skaware@skarnet.org> | 2015-06-04 20:48:10 +0000 |
|---|---|---|
| committer | Laurent Bercot <ska-skaware@skarnet.org> | 2015-06-04 20:48:10 +0000 |
| commit | 4b31caa9cdaef67c70bc7fb43963ba68b7bf5bb1 (patch) | |
| tree | b9d634a9199d7f69ae4e1f35d88edac63d04abcf /src/libs6rc/s6rc_db_read_uint32.c | |
| download | s6-rc-4b31caa9cdaef67c70bc7fb43963ba68b7bf5bb1.tar.gz | |
Initial commit
Diffstat (limited to 'src/libs6rc/s6rc_db_read_uint32.c')
| -rw-r--r-- | src/libs6rc/s6rc_db_read_uint32.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libs6rc/s6rc_db_read_uint32.c b/src/libs6rc/s6rc_db_read_uint32.c new file mode 100644 index 0000000..05d1f9e --- /dev/null +++ b/src/libs6rc/s6rc_db_read_uint32.c @@ -0,0 +1,14 @@ +/* ISC license. */ + +#include <skalibs/uint32.h> +#include <skalibs/buffer.h> +#include <s6-rc/s6rc-db.h> + +int s6rc_db_read_uint32 (buffer *b, uint32 *x) +{ + unsigned int w = 0 ; + char pack[4] ; + if (buffer_getall(b, pack, 4, &w) <= 0) return 0 ; + uint32_unpack_big(pack, x) ; + return 1 ; +} |
