Commit Graph

9 Commits

Author SHA1 Message Date
Benjamin Larsson
f024da0640 Merge pull request #217 from tazounet/master
Update 2 drivers to new output format
2015-12-05 00:57:05 +01:00
tazounet
7b4afd8e1c Convert from GNU to C99 syntax 2015-12-02 22:52:47 +01:00
Erkki Seppälä
85ba904320 data: fixed the filtering of CSV fields
Previously the code missed the critical part actually filtering the
duplicate CSV column names. Now this is addressed by keeping a use count
for each csv label, and allowing only unused entries go through.

In addition, there was an issue of overwriting the variable/argument
num_fields, resulting in too few columns being handled. This is now
fixed by using the variable num_unique_fields to store the number of,
well, unique fields, and still keeping access to the original variable
num_fields to allwo iterating through -all- the original arguments.

Signed-off-by: Erkki Seppälä <flux@modeemi.fi>
2015-12-01 23:06:20 +02:00
Erkki Seppälä
a3f7561a61 data: added CSV support
This requires the client code to first collect the permitted CSV fields
and use data_csv_init to pass them to the CSV builder.
2015-11-23 23:47:54 +02:00
Erkki Seppälä
4bc6d05186 data: only format key-value-format, not JSON 2015-11-23 23:47:54 +02:00
Erkki Seppälä
06c4d39c4a data: introduce auxiliary data as an argument 2015-11-23 23:47:54 +02:00
Erkki Seppälä
c7673f7cee data: added formatting support 2015-11-23 23:47:54 +02:00
Erkki Seppälä
17eb918cde data: provide a key-value-printer 2015-11-23 23:47:54 +02:00
Erkki Seppälä
44d0740a8c General structural data support for generating (ie.) JSON
Adds a new interface for constructing, printing and releasing data_t*
structures. The data structure describes typed hierarchical data (much like
json) and then provides a function for dumping it to a file descriptor.

It comes with a small test.
2015-11-22 12:25:58 +02:00