diff options
| author | Edward Thomson <ethomson@edwardthomson.com> | 2018-12-26 14:06:21 -0600 |
|---|---|---|
| committer | Edward Thomson <ethomson@edwardthomson.com> | 2019-01-22 22:26:51 +0000 |
| commit | 20961b9871f12814790ebed80d88692fbb962d4f (patch) | |
| tree | 9e8ba388e7747fca8c2e25d73a0ceb3f1ae3383b /src/errors.c | |
| parent | 6b2cd0ed599aec32444166b7ad5b0c9fdd88b498 (diff) | |
| download | libgit2-20961b9871f12814790ebed80d88692fbb962d4f.tar.gz | |
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.
Diffstat (limited to 'src/errors.c')
| -rw-r--r-- | src/errors.c | 30 |
1 files changed, 26 insertions, 4 deletions
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(); +} |
