Skip to content

buffer: Expose git_buf_put() to bindings #2892

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions include/git2/buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

/** @} */
Expand Down
1 change: 0 additions & 1 deletion src/buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down