diff options
| author | schu <schu-github@schulog.org> | 2011-08-03 15:57:33 +0200 |
|---|---|---|
| committer | schu <schu-github@schulog.org> | 2011-08-03 16:05:32 +0200 |
| commit | 63396a3998610ea1e3555b15a26051525e00e58e (patch) | |
| tree | 718bf96b9d66d3bfd42fbfd749c85ae72dc9234b /include/git2/signature.h | |
| parent | 5274c31a89ec9075cc74ff189f6264a976c04571 (diff) | |
| download | libgit2-63396a3998610ea1e3555b15a26051525e00e58e.tar.gz | |
signature: adjust API to return error codes
git_signature_new() and git_signature_now() currently don't return error
codes. Change the API to return error codes and not pointers to let the
user handle errors properly.
Signed-off-by: schu <schu-github@schulog.org>
Diffstat (limited to 'include/git2/signature.h')
| -rw-r--r-- | include/git2/signature.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/include/git2/signature.h b/include/git2/signature.h index 4b5601783..f5d03ac77 100644 --- a/include/git2/signature.h +++ b/include/git2/signature.h @@ -41,23 +41,25 @@ GIT_BEGIN_DECL * Create a new action signature. The signature must be freed * manually or using git_signature_free * + * @param sig_out new signature, in case of error NULL * @param name name of the person * @param email email of the person * @param time time when the action happened * @param offset timezone offset in minutes for the time - * @return the new sig, NULL on out of memory + * @return 0 on success; error code otherwise */ -GIT_EXTERN(git_signature *) git_signature_new(const char *name, const char *email, git_time_t time, int offset); +GIT_EXTERN(int) git_signature_new(git_signature **sig_out, const char *name, const char *email, git_time_t time, int offset); /** * Create a new action signature with a timestamp of 'now'. The * signature must be freed manually or using git_signature_free * + * @param sig_out new signature, in case of error NULL * @param name name of the person * @param email email of the person - * @return the new sig, NULL on out of memory + * @return 0 on success; error code otherwise */ -GIT_EXTERN(git_signature *) git_signature_now(const char *name, const char *email); +GIT_EXTERN(int) git_signature_now(git_signature **sig_out, const char *name, const char *email); /** |
