blob: d40b016bab87980d814571fe8fd96b0f69b495e2 [file] [log] [blame]
Daniel Barkalow30ae7642007-09-10 23:02:45 -04001#ifndef WALKER_H
2#define WALKER_H
3
Mike Hommey9fc64402008-02-27 21:35:50 +01004#include "remote.h"
5
Daniel Barkalow30ae7642007-09-10 23:02:45 -04006struct walker {
7 void *data;
Daniel Barkalowc13b2632008-04-26 15:53:09 -04008 int (*fetch_ref)(struct walker *, struct ref *ref);
Daniel Barkalow30ae7642007-09-10 23:02:45 -04009 void (*prefetch)(struct walker *, unsigned char *sha1);
10 int (*fetch)(struct walker *, unsigned char *sha1);
11 void (*cleanup)(struct walker *);
Daniel Barkalow30ae7642007-09-10 23:02:45 -040012 int get_verbosely;
René Scharfe7655b412020-03-03 21:55:34 +010013 int get_progress;
Daniel Barkalow30ae7642007-09-10 23:02:45 -040014 int get_recover;
15
16 int corrupt_object_found;
17};
18
19/* Report what we got under get_verbosely */
Jeff Kingfa262ca2016-07-08 05:25:23 -040020__attribute__((format (printf, 2, 3)))
21void walker_say(struct walker *walker, const char *fmt, ...);
Daniel Barkalow30ae7642007-09-10 23:02:45 -040022
23/* Load pull targets from stdin */
24int walker_targets_stdin(char ***target, const char ***write_ref);
25
26/* Free up loaded targets */
27void 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. */
31int walker_fetch(struct walker *impl, int targets, char **target,
32 const char **write_ref, const char *write_ref_log_details);
33
34void walker_free(struct walker *walker);
35
Tay Ray Chuan888692b2010-03-02 18:49:29 +080036struct walker *get_http_walker(const char *url);
Daniel Barkalow30ae7642007-09-10 23:02:45 -040037
38#endif /* WALKER_H */