diff options
author | David Turner <dturner@twopensource.com> | 2016-05-17 15:40:46 -0400 |
---|---|---|
committer | David Turner <dturner@twosigma.com> | 2016-08-10 14:19:06 -0400 |
commit | aeb5ee5ab50a062aac02ca084b02582430669808 (patch) | |
tree | 55b875ce84341eceb06724f070eacf47dfafc447 /src/varint.h | |
parent | 26a8617d96ba96875304d56a7ce698a85e559c43 (diff) | |
download | libgit2-aeb5ee5ab50a062aac02ca084b02582430669808.tar.gz |
varint: Add varint encoding/decoding
This code is ported from git.git
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: David Turner <dturner@twopensource.com>
Diffstat (limited to 'src/varint.h')
-rw-r--r-- | src/varint.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/varint.h b/src/varint.h new file mode 100644 index 000000000..650ec7d2a --- /dev/null +++ b/src/varint.h @@ -0,0 +1,15 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ +#ifndef INCLUDE_varint_h__ +#define INCLUDE_varint_h__ + +#include <stdint.h> + +extern int git_encode_varint(unsigned char *, size_t, uintmax_t); +extern uintmax_t git_decode_varint(const unsigned char *, size_t *); + +#endif |