diff options
| author | Etienne Samson <samson.etienne@gmail.com> | 2018-03-22 23:27:24 +0100 |
|---|---|---|
| committer | Etienne Samson <samson.etienne@gmail.com> | 2018-05-07 21:50:15 +0200 |
| commit | f46c360e49e955d41c9632ea60e7a21ec7eba61d (patch) | |
| tree | 7b4fcea03fbb5b4b0d4defc8d9622f4b0b9896d8 /include | |
| parent | efad967a6cba843726056915c52dedb6d0ff4125 (diff) | |
| download | libgit2-f46c360e49e955d41c9632ea60e7a21ec7eba61d.tar.gz | |
docs: move callback-specific documentation to the callback
Diffstat (limited to 'include')
| -rw-r--r-- | include/git2/attr.h | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/include/git2/attr.h b/include/git2/attr.h index 0238f3dd7..a58d21b7a 100644 --- a/include/git2/attr.h +++ b/include/git2/attr.h @@ -186,6 +186,22 @@ GIT_EXTERN(int) git_attr_get_many( size_t num_attr, const char **names); +/** + * The callback used with git_attr_foreach. + * + * This callback will be invoked only once per attribute name, even if there + * are multiple rules for a given file. The highest priority rule will be + * used. + * + * @see git_attr_foreach. + * + * @param name The attribute name. + * @param value The attribute value. May be NULL is the attribute is explicitly + * set to UNSPECIFIED using the '!' sign. + * @param payload A user-specified pointer. + * @return 0 to continue looping, non-zero to stop. This value will be returned + * from git_attr_foreach. + */ typedef int (*git_attr_foreach_cb)(const char *name, const char *value, void *payload); /** @@ -196,13 +212,8 @@ typedef int (*git_attr_foreach_cb)(const char *name, const char *value, void *pa * @param path Path inside the repo to check attributes. This does not have * to exist, but if it does not, then it will be treated as a * plain file (i.e. not a directory). - * @param callback Function to invoke on each attribute name and value. The - * value may be NULL is the attribute is explicitly set to - * UNSPECIFIED using the '!' sign. Callback will be invoked - * only once per attribute name, even if there are multiple - * rules for a given file. The highest priority rule will be - * used. Return a non-zero value from this to stop looping. - * The value will be returned from `git_attr_foreach`. + * @param callback Function to invoke on each attribute name and value. + * See git_attr_foreach_cb. * @param payload Passed on as extra parameter to callback function. * @return 0 on success, non-zero callback return value, or error code */ |
