command parser: Add a vector-based interface.
[collectd.git] / src / tokyotyrant.c
index b618ae3..154215f 100644 (file)
  **/
 
 #include "collectd.h"
+
 #include "plugin.h"
 #include "common.h"
 #include "utils_cache.h"
-#include "utils_parse_option.h"
 
 #include <tcrdb.h>
 
@@ -86,15 +86,12 @@ static void printerr (void)
                        ecode, tcrdberrmsg(ecode));
 }
 
-static void tt_submit (gauge_t val, const char* type)
+static void tt_submit (gauge_t value, const char* type)
 {
-       value_t values[1];
        value_list_t vl = VALUE_LIST_INIT;
 
-       values[0].gauge = val;
-
-       vl.values = values;
-       vl.values_len = STATIC_ARRAY_SIZE (values);
+       vl.values = &(value_t) { .gauge = value };
+       vl.values_len = 1;
 
        sstrncpy (vl.host, config_host, sizeof (vl.host));
        sstrncpy (vl.plugin, "tokyotyrant", sizeof (vl.plugin));
@@ -107,8 +104,8 @@ static void tt_submit (gauge_t val, const char* type)
 
 static void tt_open_db (void)
 {
-       char* host = NULL;
-       int   port = DEFAULT_PORT;
+       const char *host;
+       int         port = DEFAULT_PORT;
 
        if (rdb != NULL)
                return;