Hash :
11528a82
        
        Author :
  
        
        Date :
2018-05-19T16:28:32
        
      
move common diff helpers from got and tog into lib/diff.c
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
/*
 * Copyright (c) 2018 Stefan Sperling <stsp@openbsd.org>
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */
/*
 * Compute the differences between two blobs and write unified diff text
 * to the provided output FILE. Two const char * diff header labels may
 * be provided which will be used to identify each blob in the diff output.
 * If a label is NULL, use the blob's SHA1 checksum instead.
 */
const struct got_error *got_diff_blob(struct got_blob_object *,
    struct got_blob_object *, const char *, const char *, FILE *);
/*
 * Compute the differences between two trees and write unified diff text
 * to the provided output FILE.
 */
const struct got_error *got_diff_tree(struct got_tree_object *,
    struct got_tree_object *, struct got_repository *, FILE *);
/*
 * Diff two objects, assuming both objects are blobs.
 * Write unified diff text to the provided output FILE.
 */
const struct got_error *got_diff_objects_as_blobs(struct got_object *,
    struct got_object *, struct got_repository *, FILE *);
/*
 * Diff two objects, assuming both objects are trees.
 * Write unified diff text to the provided output FILE.
 */
const struct got_error *got_diff_objects_as_trees(struct got_object *,
    struct got_object *, struct got_repository *, FILE *);
/*
 * Diff two objects, assuming both objects are commits.
 * Write unified diff text to the provided output FILE.
 */
const struct got_error *got_diff_objects_as_commits(struct got_object *,
    struct got_object *, struct got_repository *, FILE *);