Skip to content
Newer
Older
100644 54 lines (43 sloc) 1.68 KB
355885d add generic, type aware object chain walker
Martin Koegler authored Feb 25, 2008
1 #ifndef GIT_FSCK_H
2 #define GIT_FSCK_H
3
ba002f3 builtin-fsck: move common object checking code to fsck.c
Martin Koegler authored Feb 25, 2008
4 #define FSCK_ERROR 1
5 #define FSCK_WARN 2
efaba7c @dscho fsck: optionally ignore specific fsck issues completely
dscho authored Jun 22, 2015
6 #define FSCK_IGNORE 3
ba002f3 builtin-fsck: move common object checking code to fsck.c
Martin Koegler authored Feb 25, 2008
7
2241054 @dscho fsck: introduce fsck options
dscho authored Jun 22, 2015
8 struct fsck_options;
9
0282f4d @dscho fsck: offer a function to demote fsck errors to warnings
dscho authored Jun 22, 2015
10 void fsck_set_msg_type(struct fsck_options *options,
11 const char *msg_id, const char *msg_type);
12 void fsck_set_msg_types(struct fsck_options *options, const char *values);
5d477a3 @dscho fsck (receive-pack): allow demoting errors to warnings
dscho authored Jun 22, 2015
13 int is_valid_msg_type(const char *msg_id, const char *msg_type);
0282f4d @dscho fsck: offer a function to demote fsck errors to warnings
dscho authored Jun 22, 2015
14
355885d add generic, type aware object chain walker
Martin Koegler authored Feb 25, 2008
15 /*
16 * callback function for fsck_walk
17 * type is the expected type of the object or OBJ_ANY
18 * the return value is:
19 * 0 everything OK
20 * <0 error signaled and abort
21 * >0 error signaled and do not abort
22 */
2241054 @dscho fsck: introduce fsck options
dscho authored Jun 22, 2015
23 typedef int (*fsck_walk_func)(struct object *obj, int type, void *data, struct fsck_options *options);
355885d add generic, type aware object chain walker
Martin Koegler authored Feb 25, 2008
24
ba002f3 builtin-fsck: move common object checking code to fsck.c
Martin Koegler authored Feb 25, 2008
25 /* callback for fsck_object, type is FSCK_ERROR or FSCK_WARN */
c99ba49 @dscho fsck: introduce identifiers for fsck messages
dscho authored Jun 22, 2015
26 typedef int (*fsck_error)(struct object *obj, int type, const char *message);
ba002f3 builtin-fsck: move common object checking code to fsck.c
Martin Koegler authored Feb 25, 2008
27
c99ba49 @dscho fsck: introduce identifiers for fsck messages
dscho authored Jun 22, 2015
28 int fsck_error_function(struct object *obj, int type, const char *message);
d6ffc8d add common fsck error printing function
Martin Koegler authored Feb 25, 2008
29
2241054 @dscho fsck: introduce fsck options
dscho authored Jun 22, 2015
30 struct fsck_options {
31 fsck_walk_func walk;
32 fsck_error error_func;
33 unsigned strict:1;
0282f4d @dscho fsck: offer a function to demote fsck errors to warnings
dscho authored Jun 22, 2015
34 int *msg_type;
cd94c6f @dscho fsck: git receive-pack: support excluding objects from fsck'ing
dscho authored Jun 22, 2015
35 struct sha1_array *skiplist;
2241054 @dscho fsck: introduce fsck options
dscho authored Jun 22, 2015
36 };
37
0282f4d @dscho fsck: offer a function to demote fsck errors to warnings
dscho authored Jun 22, 2015
38 #define FSCK_OPTIONS_DEFAULT { NULL, fsck_error_function, 0, NULL }
39 #define FSCK_OPTIONS_STRICT { NULL, fsck_error_function, 1, NULL }
2241054 @dscho fsck: introduce fsck options
dscho authored Jun 22, 2015
40
355885d add generic, type aware object chain walker
Martin Koegler authored Feb 25, 2008
41 /* descend in all linked child objects
42 * the return value is:
43 * -1 error in processing the object
44 * <0 return value of the callback, which lead to an abort
3ea3c21 @MikeRalphson Fix typos / spelling in comments
MikeRalphson authored Apr 17, 2009
45 * >0 return value of the first signaled error >0 (in the case of no other errors)
355885d add generic, type aware object chain walker
Martin Koegler authored Feb 25, 2008
46 * 0 everything OK
47 */
2241054 @dscho fsck: introduce fsck options
dscho authored Jun 22, 2015
48 int fsck_walk(struct object *obj, void *data, struct fsck_options *options);
90a398b @dscho fsck_object(): allow passing object data separately from the object i…
dscho authored Sep 10, 2014
49 /* If NULL is passed for data, we assume the object is local and read it. */
50 int fsck_object(struct object *obj, void *data, unsigned long size,
2241054 @dscho fsck: introduce fsck options
dscho authored Jun 22, 2015
51 struct fsck_options *options);
355885d add generic, type aware object chain walker
Martin Koegler authored Feb 25, 2008
52
53 #endif
Something went wrong with that request. Please try again.