path: root/usage.c
diff options
authorChristian Couder <>2016-09-04 20:18:28 (GMT)
committerJunio C Hamano <>2016-09-07 19:29:53 (GMT)
commit725149beab088b1368cc01aa3f1a7845db14132d (patch)
tree51acd0365798a5e8393ddb1960cfef37ace9a2bc /usage.c
parentb83f108b082dfd5452d5c1ab03596fa13750d23f (diff)
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 <>
Diffstat (limited to 'usage.c')
1 files changed, 10 insertions, 0 deletions
diff --git a/usage.c b/usage.c
index 67e5526..2fd3045 100644
--- a/usage.c
+++ b/usage.c
@@ -70,11 +70,21 @@ void set_error_routine(void (*routine)(const char *err, va_list params))
error_routine = routine;
+void (*get_error_routine(void))(const char *err, va_list params)
+ return error_routine;
void set_warn_routine(void (*routine)(const char *warn, va_list params))
warn_routine = routine;
+void (*get_warn_routine(void))(const char *warn, va_list params)
+ return warn_routine;
void set_die_is_recursing_routine(int (*routine)(void))
die_is_recursing = routine;