doveadm-print.h revision ce9619645e0ec302c208690e9f9bc65037c05196
2454dfa32c93c20a8522c6ed42fe057baaac9f9aStephan Bosch#ifndef DOVEADM_PRINT_H
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo Sirainen#define DOVEADM_PRINT_H
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo Sirainen
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo Sirainen#define DOVEADM_PRINT_TYPE_TAB "tab"
82995cc154a929f37aa486a72a6485e9f8d34a30Timo Sirainen#define DOVEADM_PRINT_TYPE_FLOW "flow"
76a99afe0914951d20d96e0bf5e6d8d3ea3fd503Timo Sirainen#define DOVEADM_PRINT_TYPE_TABLE "table"
55639052253ff28c6a0f569ae76dfda33e02c5f2Timo Sirainen
bdd36cfdba3ff66d25570a9ff568d69e1eb543cfTimo Sirainenenum doveadm_print_header_flags {
76a99afe0914951d20d96e0bf5e6d8d3ea3fd503Timo Sirainen DOVEADM_PRINT_HEADER_FLAG_RIGHT_JUSTIFY = 0x01,
596ec384269cad3b0f0661df89b9cf33cbd171b7Timo Sirainen DOVEADM_PRINT_HEADER_FLAG_STICKY = 0x02,
666286d8ecc6c450b2232dcc628f79454215acfcTimo Sirainen DOVEADM_PRINT_HEADER_FLAG_HIDE_TITLE = 0x04,
2521fd0986302cdabc8b0711eef63ac188f32cd6Timo Sirainen DOVEADM_PRINT_HEADER_FLAG_EXPAND = 0x08
b039dabf4c53f72454e795930e7643b6e0e625f9Timo Sirainen};
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo Sirainen
a35cbba04d0a2823da98e693bd09a051addffdb2Timo Sirainenextern const struct doveadm_print_vfuncs *doveadm_print_vfuncs_all[];
fa3fc0b4c821874ccc56a1512604f661b411d3a4Aki Tuomiextern bool doveadm_print_hide_titles;
fa3fc0b4c821874ccc56a1512604f661b411d3a4Aki Tuomi
94e1adead9faddec88a623485b9999a87b1684faTimo Sirainenbool doveadm_print_is_initialized(void);
503e5ef896c7b4a51cf73efb0d132860a8c747e6Timo Sirainen
3ccfcf0856958cb9208a9fc51c3bdf13c58ad52aTimo Sirainenvoid doveadm_print_header(const char *key, const char *title,
cb2b5a7d6e7e651191bf9ee1eda94a6e207288b0Timo Sirainen enum doveadm_print_header_flags flags);
cb2b5a7d6e7e651191bf9ee1eda94a6e207288b0Timo Sirainenvoid doveadm_print_header_simple(const char *key_title);
2521fd0986302cdabc8b0711eef63ac188f32cd6Timo Sirainenvoid doveadm_print(const char *value);
3ccfcf0856958cb9208a9fc51c3bdf13c58ad52aTimo Sirainenvoid doveadm_print_num(uintmax_t value);
55639052253ff28c6a0f569ae76dfda33e02c5f2Timo Sirainen/* Stream for same field continues until len=0 */
55639052253ff28c6a0f569ae76dfda33e02c5f2Timo Sirainenvoid doveadm_print_stream(const void *value, size_t size);
55639052253ff28c6a0f569ae76dfda33e02c5f2Timo Sirainen/* Print the whole input stream. Returns 0 if ok, -1 if stream read() failed */
55639052253ff28c6a0f569ae76dfda33e02c5f2Timo Sirainenint doveadm_print_istream(struct istream *input);
55639052253ff28c6a0f569ae76dfda33e02c5f2Timo Sirainenvoid doveadm_print_sticky(const char *key, const char *value);
3ccfcf0856958cb9208a9fc51c3bdf13c58ad52aTimo Sirainenvoid doveadm_print_flush(void);
3ccfcf0856958cb9208a9fc51c3bdf13c58ad52aTimo Sirainenvoid doveadm_print_unstick_headers(void);
3ccfcf0856958cb9208a9fc51c3bdf13c58ad52aTimo Sirainen
3ccfcf0856958cb9208a9fc51c3bdf13c58ad52aTimo Sirainenvoid doveadm_print_init(const char *name);
3ccfcf0856958cb9208a9fc51c3bdf13c58ad52aTimo Sirainenvoid doveadm_print_deinit(void);
3ccfcf0856958cb9208a9fc51c3bdf13c58ad52aTimo Sirainen
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo Sirainen#endif
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo Sirainen