+info_t *rrd_update_v(int argc, char **argv)
+{
+ char *template = NULL;
+ info_t *result = NULL;
+ infoval rc;
+
+ while (1) {
+ static struct option long_options[] =
+ {
+ {"template", required_argument, 0, 't'},
+ {0,0,0,0}
+ };
+ int option_index = 0;
+ int opt;
+ opt = getopt_long(argc, argv, "t:",
+ long_options, &option_index);
+
+ if (opt == EOF)
+ break;
+
+ switch(opt) {
+ case 't':
+ template = optarg;
+ break;
+
+ case '?':
+ rrd_set_error("unknown option '%s'",argv[optind-1]);
+ rc.u_int = -1;
+ goto end_tag;
+ }
+ }
+
+ /* need at least 2 arguments: filename, data. */
+ if (argc-optind < 2) {
+ rrd_set_error("Not enough arguments");
+ rc.u_int = -1;
+ goto end_tag;
+ }
+ result = info_push(NULL,sprintf_alloc("return_value"),RD_I_INT,rc);
+ rc.u_int = _rrd_update(argv[optind], template,
+ argc - optind - 1, argv + optind + 1, result);
+ result->value.u_int = rc.u_int;
+end_tag:
+ return result;
+}
+