Commit 5309b465 by Edward Thomson

filter: introduce git_filter_list_apply_to_buffer

Provide a filter application mechanism that takes a user-provided string
and length, instead of a `git_buf`.
parent 26846f4c
...@@ -125,6 +125,21 @@ GIT_EXTERN(int) git_filter_list_contains( ...@@ -125,6 +125,21 @@ GIT_EXTERN(int) git_filter_list_contains(
* @param out Buffer to store the result of the filtering * @param out Buffer to store the result of the filtering
* @param filters A loaded git_filter_list (or NULL) * @param filters A loaded git_filter_list (or NULL)
* @param in Buffer containing the data to filter * @param in Buffer containing the data to filter
* @param in_len The length of the input buffer
* @return 0 on success, an error code otherwise
*/
GIT_EXTERN(int) git_filter_list_apply_to_buffer(
git_buf *out,
git_filter_list *filters,
const char *in,
size_t in_len);
/**
* Apply filter list to a data buffer.
*
* @param out Buffer to store the result of the filtering
* @param filters A loaded git_filter_list (or NULL)
* @param in Buffer containing the data to filter
* @return 0 on success, an error code otherwise * @return 0 on success, an error code otherwise
*/ */
GIT_EXTERN(int) git_filter_list_apply_to_data( GIT_EXTERN(int) git_filter_list_apply_to_data(
......
...@@ -720,7 +720,7 @@ static void buf_stream_init(struct buf_stream *writer, git_buf *target) ...@@ -720,7 +720,7 @@ static void buf_stream_init(struct buf_stream *writer, git_buf *target)
git_buf_clear(target); git_buf_clear(target);
} }
static int git_filter_list_apply_to_buffer( int git_filter_list_apply_to_buffer(
git_buf *out, git_buf *out,
git_filter_list *filters, git_filter_list *filters,
const char *in, const char *in,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment