From df7428eca46ec25df5ef14bc7e90120bdc267328 Mon Sep 17 00:00:00 2001 From: Florian Achleitner Date: Wed, 19 Sep 2012 17:21:18 +0200 Subject: Add argv_array_detach and argv_array_free_detached Allow detaching of ownership of the argv_array's contents and add a function to free those detached argv_arrays later. This makes it possible to use argv_array efficiently with the exiting struct child_process which only contains a member char **argv. Add to documentation. Signed-off-by: Florian Achleitner Acked-by: David Michael Barr Signed-off-by: Junio C Hamano --- argv-array.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'argv-array.h') diff --git a/argv-array.h b/argv-array.h index b93a69c36c..b3ef351b44 100644 --- a/argv-array.h +++ b/argv-array.h @@ -17,5 +17,7 @@ __attribute__((format (printf,2,3))) void argv_array_pushf(struct argv_array *, const char *fmt, ...); void argv_array_pushl(struct argv_array *, ...); void argv_array_clear(struct argv_array *); +const char **argv_array_detach(struct argv_array *array, int *argc); +void argv_array_free_detached(const char **argv); #endif /* ARGV_ARRAY_H */ -- cgit v1.2.3