diff --git a/include/villas/plugin.h b/include/villas/plugin.h index ed6bb7e2b..6a58b2d57 100644 --- a/include/villas/plugin.h +++ b/include/villas/plugin.h @@ -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; }; }; diff --git a/lib/format_type.c b/lib/format_type.c index 28e2bf603..b86a3cda0 100644 --- a/lib/format_type.c +++ b/lib/format_type.c @@ -34,5 +34,5 @@ struct format_type * format_type_lookup(const char *name) if (!p) return NULL; - return &p->io; + return &p->format; } diff --git a/lib/formats/csv.c b/lib/formats/csv.c index c6466a68f..1d3ffe145 100644 --- a/lib/formats/csv.c +++ b/lib/formats/csv.c @@ -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, diff --git a/lib/formats/json.c b/lib/formats/json.c index 4ce2d6927..ff4b116fe 100644 --- a/lib/formats/json.c +++ b/lib/formats/json.c @@ -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, diff --git a/lib/formats/json_reserve.c b/lib/formats/json_reserve.c index 1c18270b0..1a3342619 100644 --- a/lib/formats/json_reserve.c +++ b/lib/formats/json_reserve.c @@ -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, diff --git a/lib/formats/protobuf.c b/lib/formats/protobuf.c index 1d6cb2de8..f5bb2a1b0 100644 --- a/lib/formats/protobuf.c +++ b/lib/formats/protobuf.c @@ -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 } diff --git a/lib/formats/raw.c b/lib/formats/raw.c index d2572adc5..7e023692d 100644 --- a/lib/formats/raw.c +++ b/lib/formats/raw.c @@ -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 \ diff --git a/lib/formats/villas_binary.c b/lib/formats/villas_binary.c index 8d7f6014d..ec7dbe501 100644 --- a/lib/formats/villas_binary.c +++ b/lib/formats/villas_binary.c @@ -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, diff --git a/lib/formats/villas_human.c b/lib/formats/villas_human.c index e4d79c602..941424a42 100644 --- a/lib/formats/villas_human.c +++ b/lib/formats/villas_human.c @@ -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,