@@ -188,9 +188,9 @@ typedef struct {
188188 * When iterating over a diff, callback that will be made per file.
189189 */
190190typedef int (* git_diff_file_cb )(
191- void * cb_data ,
192191 const git_diff_delta * delta ,
193- float progress );
192+ float progress ,
193+ void * payload );
194194
195195/**
196196 * Structure describing a hunk of a diff.
@@ -206,11 +206,11 @@ typedef struct {
206206 * When iterating over a diff, callback that will be made per hunk.
207207 */
208208typedef int (* git_diff_hunk_cb )(
209- void * cb_data ,
210209 const git_diff_delta * delta ,
211210 const git_diff_range * range ,
212211 const char * header ,
213- size_t header_len );
212+ size_t header_len ,
213+ void * payload );
214214
215215/**
216216 * Line origin constants.
@@ -247,12 +247,12 @@ typedef enum {
247247 * of lines of file and hunk headers.
248248 */
249249typedef int (* git_diff_data_cb )(
250- void * cb_data ,
251250 const git_diff_delta * delta ,
252251 const git_diff_range * range ,
253252 char line_origin , /**< GIT_DIFF_LINE_... value from above */
254253 const char * content ,
255- size_t content_len );
254+ size_t content_len ,
255+ void * payload );
256256
257257/**
258258 * The diff patch is used to store all the text diffs for a delta.
@@ -284,6 +284,8 @@ typedef enum {
284284 * Control behavior of rename and copy detection
285285 */
286286typedef struct {
287+ unsigned int version ;
288+
287289 /** Combination of git_diff_find_t values (default FIND_RENAMES) */
288290 unsigned int flags ;
289291
@@ -462,22 +464,22 @@ GIT_EXTERN(int) git_diff_find_similar(
462464 * the iteration and cause this return `GIT_EUSER`.
463465 *
464466 * @param diff A git_diff_list generated by one of the above functions.
465- * @param cb_data Reference pointer that will be passed to your callbacks.
466467 * @param file_cb Callback function to make per file in the diff.
467468 * @param hunk_cb Optional callback to make per hunk of text diff. This
468469 * callback is called to describe a range of lines in the
469470 * diff. It will not be issued for binary files.
470471 * @param line_cb Optional callback to make per line of diff text. This
471472 * same callback will be made for context lines, added, and
472473 * removed lines, and even for a deleted trailing newline.
474+ * @param payload Reference pointer that will be passed to your callbacks.
473475 * @return 0 on success, GIT_EUSER on non-zero callback, or error code
474476 */
475477GIT_EXTERN (int ) git_diff_foreach (
476478 git_diff_list * diff ,
477- void * cb_data ,
478479 git_diff_file_cb file_cb ,
479480 git_diff_hunk_cb hunk_cb ,
480- git_diff_data_cb line_cb );
481+ git_diff_data_cb line_cb ,
482+ void * payload );
481483
482484/**
483485 * Iterate over a diff generating text output like "git diff --name-status".
@@ -486,14 +488,14 @@ GIT_EXTERN(int) git_diff_foreach(
486488 * iteration and cause this return `GIT_EUSER`.
487489 *
488490 * @param diff A git_diff_list generated by one of the above functions.
489- * @param cb_data Reference pointer that will be passed to your callback.
490491 * @param print_cb Callback to make per line of diff text.
492+ * @param payload Reference pointer that will be passed to your callback.
491493 * @return 0 on success, GIT_EUSER on non-zero callback, or error code
492494 */
493495GIT_EXTERN (int ) git_diff_print_compact (
494496 git_diff_list * diff ,
495- void * cb_data ,
496- git_diff_data_cb print_cb );
497+ git_diff_data_cb print_cb ,
498+ void * payload );
497499
498500/**
499501 * Look up the single character abbreviation for a delta status code.
@@ -518,7 +520,7 @@ GIT_EXTERN(char) git_diff_status_char(git_delta_t status);
518520 * iteration and cause this return `GIT_EUSER`.
519521 *
520522 * @param diff A git_diff_list generated by one of the above functions.
521- * @param cb_data Reference pointer that will be passed to your callbacks.
523+ * @param payload Reference pointer that will be passed to your callbacks.
522524 * @param print_cb Callback function to output lines of the diff. This
523525 * same function will be called for file headers, hunk
524526 * headers, and diff lines. Fortunately, you can probably
@@ -528,8 +530,8 @@ GIT_EXTERN(char) git_diff_status_char(git_delta_t status);
528530 */
529531GIT_EXTERN (int ) git_diff_print_patch (
530532 git_diff_list * diff ,
531- void * cb_data ,
532- git_diff_data_cb print_cb );
533+ git_diff_data_cb print_cb ,
534+ void * payload );
533535
534536/**
535537 * Query how many diff records are there in a diff list.
@@ -573,15 +575,15 @@ GIT_EXTERN(size_t) git_diff_num_deltas_of_type(
573575 * It is okay to pass NULL for either of the output parameters; if you pass
574576 * NULL for the `git_diff_patch`, then the text diff will not be calculated.
575577 *
576- * @param patch Output parameter for the delta patch object
577- * @param delta Output parameter for the delta object
578+ * @param patch_out Output parameter for the delta patch object
579+ * @param delta_out Output parameter for the delta object
578580 * @param diff Diff list object
579581 * @param idx Index into diff list
580582 * @return 0 on success, other value < 0 on error
581583 */
582584GIT_EXTERN (int ) git_diff_get_patch (
583- git_diff_patch * * patch ,
584- const git_diff_delta * * delta ,
585+ git_diff_patch * * patch_out ,
586+ const git_diff_delta * * delta_out ,
585587 git_diff_list * diff ,
586588 size_t idx );
587589
@@ -673,15 +675,15 @@ GIT_EXTERN(int) git_diff_patch_get_line_in_hunk(
673675 * and cause this return `GIT_EUSER`.
674676 *
675677 * @param patch A git_diff_patch representing changes to one file
676- * @param cb_data Reference pointer that will be passed to your callbacks.
677678 * @param print_cb Callback function to output lines of the patch. Will be
678679 * called for file headers, hunk headers, and diff lines.
680+ * @param payload Reference pointer that will be passed to your callbacks.
679681 * @return 0 on success, GIT_EUSER on non-zero callback, or error code
680682 */
681683GIT_EXTERN (int ) git_diff_patch_print (
682684 git_diff_patch * patch ,
683- void * cb_data ,
684- git_diff_data_cb print_cb );
685+ git_diff_data_cb print_cb ,
686+ void * payload );
685687
686688/**
687689 * Get the content of a patch as a single diff text.
@@ -719,10 +721,10 @@ GIT_EXTERN(int) git_diff_blobs(
719721 git_blob * old_blob ,
720722 git_blob * new_blob ,
721723 const git_diff_options * options ,
722- void * cb_data ,
723724 git_diff_file_cb file_cb ,
724725 git_diff_hunk_cb hunk_cb ,
725- git_diff_data_cb line_cb );
726+ git_diff_data_cb line_cb ,
727+ void * payload );
726728
727729GIT_END_DECL
728730
0 commit comments