]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: Make mail_cache_decision_to_string() public
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 12 May 2020 08:20:57 +0000 (11:20 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Tue, 12 May 2020 17:08:40 +0000 (17:08 +0000)
src/lib-index/mail-cache-decisions.c
src/lib-index/mail-cache-private.h
src/lib-index/mail-cache-purge.c

index 5e8d3103dcb114472154419b2f4693a283a3ed81..28d571356a603548165e48a4a964cd5d02b16b26 100644 (file)
 #include "ioloop.h"
 #include "mail-cache-private.h"
 
+const char *mail_cache_decision_to_string(enum mail_cache_decision_type dec)
+{
+       switch (dec & ~MAIL_CACHE_DECISION_FORCED) {
+       case MAIL_CACHE_DECISION_NO:
+               return "no";
+       case MAIL_CACHE_DECISION_TEMP:
+               return "temp";
+       case MAIL_CACHE_DECISION_YES:
+               return "yes";
+       }
+       i_unreached();
+}
+
 struct event_passthrough *
 mail_cache_decision_changed_event(struct mail_cache *cache, struct event *event,
                                  unsigned int field)
index e5cf62af30fe8aa8249df8b4478871e378cf1d3d..54d3fb8bfe2165eee23b1befa7a63cfa729f7291 100644 (file)
@@ -271,6 +271,7 @@ int mail_cache_sync_reset_id(struct mail_cache *cache);
    in the cache file. */
 void mail_cache_decision_state_update(struct mail_cache_view *view,
                                      uint32_t seq, unsigned int field);
+const char *mail_cache_decision_to_string(enum mail_cache_decision_type dec);
 struct event_passthrough *
 mail_cache_decision_changed_event(struct mail_cache *cache, struct event *event,
                                  unsigned int field);
index 69cafefe80c2d819b311f85214030523cf886860..b141c4e8bfe585d70ce1c7ea094904c3af837ef9 100644 (file)
@@ -26,19 +26,6 @@ struct mail_cache_copy_context {
        bool new_msg;
 };
 
-static const char *cache_decision_str(enum mail_cache_decision_type dec)
-{
-       switch (dec & ~MAIL_CACHE_DECISION_FORCED) {
-       case MAIL_CACHE_DECISION_NO:
-               return "no";
-       case MAIL_CACHE_DECISION_TEMP:
-               return "temp";
-       case MAIL_CACHE_DECISION_YES:
-               return "yes";
-       }
-       i_unreached();
-}
-
 static void
 mail_cache_merge_bitmask(struct mail_cache_copy_context *ctx,
                         const struct mail_cache_iterate_field *field)
@@ -176,7 +163,7 @@ mail_cache_purge_check_field(struct mail_cache_copy_context *ctx,
                 priv->field.last_used < ctx->max_temp_drop_time) {
                /* YES or TEMP decision field hasn't been accessed for a long
                   time now. Drop it. */
-               const char *dec_str = cache_decision_str(dec);
+               const char *dec_str = mail_cache_decision_to_string(dec);
                struct event_passthrough *e =
                        event_create_passthrough(ctx->event)->
                        set_name("mail_cache_purge_drop_field")->