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

@@ -8,6 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include "repmgr.h"
#include "log.h"
#include "strutil.h"
@@ -152,6 +153,7 @@ key_value_list_set_format(KeyValueList *item_list, const char *key, const char *
cell->key = pg_malloc0(keylen + 1);
cell->value = pg_malloc0(MAXLEN);
cell->output_mode = OM_NOT_SET;
strncpy(cell->key, key, keylen);
@@ -171,6 +173,18 @@ key_value_list_set_format(KeyValueList *item_list, const char *key, const char *
}
void
key_value_list_set_output_mode (KeyValueList *item_list, const char *key, OutputMode mode)
{
KeyValueListCell *cell;
for (cell = item_list->head; cell; cell = cell->next)
{
if (strncmp(key, cell->key, MAXLEN) == 0)
cell->output_mode = mode;
}
}
const char *
key_value_list_get(KeyValueList *item_list, const char *key)
{