Code

proto: Make sdb_proto_marshal_int32 a public function.
[sysdb.git] / src / include / utils / proto.h
index b626781f9a1f70652bd0de5fa7a51455ff57c346..56715630524594a71e524932def3f1a01a9f7670 100644 (file)
@@ -91,6 +91,20 @@ ssize_t
 sdb_proto_marshal(char *buf, size_t buf_len, uint32_t code,
                uint32_t msg_len, const char *msg);
 
+/*
+ * sdb_proto_marshal_int32:
+ * Encode the 32-bit integer into the wire format and write it to buf.
+ *
+ * Returns:
+ *  - The number of bytes of the encoded value on success. The function does
+ *    not write more than 'buf_len' bytes. If the output was truncated then
+ *    the return value is the number of bytes which would have been written if
+ *    enough space had been available.
+ *  - a negative value else
+ */
+ssize_t
+sdb_proto_marshal_int32(char *buf, size_t buf_len, uint32_t v);
+
 /*
  * sdb_proto_marshal_data:
  * Encode a datum into the wire format and write it to buf.