From 4b31caa9cdaef67c70bc7fb43963ba68b7bf5bb1 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Thu, 4 Jun 2015 20:48:10 +0000 Subject: Initial commit --- src/libs6rc/s6rc_db_read_uint32.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/libs6rc/s6rc_db_read_uint32.c (limited to 'src/libs6rc/s6rc_db_read_uint32.c') 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 +#include +#include + +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 ; +} -- cgit v1.3.1