int no_overwrite,
int argc,
const char **argv)
+{
+ return rrdc_create_r2(filename, pdp_step, last_up, no_overwrite, NULL, argc, argv);
+}
+
+int rrdc_create_r2(const char *filename, /* {{{ */
+ unsigned long pdp_step,
+ time_t last_up,
+ int no_overwrite,
+ const char **sources,
+ int argc,
+ const char **argv)
{
char buffer[RRD_CMD_MAX];
char *buffer_ptr;
if(no_overwrite) {
status = buffer_add_string ("-O", &buffer_ptr, &buffer_free);
}
+
+ if (sources != NULL) {
+ for (const char **p = sources ; *p ; p++) {
+ buffer_add_string ("-r", &buffer_ptr, &buffer_free);
+ buffer_add_string (*p, &buffer_ptr, &buffer_free);
+ }
+ }
+
if (status != 0)
{
mutex_unlock (&lock);
int argc,
const char **argv);
+int rrdc_create_r2 (const char *filename,
+ unsigned long pdp_step,
+ time_t last_up,
+ int no_overwrite,
+ const char **sources,
+ int argc,
+ const char **argv);
int rrdc_flush (const char *filename);
int rrdc_forget (const char *filename);
}
rrdc_connect (opt_daemon);
if (rrdc_is_connected (opt_daemon)) {
- rc = rrdc_create (argv[optind],
- pdp_step, last_up, opt_no_overwrite,
+ rc = rrdc_create_r2(argv[optind],
+ pdp_step, last_up, opt_no_overwrite,
+ sources_array,
argc - optind - 1, (const char **) (argv + optind + 1));
} else {
rc = rrd_create_r2(argv[optind],