1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-30 00:00:11 +01:00
VILLASnode/include/villas/json.h

25 lines
778 B
C

/** JSON serializtion of various objects.
*
* @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
* @copyright 2017, Institute for Automation of Complex Power Systems, EONERC
*********************************************************************************/
#pragma once
#include <jansson.h>
#include <libconfig.h>
#include "sample.h"
/* Convert a libconfig object to a libjansson object */
json_t * config_to_json(config_setting_t *cfg);
int json_to_config(json_t *json, config_setting_t *parent);
int sample_io_json_pack(json_t **j, struct sample *s, int flags);
int sample_io_json_unpack(json_t *j, struct sample *s, int *flags);
int sample_io_json_fprint(FILE *f, struct sample *s, int flags);
int sample_io_json_fscan(FILE *f, struct sample *s, int *flags);