From b83f108b082dfd5452d5c1ab03596fa13750d23f Mon Sep 17 00:00:00 2001 From: Christian Couder Date: Sun, 4 Sep 2016 22:18:27 +0200 Subject: usage: add set_warn_routine() There are already set_die_routine() and set_error_routine(), so let's add set_warn_routine() as this will be needed in a following commit. Signed-off-by: Christian Couder Signed-off-by: Junio C Hamano --- git-compat-util.h | 1 + 1 file changed, 1 insertion(+) (limited to 'git-compat-util.h') diff --git a/git-compat-util.h b/git-compat-util.h index 590bfddf73..c7a51f8d3f 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -440,6 +440,7 @@ static inline int const_error(void) extern void set_die_routine(NORETURN_PTR void (*routine)(const char *err, va_list params)); extern void set_error_routine(void (*routine)(const char *err, va_list params)); +extern void set_warn_routine(void (*routine)(const char *warn, va_list params)); extern void set_die_is_recursing_routine(int (*routine)(void)); extern void set_error_handle(FILE *); -- cgit v1.2.1 From 725149beab088b1368cc01aa3f1a7845db14132d Mon Sep 17 00:00:00 2001 From: Christian Couder Date: Sun, 4 Sep 2016 22:18:28 +0200 Subject: usage: add get_error_routine() and get_warn_routine() Let's make it possible to get the current error_routine and warn_routine, so that we can store them before using set_error_routine() or set_warn_routine() to use new ones. This way we will be able put back the original routines, when we are done with using new ones. Signed-off-by: Christian Couder Signed-off-by: Junio C Hamano --- git-compat-util.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'git-compat-util.h') diff --git a/git-compat-util.h b/git-compat-util.h index c7a51f8d3f..de04df19a8 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -440,7 +440,9 @@ static inline int const_error(void) extern void set_die_routine(NORETURN_PTR void (*routine)(const char *err, va_list params)); extern void set_error_routine(void (*routine)(const char *err, va_list params)); +extern void (*get_error_routine(void))(const char *err, va_list params); extern void set_warn_routine(void (*routine)(const char *warn, va_list params)); +extern void (*get_warn_routine(void))(const char *warn, va_list params); extern void set_die_is_recursing_routine(int (*routine)(void)); extern void set_error_handle(FILE *); -- cgit v1.2.1