mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
refactor: _init2() -> _prepare()
This commit is contained in:
parent
c4651cf56f
commit
78bcb67245
8 changed files with 12 additions and 12 deletions
|
@ -103,7 +103,7 @@ struct node {
|
|||
int node_init(struct node *n, struct node_type *vt);
|
||||
|
||||
/** Do initialization after parsing the configuration */
|
||||
int node_init2(struct node *n);
|
||||
int node_prepare(struct node *n);
|
||||
|
||||
/** Parse settings of a node.
|
||||
*
|
||||
|
|
|
@ -112,7 +112,7 @@ struct path {
|
|||
/** Initialize internal data structures. */
|
||||
int path_init(struct path *p);
|
||||
|
||||
int path_init2(struct path *p);
|
||||
int path_prepare(struct path *p);
|
||||
|
||||
/** Check if path configuration is proper. */
|
||||
int path_check(struct path *p);
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
#include <villas/kernel/tc_netem.h>
|
||||
#endif /* WITH_NETEM */
|
||||
|
||||
static int node_direction_init2(struct node_direction *nd, struct node *n)
|
||||
int node_direction_prepare(struct node_direction *nd, struct node *n)
|
||||
{
|
||||
#ifdef WITH_HOOKS
|
||||
int ret;
|
||||
|
@ -254,17 +254,17 @@ int node_init(struct node *n, struct node_type *vt)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int node_init2(struct node *n)
|
||||
int node_prepare(struct node *n)
|
||||
{
|
||||
int ret;
|
||||
|
||||
assert(n->state == STATE_CHECKED);
|
||||
|
||||
ret = node_direction_init2(&n->in, n);
|
||||
ret = node_direction_prepare(&n->in, n);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = node_direction_init2(&n->out, n);
|
||||
ret = node_direction_prepare(&n->in, n);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
|
|
@ -404,7 +404,7 @@ int path_init_poll(struct path *p)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int path_init2(struct path *p)
|
||||
int path_prepare(struct path *p)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
|
|
@ -356,7 +356,7 @@ void SuperNode::startNodes()
|
|||
for (size_t i = 0; i < vlist_length(&nodes); i++) {
|
||||
auto *n = (struct node *) vlist_at(&nodes, i);
|
||||
|
||||
ret = node_init2(n);
|
||||
ret = node_prepare(n);
|
||||
if (ret)
|
||||
throw RuntimeError("Failed to prepare node: {}", node_name(n));
|
||||
|
||||
|
@ -379,7 +379,7 @@ void SuperNode::startPaths()
|
|||
auto *p = (struct path *) vlist_at(&paths, i);
|
||||
|
||||
if (p->enabled) {
|
||||
ret = path_init2(p);
|
||||
ret = path_prepare(p);
|
||||
if (ret)
|
||||
throw RuntimeError("Failed to prepare path: {}", path_name(p));
|
||||
|
||||
|
|
|
@ -395,7 +395,7 @@ check: if (optarg == endptr)
|
|||
if (ret)
|
||||
throw RuntimeError("Invalid node configuration");
|
||||
|
||||
ret = node_init2(node);
|
||||
ret = node_prepare(node);
|
||||
if (ret)
|
||||
throw RuntimeError("Failed to start node {}: reason={}", node_name(node), ret);
|
||||
|
||||
|
|
|
@ -237,7 +237,7 @@ int main(int argc, char *argv[])
|
|||
if (ret)
|
||||
throw RuntimeError("Failed to initialize pool");
|
||||
|
||||
ret = node_init2(&n);
|
||||
ret = node_prepare(&n);
|
||||
if (ret)
|
||||
throw RuntimeError("Failed to start node {}: reason={}", node_name(&n), ret);
|
||||
|
||||
|
|
|
@ -167,7 +167,7 @@ check: if (optarg == endptr)
|
|||
if (ret)
|
||||
throw RuntimeError("Failed to start node-type {}: reason={}", node_type_name(node->_vt), ret);
|
||||
|
||||
ret = node_init2(node);
|
||||
ret = node_prepare(node);
|
||||
if (ret)
|
||||
throw RuntimeError("Failed to start node {}: reason={}", node_name(node), ret);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue