diff options
| author | Etienne Samson <samson.etienne@gmail.com> | 2019-06-19 19:46:12 +0200 |
|---|---|---|
| committer | Etienne Samson <samson.etienne@gmail.com> | 2019-06-26 15:49:37 +0200 |
| commit | 33448b4519a83836d876556f46a0b7f9f5c90995 (patch) | |
| tree | d93627e3fc2f236f24776ad86c6accf343e85a2e /include/git2/buffer.h | |
| parent | c544850127abb96b472485768dee3ede68e1622e (diff) | |
| download | libgit2-33448b4519a83836d876556f46a0b7f9f5c90995.tar.gz | |
docs: More of it
Diffstat (limited to 'include/git2/buffer.h')
| -rw-r--r-- | include/git2/buffer.h | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/include/git2/buffer.h b/include/git2/buffer.h index 0027678b8..926f1332d 100644 --- a/include/git2/buffer.h +++ b/include/git2/buffer.h @@ -32,26 +32,32 @@ GIT_BEGIN_DECL * a block of memory they hold. In this case, libgit2 will not resize or * free the memory, but will read from it as needed. * - * A `git_buf` is a public structure with three fields: - * - * - `ptr` points to the start of the allocated memory. If it is NULL, - * then the `git_buf` is considered empty and libgit2 will feel free - * to overwrite it with new data. - * - * - `size` holds the size (in bytes) of the data that is actually used. - * - * - `asize` holds the known total amount of allocated memory if the `ptr` - * was allocated by libgit2. It may be larger than `size`. If `ptr` - * was not allocated by libgit2 and should not be resized and/or freed, - * then `asize` will be set to zero. - * * Some APIs may occasionally do something slightly unusual with a buffer, * such as setting `ptr` to a value that was passed in by the user. In * those cases, the behavior will be clearly documented by the API. */ typedef struct { + /** + * The buffer contents. + * + * `ptr` points to the start of the allocated memory. If it is NULL, + * then the `git_buf` is considered empty and libgit2 will feel free + * to overwrite it with new data. + */ char *ptr; - size_t asize, size; + + /** + * `asize` holds the known total amount of allocated memory if the `ptr` + * was allocated by libgit2. It may be larger than `size`. If `ptr` + * was not allocated by libgit2 and should not be resized and/or freed, + * then `asize` will be set to zero. + */ + size_t asize; + + /** + * `size` holds the size (in bytes) of the data that is actually used. + */ + size_t size; } git_buf; /** |
