diff options
| author | Junio C Hamano <gitster@pobox.com> | 2022-01-10 11:52:53 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2022-01-10 11:52:53 -0800 |
| commit | 4b51386bbfc5d26e552c3c4be135e31cd2f64b44 (patch) | |
| tree | 5bff7a8a4dee06d92dca0a89976248dc7e571918 /git-compat-util.h | |
| parent | bc61dbac770923a96e2007c3de4027c5d11c6d41 (diff) | |
| parent | f5c39c3268107e1f3def70709d509fd24282832c (diff) | |
| download | git-4b51386bbfc5d26e552c3c4be135e31cd2f64b44.tar.gz | |
Merge branch 'ab/usage-die-message'
Code clean-up to hide vreportf() from public API.
* ab/usage-die-message:
config API: use get_error_routine(), not vreportf()
usage.c + gc: add and use a die_message_errno()
gc: return from cmd_gc(), don't call exit()
usage.c API users: use die_message() for error() + exit 128
usage.c API users: use die_message() for "fatal :" + exit 128
usage.c: add a die_message() routine
Diffstat (limited to 'git-compat-util.h')
| -rw-r--r-- | git-compat-util.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/git-compat-util.h b/git-compat-util.h index b7caf23666..1229c8296b 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -498,11 +498,12 @@ static inline int git_has_dir_sep(const char *path) struct strbuf; /* General helper functions */ -void vreportf(const char *prefix, const char *err, va_list params); NORETURN void usage(const char *err); NORETURN void usagef(const char *err, ...) __attribute__((format (printf, 1, 2))); NORETURN void die(const char *err, ...) __attribute__((format (printf, 1, 2))); NORETURN void die_errno(const char *err, ...) __attribute__((format (printf, 1, 2))); +int die_message(const char *err, ...) __attribute__((format (printf, 1, 2))); +int die_message_errno(const char *err, ...) __attribute__((format (printf, 1, 2))); int error(const char *err, ...) __attribute__((format (printf, 1, 2))); int error_errno(const char *err, ...) __attribute__((format (printf, 1, 2))); void warning(const char *err, ...) __attribute__((format (printf, 1, 2))); @@ -537,6 +538,7 @@ static inline int const_error(void) typedef void (*report_fn)(const char *, va_list params); void set_die_routine(NORETURN_PTR report_fn routine); +report_fn get_die_message_routine(void); void set_error_routine(report_fn routine); report_fn get_error_routine(void); void set_warn_routine(report_fn routine); |
