Additional "node status" output

This commit is contained in:
Ian Barwick
2017-08-10 17:18:08 +09:00
parent 4f2161bd83
commit 8a50a72dc5
6 changed files with 132 additions and 16 deletions

View File

@@ -19,6 +19,14 @@
#define MAXLEN_STR STR(MAXLEN)
typedef enum {
OM_NOT_SET = -1,
OM_TEXT,
OM_CSV,
OM_NAGIOS,
OM_OPTFORMAT
} OutputMode;
typedef struct ItemListCell
{
struct ItemListCell *next;
@@ -36,6 +44,7 @@ typedef struct KeyValueListCell
struct KeyValueListCell *next;
char *key;
char *value;
OutputMode output_mode;
} KeyValueListCell;
typedef struct KeyValueList
@@ -67,6 +76,9 @@ extern void
key_value_list_set_format(KeyValueList *item_list, const char *key, const char *value, ...)
__attribute__((format(PG_PRINTF_ATTRIBUTE, 3, 4)));
extern void
key_value_list_set_output_mode(KeyValueList *item_list, const char *key, OutputMode mode);
extern const char *
key_value_list_get(KeyValueList *item_list, const char *key);