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

refactor: struct plugin::io -> struct plugin::format

This commit is contained in:
Steffen Vogel 2018-05-13 13:51:28 +02:00
parent 70b87de26e
commit 9ec69bcbdf
9 changed files with 15 additions and 17 deletions

View file

@ -23,14 +23,13 @@
#pragma once
#include "format_type.h"
#include "hook.h"
#include "api.h"
#include "common.h"
#include "utils.h"
#include "node_type.h"
#include "api.h"
#include "nodes/cbuilder.h"
#include "hook_type.h"
#include "node_type.h"
#include "format_type.h"
/** @todo This is ugly as hell and broken on OS X / Clang anyway. */
#define REGISTER_PLUGIN(p) \
@ -51,7 +50,6 @@ enum plugin_type {
PLUGIN_TYPE_NODE,
PLUGIN_TYPE_API,
PLUGIN_TYPE_FORMAT,
PLUGIN_TYPE_FPGA_IP,
PLUGIN_TYPE_MODEL_CBUILDER
};
@ -69,10 +67,10 @@ struct plugin {
int (*unload)(struct plugin *p);
union {
struct format_type io;
struct api_action api;
struct format_type format;
struct node_type node;
struct hook_type hook;
struct api_action api;
struct cbuilder_model cb;
};
};

View file

@ -34,5 +34,5 @@ struct format_type * format_type_lookup(const char *name)
if (!p)
return NULL;
return &p->io;
return &p->format;
}

View file

@ -182,7 +182,7 @@ static struct plugin p = {
.name = "csv",
.description = "Tabulator-separated values",
.type = PLUGIN_TYPE_FORMAT,
.io = {
.format = {
.sprint = csv_sprint,
.sscan = csv_sscan,
.header = csv_header,

View file

@ -296,7 +296,7 @@ static struct plugin p = {
.name = "json",
.description = "Javascript Object Notation",
.type = PLUGIN_TYPE_FORMAT,
.io = {
.format = {
.scan = json_scan,
.print = json_print,
.sscan = json_sscan,

View file

@ -264,7 +264,7 @@ static struct plugin p = {
.name = "json.reserve",
.description = "RESERVE JSON format",
.type = PLUGIN_TYPE_FORMAT,
.io = {
.format = {
.scan = json_reserve_scan,
.print = json_reserve_print,
.sscan = json_reserve_sscan,

View file

@ -156,7 +156,7 @@ static struct plugin p = {
.name = "protobuf",
.description = "Google Protobuf",
.type = PLUGIN_TYPE_FORMAT,
.io = {
.format = {
.sprint = protobuf_sprint,
.sscan = protobuf_sscan
}

View file

@ -244,7 +244,7 @@ static struct plugin i = { \
.name = n, \
.description = d, \
.type = PLUGIN_TYPE_FORMAT, \
.io = { \
.format = { \
.flags = f | FORMAT_TYPE_BINARY,\
.sprint = raw_sprint, \
.sscan = raw_sscan \

View file

@ -118,7 +118,7 @@ static struct plugin p1 = {
.name = "villas.binary",
.description = "VILLAS binary network format",
.type = PLUGIN_TYPE_FORMAT,
.io = {
.format = {
.sprint = villas_binary_sprint,
.sscan = villas_binary_sscan,
.size = 0,
@ -131,7 +131,7 @@ static struct plugin p2 = {
.name = "villas.web",
.description = "VILLAS binary network format for WebSockets",
.type = PLUGIN_TYPE_FORMAT,
.io = {
.format = {
.sprint = villas_binary_sprint,
.sscan = villas_binary_sscan,
.size = 0,

View file

@ -213,7 +213,7 @@ static struct plugin p = {
.name = "villas.human",
.description = "VILLAS human readable format",
.type = PLUGIN_TYPE_FORMAT,
.io = {
.format = {
.sprint = villas_human_sprint,
.sscan = villas_human_sscan,
.header = villas_human_header,