summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2015-02-10 09:38:57 +0100
committernulltoken <emeric.fermas@gmail.com>2015-02-10 10:57:29 +0100
commita2012c43899e6616366b47d7741b3f035e825e84 (patch)
treeb5cf260f4082292deb9584a3e8761035d38ebcc4
parentb703049c6189fec223896999b9cf5d78efcb08d7 (diff)
downloadlibgit2-ntk/expose_git_buf_put.tar.gz
buffer: Expose git_buf_put() to bindingsntk/expose_git_buf_put
-rw-r--r--include/git2/buffer.h10
-rw-r--r--src/buffer.h1
2 files changed, 10 insertions, 1 deletions
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);