]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm: Add doveadm_print_get_headers_count()
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 4 Jul 2018 13:16:36 +0000 (16:16 +0300)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Tue, 10 Sep 2019 07:01:24 +0000 (10:01 +0300)
Returns the number of headers added to printer.

src/doveadm/doveadm-print.c
src/doveadm/doveadm-print.h

index 8af38b53ab4da9d4e2298af4397f1c76f1300c86..7cc7a59107c5d229524a1e01995a511713720d5c 100644 (file)
@@ -55,6 +55,11 @@ void doveadm_print_header_simple(const char *key_title)
        doveadm_print_header(key_title, key_title, 0);
 }
 
+unsigned int doveadm_print_get_headers_count(void)
+{
+       return array_count(&ctx->headers);
+}
+
 static void doveadm_print_sticky_headers(void)
 {
        const struct doveadm_print_header_context *headers;
index cf99aaca875d41c457d6f5fb6b141e85df31b37b..2585ed48afff2659034ba0cfe60e06cdcf3d8de5 100644 (file)
@@ -27,6 +27,8 @@ bool doveadm_print_is_initialized(void);
 void doveadm_print_header(const char *key, const char *title,
                          enum doveadm_print_header_flags flags);
 void doveadm_print_header_simple(const char *key_title);
+unsigned int doveadm_print_get_headers_count(void);
+
 void doveadm_print(const char *value);
 void doveadm_print_num(uintmax_t value);
 /* Stream for same field continues until len=0 */