summaryrefslogtreecommitdiff
path: root/src/libostree/ostree-varint.c
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2013-08-15 09:17:37 -0400
committerColin Walters <walters@verbum.org>2014-02-04 10:31:44 -0500
commit2d6374822b481e885aa5f74ef9e6f993d5c792c5 (patch)
treea2e5aba12eed68eba0d22f3543e6f4ca1773886c /src/libostree/ostree-varint.c
parent844c5ea652251d57f8afbd3ca133d7fc3ce8fc50 (diff)
downloadostree-2d6374822b481e885aa5f74ef9e6f993d5c792c5.tar.gz
Initial basic static delta code drop
This has a very basic level of functionality (deltas can be generated, and applied offline). There is only some stubbed out pull code to fetch them via HTTP. But, better to commit this now and improve it from a known starting point, rather than have it languish in a branch.
Diffstat (limited to 'src/libostree/ostree-varint.c')
-rw-r--r--src/libostree/ostree-varint.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/libostree/ostree-varint.c b/src/libostree/ostree-varint.c
index 04ef6b84..800aaa6d 100644
--- a/src/libostree/ostree-varint.c
+++ b/src/libostree/ostree-varint.c
@@ -62,13 +62,15 @@ static const int max_varint_bytes = 10;
* _ostree_read_varuint64:
* @buf: (array length=buflen): Byte buffer
* @buflen: Length of bytes in @buf
+ * @out_value: (out): Value
* @bytes_read: (out): Number of bytes read
*
- * Returns: An unsigned 64 bit integer value
+ * Returns: %TRUE on success, %FALSE on end of stream
*/
-guint64
+gboolean
_ostree_read_varuint64 (const guint8 *buf,
gsize buflen,
+ guint64 *out_value,
gsize *bytes_read)
{
guint64 result = 0;
@@ -92,8 +94,9 @@ _ostree_read_varuint64 (const guint8 *buf,
} while (b & 0x80);
*bytes_read = count;
+ *out_value = result;
- return result;
+ return TRUE;
}
/**