summaryrefslogtreecommitdiff
path: root/include/git2/notes.h
diff options
context:
space:
mode:
authorNico von Geyso <Nico.Geyso@FU-Berlin.de>2013-03-06 16:43:21 +0100
committerNico von Geyso <Nico.Geyso@FU-Berlin.de>2013-03-06 17:01:33 +0100
commit6edb427b7615207142e10a228164d6a019045126 (patch)
treedf37c3e13d447f8fd5ee33198cbe7921439c4f2d /include/git2/notes.h
parentd1bcc1a8744343253df569ae4798302c1ff796e7 (diff)
downloadlibgit2-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.h39
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.