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

io: align header / source files

This commit is contained in:
Steffen Vogel 2018-05-12 18:11:39 +02:00
parent 8b18bd35e0
commit 63e839afc9
8 changed files with 24 additions and 30 deletions

View file

@ -30,6 +30,7 @@ struct sample;
#define CSV_SEPARATOR '\t'
int csv_fprint(FILE *f, struct sample *smps[], unsigned cnt, int flags);
void csv_header(struct io *io);
int csv_fscan(FILE *f, struct sample *smps[], unsigned cnt, int flags);
int csv_sscan(struct io *io, char *buf, size_t len, size_t *rbytes, struct sample *smps[], unsigned cnt);
int csv_sprint(struct io *io, char *buf, size_t len, size_t *rbytes, struct sample *smps[], unsigned cnt);

View file

@ -26,12 +26,10 @@
/* Forward declarations */
struct sample;
struct io;
typedef int (*json_pack_cb_t)(json_t **j, struct sample *smp, int flags);
typedef int (*json_unpack_cb_t)(json_t *j, struct sample *s, int flags);
int json_reserve_sprint(struct io *io, char *buf, size_t len, size_t *wbytes, struct sample *smps[], unsigned cnt);
int json_reserve_sscan(struct io *io, char *buf, size_t len, size_t *rbytes, struct sample *smps[], unsigned cnt);
int json_reserve_pack_sample(json_t **j, struct sample *s, int flags);
int json_reserve_unpack_sample(json_t *j, struct sample *s, int flags);
int json_reserve_fprint(FILE *f, struct sample *smps[], unsigned cnt, int flags);
int json_reserve_fscan(FILE *f, struct sample *smps[], unsigned cnt, int flags);
int json_reserve_print(struct io *io, struct sample *smps[], unsigned cnt);
int json_reserve_scan(struct io *io, struct sample *smps[], unsigned cnt);

View file

@ -27,10 +27,8 @@
/* Forward declarations */
struct sample;
int json_pack_sample(struct io *io, json_t **j, struct sample *s);
int json_sprint(struct io *io, char *buf, size_t len, size_t *wbytes, struct sample *smps[], unsigned cnt);
int json_sscan(struct io *io, char *buf, size_t len, size_t *wbytes, struct sample *smps[], unsigned cnt);
int json_unpack_sample(struct io *io, json_t *j, struct sample *s);
int json_fprint(struct io *io, FILE *f, struct sample *smps[], unsigned cnt);
int json_fscan(struct io *io, FILE *f, struct sample *smps[], unsigned cnt);
int json_print(struct io *io, struct sample *smps[], unsigned cnt);
int json_scan(struct io *io, struct sample *smps[], unsigned cnt);

View file

@ -29,10 +29,7 @@
struct io;
struct sample;
void villas_human_header(struct io *io);
int villas_human_print(struct io *io, struct sample *smps[], unsigned cnt);
int villas_human_scan(struct io *io, struct sample *smps[], unsigned cnt);
int villas_human_fprint(FILE *f, struct sample *smps[], unsigned cnt, int flags);
int villas_human_fscan(FILE *f, struct sample *smps[], unsigned cnt, int flags);

View file

@ -31,7 +31,7 @@
#include <villas/signal.h>
#include <villas/timing.h>
size_t csv_sprint_single(struct io *io, char *buf, size_t len, struct sample *s)
static size_t csv_sprint_single(struct io *io, char *buf, size_t len, struct sample *s)
{
size_t off = 0;
@ -66,7 +66,7 @@ size_t csv_sprint_single(struct io *io, char *buf, size_t len, struct sample *s)
return off;
}
size_t csv_sscan_single(struct io *io, const char *buf, size_t len, struct sample *s)
static size_t csv_sscan_single(struct io *io, const char *buf, size_t len, struct sample *s)
{
const char *ptr = buf;
char *end;

View file

@ -69,7 +69,7 @@ static int json_unpack_timestamps(json_t *json_ts, struct sample *smp)
return 0;
}
int json_pack_sample(struct io *io, json_t **j, struct sample *smp)
static int json_pack_sample(struct io *io, json_t **j, struct sample *smp)
{
json_t *json_smp;
json_error_t err;
@ -101,7 +101,7 @@ int json_pack_sample(struct io *io, json_t **j, struct sample *smp)
return 0;
}
int json_pack_samples(struct io *io, json_t **j, struct sample *smps[], unsigned cnt)
static int json_pack_samples(struct io *io, json_t **j, struct sample *smps[], unsigned cnt)
{
int ret;
json_t *json_smps = json_array();
@ -121,7 +121,7 @@ int json_pack_samples(struct io *io, json_t **j, struct sample *smps[], unsigned
return cnt;
}
int json_unpack_sample(struct io *io, json_t *json_smp, struct sample *smp)
static int json_unpack_sample(struct io *io, json_t *json_smp, struct sample *smp)
{
int ret;
json_error_t err;
@ -181,7 +181,7 @@ int json_unpack_sample(struct io *io, json_t *json_smp, struct sample *smp)
return 0;
}
int json_unpack_samples(struct io *io, json_t *json_smps, struct sample *smps[], unsigned cnt)
static int json_unpack_samples(struct io *io, json_t *json_smps, struct sample *smps[], unsigned cnt)
{
int ret;
json_t *json_smp;

View file

@ -29,7 +29,7 @@
#include <villas/io.h>
#include <villas/formats/json.h>
int json_reserve_pack_sample(struct io *io, json_t **j, struct sample *smp)
static int json_reserve_pack_sample(struct io *io, json_t **j, struct sample *smp)
{
json_error_t err;
json_t *json_data, *json_name, *json_unit, *json_value;
@ -95,7 +95,7 @@ int json_reserve_pack_sample(struct io *io, json_t **j, struct sample *smp)
return 0;
}
int json_reserve_unpack_sample(struct io *io, json_t *json_smp, struct sample *smp)
static int json_reserve_unpack_sample(struct io *io, json_t *json_smp, struct sample *smp)
{
int ret, idx;
double created = -1;

View file

@ -32,7 +32,7 @@
#include <villas/signal.h>
#include <villas/formats/villas_human.h>
size_t villas_human_sprint_single(struct io *io, char *buf, size_t len, struct sample *s)
static size_t villas_human_sprint_single(struct io *io, char *buf, size_t len, struct sample *s)
{
size_t off = 0;
@ -65,7 +65,7 @@ size_t villas_human_sprint_single(struct io *io, char *buf, size_t len, struct s
return off;
}
size_t villas_human_sscan_single(struct io *io, const char *buf, size_t len, struct sample *s)
static size_t villas_human_sscan_single(struct io *io, const char *buf, size_t len, struct sample *s)
{
char *end;
const char *ptr = buf;