Merge git_buf and git_buffer

This makes the git_buf struct that was used internally into an
externally available structure and eliminates the git_buffer.

As part of that, some of the special cases that arose with the
externally used git_buffer were blended into the git_buf, such as
being careful about git_buf objects that may have a NULL ptr and
allowing for bufs with a valid ptr and size but zero asize as a
way of referring to externally owned data.
This commit is contained in:
Russell Belfer
2013-09-17 09:31:45 -07:00
parent 4b11f25a4f
commit a9f51e430f
20 changed files with 204 additions and 296 deletions
+9 -9
View File
@@ -4,8 +4,8 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
#ifndef INCLUDE_sys_git_config_backend_h__
#define INCLUDE_sys_git_config_backend_h__
#ifndef INCLUDE_sys_git_filter_h__
#define INCLUDE_sys_git_filter_h__
#include "git2/filter.h"
@@ -117,19 +117,19 @@ typedef void (*git_filter_shutdown_fn)(git_filter *self);
* Callback to decide if a given source needs this filter
*/
typedef int (*git_filter_check_fn)(
git_filter *self,
void **payload, /* points to NULL ptr on entry, may be set */
git_filter *self,
void **payload, /* points to NULL ptr on entry, may be set */
const git_filter_source *src,
const char **attr_values);
const char **attr_values);
/**
* Callback to actually perform the data filtering
*/
typedef int (*git_filter_apply_fn)(
git_filter *self,
void **payload, /* may be read and/or set */
git_buffer *to,
const git_buffer *from,
git_filter *self,
void **payload, /* may be read and/or set */
git_buf *to,
const git_buf *from,
const git_filter_source *src);
/**