const char *gnuplot_header = "\
# Sample data in space-separated columns format usable by gnuplot\n\
#\n\
-# Generated by: %s on %s\n%s\
+# Generated by: %s on %s%s\
# Timescale: %d %s\n\
# Column assignment:\n%s\n";
int b, num_probes;
char *c, *samplerate_s;
char wbuf[1000], comment[128];
+ time_t t;
if (!(ctx = calloc(1, sizeof(struct context))))
return SIGROK_ERR_MALLOC;
/* TODO: date: File or signals? Make y/n configurable. */
/* TODO: Timescale */
+ t = time(NULL);
b = snprintf(ctx->header, MAX_HEADER_LEN, gnuplot_header,
- PACKAGE_STRING, "TODO", comment, 1, "ns", (char *)&wbuf);
+ PACKAGE_STRING, ctime(&t), comment, 1, "ns",
+ (char *)&wbuf);
/* TODO: Handle snprintf errors. */
};
const char *vcd_header = "\
-$date\n %s\n$end\n\
+$date\n %s$end\n\
$version\n %s\n$end\n%s\
$timescale\n %i %s\n$end\n\
$scope module %s $end\n\
int i, b, num_probes;
char *c, *samplerate_s;
char wbuf[1000], comment[128];
+ time_t t;
if (!(ctx = calloc(1, sizeof(struct context))))
return SIGROK_ERR_MALLOC;
}
/* TODO: Date: File or signals? Make y/n configurable. */
- b = snprintf(ctx->header, MAX_HEADER_LEN, vcd_header, "TODO: Date",
+ t = time(NULL);
+ b = snprintf(ctx->header, MAX_HEADER_LEN, vcd_header, ctime(&t),
PACKAGE_STRING, comment, 1, "ns", PACKAGE, (char *)&wbuf);
/* TODO: Handle snprintf() errors. */