X-Git-Url: https://git.tokkee.org/?p=sysdb.git;a=blobdiff_plain;f=src%2Finclude%2Futils%2Fproto.h;h=a872dd51b309c6a05a659d9ea4e70a70933fdf35;hp=fd842c1b0caf8c6f48b64b03a7c7d1c2db9f5488;hb=d25f3c59b5cf5387acd4e6d1467ce9efffa40f9a;hpb=4b1c3e70c727641934d697339cad02cda0a3c565 diff --git a/src/include/utils/proto.h b/src/include/utils/proto.h index fd842c1..a872dd5 100644 --- a/src/include/utils/proto.h +++ b/src/include/utils/proto.h @@ -133,19 +133,23 @@ sdb_proto_marshal_attribute(char *buf, size_t buf_len, * Read and decode a message header from the specified string. * * Returns: - * - 0 on success + * - the number of bytes read on success * - a negative value else */ -int +ssize_t sdb_proto_unmarshal_header(const char *buf, size_t buf_len, uint32_t *code, uint32_t *msg_len); /* * sdb_proto_unmarshal_int32: * Read and decode a 32-bit integer from the specified string. + * + * Returns: + * - the number of bytes read on success + * - a negative value else */ -uint32_t -sdb_proto_unmarshal_int32(const char *buf, size_t buf_len); +ssize_t +sdb_proto_unmarshal_int32(const char *buf, size_t buf_len, uint32_t *v); #ifdef __cplusplus } /* extern "C" */