diff options
author | Nico von Geyso <Nico.Geyso@FU-Berlin.de> | 2013-03-06 16:43:21 +0100 |
---|---|---|
committer | Nico von Geyso <Nico.Geyso@FU-Berlin.de> | 2013-03-06 17:01:33 +0100 |
commit | 6edb427b7615207142e10a228164d6a019045126 (patch) | |
tree | df37c3e13d447f8fd5ee33198cbe7921439c4f2d /include/git2/notes.h | |
parent | d1bcc1a8744343253df569ae4798302c1ff796e7 (diff) | |
download | libgit2-6edb427b7615207142e10a228164d6a019045126.tar.gz |
basic note iterator implementation
* git_note_iterator_new() - create a new note iterator
* git_note_next() - retrieves the next item of the iterator
Diffstat (limited to 'include/git2/notes.h')
-rw-r--r-- | include/git2/notes.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/include/git2/notes.h b/include/git2/notes.h index c51d3732a..466f0a894 100644 --- a/include/git2/notes.h +++ b/include/git2/notes.h @@ -30,6 +30,45 @@ typedef int (*git_note_foreach_cb)( const git_oid *blob_id, const git_oid *annotated_object_id, void *payload); /** + * note iterator + */ +typedef struct git_iterator git_iterator; + +/** + * Creates a new iterator for notes + * + * The iterator must be freed manually by the user. + * + * @param out pointer to the iterator + * @param repo repository where to look up the note + * @param notes_ref canonical name of the reference to use (optional); defaults to + * "refs/notes/commits" + * + * @return 0 or an error code + */ +GIT_EXTERN(int) git_note_iterator_new( + git_iterator **out, + git_repository *repo, + const char *notes_ref); + +/** + * Next iteration step for note iteration + * + * The notes must not be freed manually by the user. + * + * @param it pointer to the iterator + * @param note_id id of blob containing the message + * @param annotated_id id of the git object being annotated + * + * @return 0, GIT_ITEROVER or an error code + */ +GIT_EXTERN(int) git_note_next( + git_oid* note_id, + git_oid* annotated_id, + git_iterator *it); + + +/** * Read the note for an object * * The note must be freed manually by the user. |