bump version number
[got-portable.git] / include / got_blame.h
blob7a5d61c35cf7807ba8f820712005a94d28e118fe
1 /*
2 * Copyright (c) 2018 Stefan Sperling <stsp@openbsd.org>
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 typedef const struct got_error *(*got_blame_cb)(void *, int, int,
18 struct got_commit_object *, struct got_object_id *);
21 * Blame the blob at the specified path in the specified commit and invoke
22 * a callback whenever an annotation has been computed for a line.
24 * The callback receives the provided void * argument, the total number
25 * of lines of the annotated file, a line number, and the ID of the commit
26 * which last changed this line.
28 * The callback is invoked for each commit as history is traversed.
29 * If no changes to the file were made in a commit, line number -1 will
30 * be reported.
32 * If the callback returns GOT_ERR_ITER_COMPLETED, the blame operation
33 * will be aborted and this function returns NULL.
34 * If the callback returns any other error, the blame operation will be
35 * aborted and the callback's error is returned from this function.
37 const struct got_error *got_blame(const char *,
38 struct got_object_id *, struct got_repository *, enum got_diff_algorithm,
39 got_blame_cb, void *, got_cancel_cb, void *, int, int, FILE *, FILE *);