From a2012c43899e6616366b47d7741b3f035e825e84 Mon Sep 17 00:00:00 2001 From: nulltoken Date: Tue, 10 Feb 2015 09:38:57 +0100 Subject: buffer: Expose git_buf_put() to bindings --- include/git2/buffer.h | 10 ++++++++++ src/buffer.h | 1 - 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/git2/buffer.h b/include/git2/buffer.h index 9fc6a5805..5f96af6bf 100644 --- a/include/git2/buffer.h +++ b/include/git2/buffer.h @@ -121,6 +121,16 @@ GIT_EXTERN(int) git_buf_is_binary(const git_buf *buf); */ GIT_EXTERN(int) git_buf_contains_nul(const git_buf *buf); +/** +* Append to an existing buffer a copy of some raw data. +* +* @param buffer The buffer to append to +* @param data The data to copy into the buffer +* @param len The length of the data to copy into the buffer +* @return 0 on success, -1 on allocation failure +*/ +GIT_EXTERN(int) git_buf_put(git_buf *buf, const char *data, size_t len); + GIT_END_DECL /** @} */ diff --git a/src/buffer.h b/src/buffer.h index 8ee4b532c..ac74c95a4 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -89,7 +89,6 @@ GIT_INLINE(bool) git_buf_oom(const git_buf *buf) int git_buf_sets(git_buf *buf, const char *string); int git_buf_putc(git_buf *buf, char c); int git_buf_putcn(git_buf *buf, char c, size_t len); -int git_buf_put(git_buf *buf, const char *data, size_t len); int git_buf_puts(git_buf *buf, const char *string); int git_buf_printf(git_buf *buf, const char *format, ...) GIT_FORMAT_PRINTF(2, 3); int git_buf_vprintf(git_buf *buf, const char *format, va_list ap); -- cgit v1.2.1