summaryrefslogtreecommitdiff
path: root/src/buffer.h
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2012-10-25 10:55:03 -0700
committerRussell Belfer <rb@github.com>2012-10-25 10:55:03 -0700
commit1b9346897b3be1c8f659e12a6ee84c74858fc32e (patch)
tree16b415e58f1343d45111376eae4ecd7ebc77e3d3 /src/buffer.h
parent505f37b41a7d80c539a33d28aec947cd87bb1b6c (diff)
parentfcccf3045f6fbeae5139af7263c2ab986818f154 (diff)
downloadlibgit2-1b9346897b3be1c8f659e12a6ee84c74858fc32e.tar.gz
Merge pull request #925 from nulltoken/topic/moving-branch-updates-config
Updates config upon moving and deletion of branches
Diffstat (limited to 'src/buffer.h')
-rw-r--r--src/buffer.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/buffer.h b/src/buffer.h
index 2aae06c7c..a2896d486 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -158,4 +158,29 @@ void git_buf_unescape(git_buf *buf);
/* Write data as base64 encoded in buffer */
int git_buf_put_base64(git_buf *buf, const char *data, size_t len);
+/*
+ * Insert, remove or replace a portion of the buffer.
+ *
+ * @param buf The buffer to work with
+ *
+ * @param where The location in the buffer where the transformation
+ * should be applied.
+ *
+ * @param nb_to_remove The number of chars to be removed. 0 to not
+ * remove any character in the buffer.
+ *
+ * @param data A pointer to the data which should be inserted.
+ *
+ * @param nb_to_insert The number of chars to be inserted. 0 to not
+ * insert any character from the buffer.
+ *
+ * @return 0 or an error code.
+ */
+int git_buf_splice(
+ git_buf *buf,
+ size_t where,
+ size_t nb_to_remove,
+ const char *data,
+ size_t nb_to_insert);
+
#endif