From 52fc319d4dfdbf67fe298908d8519be271ca4eb4 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Mon, 24 Jul 2017 10:22:43 +0200 Subject: trailers: export action enums and corresponding lookup functions Separate the mechanical changes out of the next patch. The functions are changed to take a pointer to enum, because struct conf_info is not going to be public. Set the default values explicitly in default_conf_info, since they are not anymore close to default_conf_info and it's not obvious which constant has value 0. With the next patches, in fact, the values will not be zero anymore! Signed-off-by: Paolo Bonzini Signed-off-by: Junio C Hamano --- trailer.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'trailer.h') diff --git a/trailer.h b/trailer.h index 65cc5d79c6..2b39a1bee0 100644 --- a/trailer.h +++ b/trailer.h @@ -1,6 +1,28 @@ #ifndef TRAILER_H #define TRAILER_H +enum trailer_where { + WHERE_END, + WHERE_AFTER, + WHERE_BEFORE, + WHERE_START +}; +enum trailer_if_exists { + EXISTS_ADD_IF_DIFFERENT_NEIGHBOR, + EXISTS_ADD_IF_DIFFERENT, + EXISTS_ADD, + EXISTS_REPLACE, + EXISTS_DO_NOTHING +}; +enum trailer_if_missing { + MISSING_ADD, + MISSING_DO_NOTHING +}; + +int trailer_set_where(enum trailer_where *item, const char *value); +int trailer_set_if_exists(enum trailer_if_exists *item, const char *value); +int trailer_set_if_missing(enum trailer_if_missing *item, const char *value); + struct trailer_info { /* * True if there is a blank line before the location pointed to by -- cgit v1.2.3