diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2020-05-28 10:07:36 +0100 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2020-05-29 11:33:59 +0100 |
commit | bab51e2de6879767bea2fe2a5d1f5f44a1568f51 (patch) | |
tree | bcb609d80e51ff6e29724c909ad8b1cc117844b1 /src/buffer.c | |
parent | 05c77961a0fc43ed552e10a166864086c9f04a0a (diff) | |
download | libgit2-ethomson/userbuf.tar.gz |
buf: deprecate git_buf as a public typeethomson/userbuf
The `git_buf` type is now no longer a publicly available structure, and
the `git_buf` family of functions are no longer exported.
The deprecation layer adds a typedef for `git_buf` (as `git_userbuf`)
and macros that define `git_buf` functions as `git_userbuf` functions.
This provides API (but not ABI) compatibility with libgit2 1.0's buffer
functionality.
Within libgit2 itself, we take care to avoid including those deprecated
typedefs and macros, since we want to continue using the `git_buf` type
and functions unmodified. Therefore, a `GIT_DEPRECATE_BUF` guard now
wraps the buffer deprecation layer. libgit2 will define that.
Diffstat (limited to 'src/buffer.c')
-rw-r--r-- | src/buffer.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/buffer.c b/src/buffer.c index f81f19999..ce97ccffa 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -6,7 +6,7 @@ */ #include "buffer.h" #include "posix.h" -#include "git2/buffer.h" +#include "git2/userbuf.h" #include "buf_text.h" #include <ctype.h> @@ -181,16 +181,6 @@ int git_buf_set(git_buf *buf, const void *data, size_t len) return 0; } -int git_buf_is_binary(const git_buf *buf) -{ - return git_buf_text_is_binary(buf); -} - -int git_buf_contains_nul(const git_buf *buf) -{ - return git_buf_text_contains_nul(buf); -} - int git_buf_sets(git_buf *buf, const char *string) { return git_buf_set(buf, string, string ? strlen(string) : 0); |