Skip to content

Commit f46c360

Browse files
committed
docs: move callback-specific documentation to the callback
1 parent efad967 commit f46c360

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

include/git2/attr.h

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,22 @@ GIT_EXTERN(int) git_attr_get_many(
186186
size_t num_attr,
187187
const char **names);
188188

189+
/**
190+
* The callback used with git_attr_foreach.
191+
*
192+
* This callback will be invoked only once per attribute name, even if there
193+
* are multiple rules for a given file. The highest priority rule will be
194+
* used.
195+
*
196+
* @see git_attr_foreach.
197+
*
198+
* @param name The attribute name.
199+
* @param value The attribute value. May be NULL is the attribute is explicitly
200+
* set to UNSPECIFIED using the '!' sign.
201+
* @param payload A user-specified pointer.
202+
* @return 0 to continue looping, non-zero to stop. This value will be returned
203+
* from git_attr_foreach.
204+
*/
189205
typedef int (*git_attr_foreach_cb)(const char *name, const char *value, void *payload);
190206

191207
/**
@@ -196,13 +212,8 @@ typedef int (*git_attr_foreach_cb)(const char *name, const char *value, void *pa
196212
* @param path Path inside the repo to check attributes. This does not have
197213
* to exist, but if it does not, then it will be treated as a
198214
* plain file (i.e. not a directory).
199-
* @param callback Function to invoke on each attribute name and value. The
200-
* value may be NULL is the attribute is explicitly set to
201-
* UNSPECIFIED using the '!' sign. Callback will be invoked
202-
* only once per attribute name, even if there are multiple
203-
* rules for a given file. The highest priority rule will be
204-
* used. Return a non-zero value from this to stop looping.
205-
* The value will be returned from `git_attr_foreach`.
215+
* @param callback Function to invoke on each attribute name and value.
216+
* See git_attr_foreach_cb.
206217
* @param payload Passed on as extra parameter to callback function.
207218
* @return 0 on success, non-zero callback return value, or error code
208219
*/

0 commit comments

Comments
 (0)