diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/git2/attr.h | 5 | ||||
-rw-r--r-- | include/git2/common.h | 3 | ||||
-rw-r--r-- | include/git2/errors.h | 3 | ||||
-rw-r--r-- | include/git2/oid.h | 15 | ||||
-rw-r--r-- | include/git2/remote.h | 6 | ||||
-rw-r--r-- | include/git2/revwalk.h | 10 | ||||
-rw-r--r-- | include/git2/sys/index.h | 6 | ||||
-rw-r--r-- | include/git2/sys/mempack.h | 3 | ||||
-rw-r--r-- | include/git2/sys/repository.h | 17 | ||||
-rw-r--r-- | include/git2/tree.h | 6 |
10 files changed, 51 insertions, 23 deletions
diff --git a/include/git2/attr.h b/include/git2/attr.h index 72e43806c..a3ab5a7a2 100644 --- a/include/git2/attr.h +++ b/include/git2/attr.h @@ -238,8 +238,11 @@ GIT_EXTERN(int) git_attr_foreach( * disk no longer match the cached contents of memory. This will cause * the attributes files to be reloaded the next time that an attribute * access function is called. + * + * @param repo The repository containing the gitattributes cache + * @return 0 on success, or an error code */ -GIT_EXTERN(void) git_attr_cache_flush( +GIT_EXTERN(int) git_attr_cache_flush( git_repository *repo); /** diff --git a/include/git2/common.h b/include/git2/common.h index 947e40845..d6696061d 100644 --- a/include/git2/common.h +++ b/include/git2/common.h @@ -117,8 +117,9 @@ GIT_BEGIN_DECL * @param major Store the major version number * @param minor Store the minor version number * @param rev Store the revision (patch) number + * @return 0 on success or an error code on failure */ -GIT_EXTERN(void) git_libgit2_version(int *major, int *minor, int *rev); +GIT_EXTERN(int) git_libgit2_version(int *major, int *minor, int *rev); /** * Combinations of these values describe the features with which libgit2 diff --git a/include/git2/errors.h b/include/git2/errors.h index 370b6ac49..5c85c4d6c 100644 --- a/include/git2/errors.h +++ b/include/git2/errors.h @@ -143,8 +143,9 @@ GIT_EXTERN(void) git_error_clear(void); * @param error_class One of the `git_error_t` enum above describing the * general subsystem that is responsible for the error. * @param string The formatted error message to keep + * @return 0 on success or -1 on failure */ -GIT_EXTERN(void) git_error_set_str(int error_class, const char *string); +GIT_EXTERN(int) git_error_set_str(int error_class, const char *string); /** * Set the error message to a special value for memory allocation failure. diff --git a/include/git2/oid.h b/include/git2/oid.h index 8f27c1365..549df4eab 100644 --- a/include/git2/oid.h +++ b/include/git2/oid.h @@ -73,8 +73,9 @@ GIT_EXTERN(int) git_oid_fromstrn(git_oid *out, const char *str, size_t length); * * @param out oid structure the result is written into. * @param raw the raw input bytes to be copied. + * @return 0 on success or error code */ -GIT_EXTERN(void) git_oid_fromraw(git_oid *out, const unsigned char *raw); +GIT_EXTERN(int) git_oid_fromraw(git_oid *out, const unsigned char *raw); /** * Format a git_oid into a hex string. @@ -85,8 +86,9 @@ GIT_EXTERN(void) git_oid_fromraw(git_oid *out, const unsigned char *raw); * oid digits are written; a '\\0' terminator must be added * by the caller if it is required. * @param id oid structure to format. + * @return 0 on success or error code */ -GIT_EXTERN(void) git_oid_fmt(char *out, const git_oid *id); +GIT_EXTERN(int) git_oid_fmt(char *out, const git_oid *id); /** * Format a git_oid into a partial hex string. @@ -96,8 +98,9 @@ GIT_EXTERN(void) git_oid_fmt(char *out, const git_oid *id); * will be zeroed; if not, a '\0' terminator is NOT added. * @param n number of characters to write into out string * @param id oid structure to format. + * @return 0 on success or error code */ -GIT_EXTERN(void) git_oid_nfmt(char *out, size_t n, const git_oid *id); +GIT_EXTERN(int) git_oid_nfmt(char *out, size_t n, const git_oid *id); /** * Format a git_oid into a loose-object path string. @@ -111,8 +114,9 @@ GIT_EXTERN(void) git_oid_nfmt(char *out, size_t n, const git_oid *id); * oid digits are written; a '\\0' terminator must be added * by the caller if it is required. * @param id oid structure to format. + * @return 0 on success, non-zero callback return value, or error code */ -GIT_EXTERN(void) git_oid_pathfmt(char *out, const git_oid *id); +GIT_EXTERN(int) git_oid_pathfmt(char *out, const git_oid *id); /** * Format a git_oid into a statically allocated c-string. @@ -151,8 +155,9 @@ GIT_EXTERN(char *) git_oid_tostr(char *out, size_t n, const git_oid *id); * * @param out oid structure the result is written into. * @param src oid structure to copy from. + * @return 0 on success or error code */ -GIT_EXTERN(void) git_oid_cpy(git_oid *out, const git_oid *src); +GIT_EXTERN(int) git_oid_cpy(git_oid *out, const git_oid *src); /** * Compare two oid structures. diff --git a/include/git2/remote.h b/include/git2/remote.h index f9454d6d5..a6ed4cb5d 100644 --- a/include/git2/remote.h +++ b/include/git2/remote.h @@ -378,8 +378,9 @@ GIT_EXTERN(int) git_remote_connected(const git_remote *remote); * the operation has been cancelled and if so stops the operation. * * @param remote the remote + * @return 0 on success, or an error code */ -GIT_EXTERN(void) git_remote_stop(git_remote *remote); +GIT_EXTERN(int) git_remote_stop(git_remote *remote); /** * Disconnect from the remote @@ -387,8 +388,9 @@ GIT_EXTERN(void) git_remote_stop(git_remote *remote); * Close the connection to the remote. * * @param remote the remote to disconnect from + * @return 0 on success, or an error code */ -GIT_EXTERN(void) git_remote_disconnect(git_remote *remote); +GIT_EXTERN(int) git_remote_disconnect(git_remote *remote); /** * Free the memory associated with a remote diff --git a/include/git2/revwalk.h b/include/git2/revwalk.h index 9cb0d0a67..98dcbf8d1 100644 --- a/include/git2/revwalk.h +++ b/include/git2/revwalk.h @@ -84,8 +84,9 @@ GIT_EXTERN(int) git_revwalk_new(git_revwalk **out, git_repository *repo); * is over. * * @param walker handle to reset. + * @return 0 or an error code */ -GIT_EXTERN(void) git_revwalk_reset(git_revwalk *walker); +GIT_EXTERN(int) git_revwalk_reset(git_revwalk *walker); /** * Add a new root for the traversal @@ -224,8 +225,9 @@ GIT_EXTERN(int) git_revwalk_next(git_oid *out, git_revwalk *walk); * * @param walk the walker being used for the traversal. * @param sort_mode combination of GIT_SORT_XXX flags + * @return 0 or an error code */ -GIT_EXTERN(void) git_revwalk_sorting(git_revwalk *walk, unsigned int sort_mode); +GIT_EXTERN(int) git_revwalk_sorting(git_revwalk *walk, unsigned int sort_mode); /** * Push and hide the respective endpoints of the given range. @@ -246,8 +248,10 @@ GIT_EXTERN(int) git_revwalk_push_range(git_revwalk *walk, const char *range); * Simplify the history by first-parent * * No parents other than the first for each commit will be enqueued. + * + * @return 0 or an error code */ -GIT_EXTERN(void) git_revwalk_simplify_first_parent(git_revwalk *walk); +GIT_EXTERN(int) git_revwalk_simplify_first_parent(git_revwalk *walk); /** diff --git a/include/git2/sys/index.h b/include/git2/sys/index.h index f1900df42..1f6d93f7a 100644 --- a/include/git2/sys/index.h +++ b/include/git2/sys/index.h @@ -75,8 +75,9 @@ GIT_EXTERN(int) git_index_name_add(git_index *index, * Remove all filename conflict entries. * * @param index an existing index object + * @return 0 or an error code */ -GIT_EXTERN(void) git_index_name_clear(git_index *index); +GIT_EXTERN(int) git_index_name_clear(git_index *index); /**@}*/ @@ -170,8 +171,9 @@ GIT_EXTERN(int) git_index_reuc_remove(git_index *index, size_t n); * Remove all resolve undo entries from the index * * @param index an existing index object + * @return 0 or an error code */ -GIT_EXTERN(void) git_index_reuc_clear(git_index *index); +GIT_EXTERN(int) git_index_reuc_clear(git_index *index); /**@}*/ diff --git a/include/git2/sys/mempack.h b/include/git2/sys/mempack.h index 63fb38dc8..17da590a3 100644 --- a/include/git2/sys/mempack.h +++ b/include/git2/sys/mempack.h @@ -78,8 +78,9 @@ GIT_EXTERN(int) git_mempack_dump(git_buf *pack, git_repository *repo, git_odb_ba * semantics to the Git repository. * * @param backend The mempack backend + * @return 0 on success; error code otherwise */ -GIT_EXTERN(void) git_mempack_reset(git_odb_backend *backend); +GIT_EXTERN(int) git_mempack_reset(git_odb_backend *backend); GIT_END_DECL diff --git a/include/git2/sys/repository.h b/include/git2/sys/repository.h index ea2773fd8..892be6692 100644 --- a/include/git2/sys/repository.h +++ b/include/git2/sys/repository.h @@ -44,8 +44,11 @@ GIT_EXTERN(int) git_repository_new(git_repository **out); * trying to aggressively cleanup the repo before its * deallocation. `git_repository_free` already performs this operation * before deallocating the repo. + * + * @param repo The repository to clean up + * @return 0 on success, or an error code */ -GIT_EXTERN(void) git_repository__cleanup(git_repository *repo); +GIT_EXTERN(int) git_repository__cleanup(git_repository *repo); /** * Update the filesystem config settings for an open repository @@ -78,8 +81,9 @@ GIT_EXTERN(int) git_repository_reinit_filesystem( * * @param repo A repository object * @param config A Config object + * @return 0 on success, or an error code */ -GIT_EXTERN(void) git_repository_set_config(git_repository *repo, git_config *config); +GIT_EXTERN(int) git_repository_set_config(git_repository *repo, git_config *config); /** * Set the Object Database for this repository @@ -93,8 +97,9 @@ GIT_EXTERN(void) git_repository_set_config(git_repository *repo, git_config *con * * @param repo A repository object * @param odb An ODB object + * @return 0 on success, or an error code */ -GIT_EXTERN(void) git_repository_set_odb(git_repository *repo, git_odb *odb); +GIT_EXTERN(int) git_repository_set_odb(git_repository *repo, git_odb *odb); /** * Set the Reference Database Backend for this repository @@ -108,8 +113,9 @@ GIT_EXTERN(void) git_repository_set_odb(git_repository *repo, git_odb *odb); * * @param repo A repository object * @param refdb An refdb object + * @return 0 on success, or an error code */ -GIT_EXTERN(void) git_repository_set_refdb(git_repository *repo, git_refdb *refdb); +GIT_EXTERN(int) git_repository_set_refdb(git_repository *repo, git_refdb *refdb); /** * Set the index file for this repository @@ -123,8 +129,9 @@ GIT_EXTERN(void) git_repository_set_refdb(git_repository *repo, git_refdb *refdb * * @param repo A repository object * @param index An index object + * @return 0 on success, or an error code */ -GIT_EXTERN(void) git_repository_set_index(git_repository *repo, git_index *index); +GIT_EXTERN(int) git_repository_set_index(git_repository *repo, git_index *index); /** * Set a repository to be bare. diff --git a/include/git2/tree.h b/include/git2/tree.h index 4455d2e73..1a8e155fc 100644 --- a/include/git2/tree.h +++ b/include/git2/tree.h @@ -258,8 +258,9 @@ GIT_EXTERN(int) git_treebuilder_new( * Clear all the entires in the builder * * @param bld Builder to clear + * @return 0 on success; error code otherwise */ -GIT_EXTERN(void) git_treebuilder_clear(git_treebuilder *bld); +GIT_EXTERN(int) git_treebuilder_clear(git_treebuilder *bld); /** * Get the number of entries listed in a treebuilder @@ -357,8 +358,9 @@ typedef int GIT_CALLBACK(git_treebuilder_filter_cb)( * @param bld Tree builder * @param filter Callback to filter entries * @param payload Extra data to pass to filter callback + * @return 0 on success, non-zero callback return value, or error code */ -GIT_EXTERN(void) git_treebuilder_filter( +GIT_EXTERN(int) git_treebuilder_filter( git_treebuilder *bld, git_treebuilder_filter_cb filter, void *payload); |