From f02588f914f6cbcac92af12010c979b41d1dbc45 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Fri, 15 Mar 2019 17:19:28 +0100 Subject: [PATCH] node: add node_prepare() --- include/villas/node_type.h | 2 ++ lib/node.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/include/villas/node_type.h b/include/villas/node_type.h index 64a847bf2..eddf431e3 100644 --- a/include/villas/node_type.h +++ b/include/villas/node_type.h @@ -111,6 +111,8 @@ struct node_type { */ int (*check)(struct node *n); + int (*prepare)(struct node *); + /** Returns a string with a textual represenation of this node. * * @param n A pointer to the node object. diff --git a/lib/node.c b/lib/node.c index d7ceaad24..2850bf77a 100644 --- a/lib/node.c +++ b/lib/node.c @@ -90,6 +90,10 @@ int node_prepare(struct node *n) assert(n->state == STATE_CHECKED); + ret = node_type(n)->prepare ? node_type(n)->prepare(n) : 0; + if (ret) + return ret; + ret = node_direction_prepare(&n->in, n); if (ret) return ret;