Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-08-29 03:44:04 +0400
committerRussell Belfer <rb@github.com>2013-09-17 20:30:06 +0400
commit85d5481206a932d747b2d5587b6d4c7f69993ba6 (patch)
treea66d55c92d70668509efce5b231517467a3f8b7e /src/buffer.h
parent0cf77103b218ad3622aff34f3296db1bdd5f0df9 (diff)
Create public filter object and use it
This creates include/sys/filter.h with a basic definition of a git_filter and then converts the internal code to use it. There are related internal objects (git_filter_list) that we will want to publish at some point, but this is a first step.
Diffstat (limited to 'src/buffer.h')
-rw-r--r--src/buffer.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/buffer.h b/src/buffer.h
index f3e1d506f..b1cb5d06a 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -9,6 +9,7 @@
#include "common.h"
#include "git2/strarray.h"
+#include "git2/buffer.h"
#include <stdarg.h>
typedef struct {
@@ -174,4 +175,25 @@ int git_buf_splice(
const char *data,
size_t nb_to_insert);
+
+#define GIT_BUF_FROM_BUFFER(buffer) \
+ { (buffer)->ptr, (buffer)->available, (buffer)->size }
+
+GIT_INLINE(void) git_buf_from_buffer(git_buf *buf, const git_buffer *buffer)
+{
+ buf->ptr = buffer->ptr;
+ buf->size = buffer->size;
+ buf->asize = buffer->available;
+}
+
+#define GIT_BUFFER_FROM_BUF(buf) \
+ { (buf)->ptr, (buf)->size, (buf)->asize }
+
+GIT_INLINE(void) git_buffer_from_buf(git_buffer *buffer, const git_buf *buf)
+{
+ buffer->ptr = buf->ptr;
+ buffer->size = buf->size;
+ buffer->available = buf->asize;
+}
+
#endif