diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2015-06-22 17:25:09 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-06-22 10:24:27 -0700 |
commit | c99ba492f1cc3e632ed12d46d7358effb6fa7f03 (patch) | |
tree | 00ffb72c99d3354e9044971ace8b8164cf8adf44 /fsck.h | |
parent | 22410549fc71b3973a61666f82b7c76317da5df0 (diff) | |
download | git-c99ba492f1cc3e632ed12d46d7358effb6fa7f03.tar.gz |
fsck: introduce identifiers for fsck messages
Instead of specifying whether a message by the fsck machinery constitutes
an error or a warning, let's specify an identifier relating to the
concrete problem that was encountered. This is necessary for upcoming
support to be able to demote certain errors to warnings.
In the process, simplify the requirements on the calling code: instead of
having to handle full-blown varargs in every callback, we now send a
string buffer ready to be used by the callback.
We could use a simple enum for the message IDs here, but we want to
guarantee that the enum values are associated with the appropriate
message types (i.e. error or warning?). Besides, we want to introduce a
parser in the next commit that maps the string representation to the
enum value, hence we use the slightly ugly preprocessor construct that
is extensible for use with said parser.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'fsck.h')
-rw-r--r-- | fsck.h | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -17,10 +17,9 @@ struct fsck_options; typedef int (*fsck_walk_func)(struct object *obj, int type, void *data, struct fsck_options *options); /* callback for fsck_object, type is FSCK_ERROR or FSCK_WARN */ -typedef int (*fsck_error)(struct object *obj, int type, const char *err, ...); +typedef int (*fsck_error)(struct object *obj, int type, const char *message); -__attribute__((format (printf, 3, 4))) -int fsck_error_function(struct object *obj, int type, const char *fmt, ...); +int fsck_error_function(struct object *obj, int type, const char *message); struct fsck_options { fsck_walk_func walk; |