summaryrefslogtreecommitdiff
path: root/trailer.h
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2017-07-24 10:22:43 +0200
committerJunio C Hamano <gitster@pobox.com>2017-07-25 11:42:08 -0700
commit52fc319d4dfdbf67fe298908d8519be271ca4eb4 (patch)
tree5a034da724c313192e918040e168c3af69404b72 /trailer.h
parent5800c63717ae35286a1441f14ffff753e01f7e2b (diff)
downloadgit-52fc319d4dfdbf67fe298908d8519be271ca4eb4.tar.gz
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 <pbonzini@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'trailer.h')
-rw-r--r--trailer.h22
1 files changed, 22 insertions, 0 deletions
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