Daniel Barkalow | 30ae764 | 2007-09-10 23:02:45 -0400 | [diff] [blame] | 1 | #ifndef WALKER_H |
| 2 | #define WALKER_H |
| 3 | |
Mike Hommey | 9fc6440 | 2008-02-27 21:35:50 +0100 | [diff] [blame] | 4 | #include "remote.h" |
| 5 | |
Daniel Barkalow | 30ae764 | 2007-09-10 23:02:45 -0400 | [diff] [blame] | 6 | struct walker { |
| 7 | void *data; |
Daniel Barkalow | c13b263 | 2008-04-26 15:53:09 -0400 | [diff] [blame] | 8 | int (*fetch_ref)(struct walker *, struct ref *ref); |
Daniel Barkalow | 30ae764 | 2007-09-10 23:02:45 -0400 | [diff] [blame] | 9 | void (*prefetch)(struct walker *, unsigned char *sha1); |
| 10 | int (*fetch)(struct walker *, unsigned char *sha1); |
| 11 | void (*cleanup)(struct walker *); |
Daniel Barkalow | 30ae764 | 2007-09-10 23:02:45 -0400 | [diff] [blame] | 12 | int get_verbosely; |
René Scharfe | 7655b41 | 2020-03-03 21:55:34 +0100 | [diff] [blame] | 13 | int get_progress; |
Daniel Barkalow | 30ae764 | 2007-09-10 23:02:45 -0400 | [diff] [blame] | 14 | int get_recover; |
| 15 | |
| 16 | int corrupt_object_found; |
| 17 | }; |
| 18 | |
| 19 | /* Report what we got under get_verbosely */ |
Jeff King | fa262ca | 2016-07-08 05:25:23 -0400 | [diff] [blame] | 20 | __attribute__((format (printf, 2, 3))) |
| 21 | void walker_say(struct walker *walker, const char *fmt, ...); |
Daniel Barkalow | 30ae764 | 2007-09-10 23:02:45 -0400 | [diff] [blame] | 22 | |
| 23 | /* Load pull targets from stdin */ |
| 24 | int walker_targets_stdin(char ***target, const char ***write_ref); |
| 25 | |
| 26 | /* Free up loaded targets */ |
| 27 | void walker_targets_free(int targets, char **target, const char **write_ref); |
| 28 | |
| 29 | /* If write_ref is set, the ref filename to write the target value to. */ |
| 30 | /* If write_ref_log_details is set, additional text will appear in the ref log. */ |
| 31 | int walker_fetch(struct walker *impl, int targets, char **target, |
| 32 | const char **write_ref, const char *write_ref_log_details); |
| 33 | |
| 34 | void walker_free(struct walker *walker); |
| 35 | |
Tay Ray Chuan | 888692b | 2010-03-02 18:49:29 +0800 | [diff] [blame] | 36 | struct walker *get_http_walker(const char *url); |
Daniel Barkalow | 30ae764 | 2007-09-10 23:02:45 -0400 | [diff] [blame] | 37 | |
| 38 | #endif /* WALKER_H */ |