1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

csv: add new sub-format for tabulator separated values

This commit is contained in:
Steffen Vogel 2018-05-24 10:45:52 +02:00
parent 607342eddc
commit e3e85aa183

View file

@ -178,8 +178,8 @@ void csv_header(struct io *io)
fprintf(f, "%c", io->delimiter);
}
static struct plugin p = {
.name = "csv",
static struct plugin p1 = {
.name = "tsv",
.description = "Tabulator-separated values",
.type = PLUGIN_TYPE_FORMAT,
.format = {
@ -187,8 +187,24 @@ static struct plugin p = {
.sscan = csv_sscan,
.header = csv_header,
.size = 0,
.flags = IO_NEWLINES
.flags = IO_NEWLINES,
.separator = '\t'
}
};
REGISTER_PLUGIN(&p);
static struct plugin p2 = {
.name = "csv",
.description = "Comma-separated values",
.type = PLUGIN_TYPE_FORMAT,
.format = {
.sprint = csv_sprint,
.sscan = csv_sscan,
.header = csv_header,
.size = 0,
.flags = IO_NEWLINES,
.separator = ','
}
};
REGISTER_PLUGIN(&p1);
REGISTER_PLUGIN(&p2);