From 20961b9871f12814790ebed80d88692fbb962d4f Mon Sep 17 00:00:00 2001 From: Edward Thomson Date: Wed, 26 Dec 2018 14:06:21 -0600 Subject: git_error: use full class name in public error API Move to the `git_error` name in error-related functions, deprecating the `giterr` functions. This means, for example, that `giterr_last` is now `git_error_last`. The old names are retained for compatibility. This only updates the public API; internal API and function usage remains unchanged. --- src/errors.c | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) (limited to 'src/errors.c') diff --git a/src/errors.c b/src/errors.c index a874163b0..aa9325579 100644 --- a/src/errors.c +++ b/src/errors.c @@ -44,7 +44,7 @@ static void set_error(int error_class, char *string) set_error_from_buffer(error_class); } -void giterr_set_oom(void) +void git_error_set_oom(void) { GIT_GLOBAL->last_error = &g_git_oom_error; } @@ -90,7 +90,7 @@ void giterr_set(int error_class, const char *string, ...) set_error_from_buffer(error_class); } -void giterr_set_str(int error_class, const char *string) +void git_error_set_str(int error_class, const char *string) { git_buf *buf = &GIT_GLOBAL->error_buf; @@ -120,7 +120,7 @@ int giterr_set_regex(const regex_t *regex, int error_code) return GIT_EINVALIDSPEC; } -void giterr_clear(void) +void git_error_clear(void) { if (GIT_GLOBAL->last_error != NULL) { set_error(0, NULL); @@ -133,7 +133,7 @@ void giterr_clear(void) #endif } -const git_error *giterr_last(void) +const git_error *git_error_last(void) { return GIT_GLOBAL->last_error; } @@ -211,3 +211,25 @@ void giterr_system_set(int code) errno = code; #endif } + +/* Deprecated functions */ + +const git_error *giterr_last(void) +{ + return git_error_last(); +} + +void giterr_clear(void) +{ + git_error_clear(); +} + +void giterr_set_str(int error_class, const char *string) +{ + return git_error_set_str(error_class, string); +} + +void giterr_set_oom(void) +{ + git_error_set_oom(); +} -- cgit v1.2.1