mirror of
https://git.proxmox.com/git/libgit2
synced 2025-12-26 05:00:22 +00:00
buf: add git_buf_len() accessor to expose the current length of the buffer content
This commit is contained in:
parent
8b9ec201ed
commit
da3c187d5e
@ -93,11 +93,16 @@ GIT_INLINE(int) git_buf_joinpath(git_buf *buf, const char *a, const char *b)
|
||||
return git_buf_join(buf, '/', a, b);
|
||||
}
|
||||
|
||||
GIT_INLINE(const char *) git_buf_cstr(git_buf *buf)
|
||||
GIT_INLINE(const char *) git_buf_cstr(const git_buf *buf)
|
||||
{
|
||||
return buf->ptr;
|
||||
}
|
||||
|
||||
GIT_INLINE(size_t) git_buf_len(const git_buf *buf)
|
||||
{
|
||||
return buf->size;
|
||||
}
|
||||
|
||||
void git_buf_copy_cstr(char *data, size_t datasize, const git_buf *buf);
|
||||
|
||||
#define git_buf_PUTS(buf, str) git_buf_put(buf, str, sizeof(str) - 1)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user