-/* $OpenBSD: ifstated.c,v 1.45 2017/06/28 11:10:08 benno Exp $ */
+/* $OpenBSD: ifstated.c,v 1.46 2017/07/02 14:27:30 benno Exp $ */
/*
* Copyright (c) 2004 Marco Pfatschbacher <mpf@openbsd.org>
conf->nextstate = conf->curstate;
conf->curstate = NULL;
while (state_change())
- do_action(conf->curstate->always);
+ do_action(conf->curstate->body);
}
return (0);
}
struct ifsd_external *external = TAILQ_FIRST(&state->external_tests);
if (external == NULL || external->lastexec >= state->entered ||
external->lastexec == 0) {
- do_action(state->always);
+ do_action(state->body);
while (state_change())
- do_action(conf->curstate->always);
+ do_action(conf->curstate->body);
}
}
while ((state = TAILQ_FIRST(&oconf->states)) != NULL) {
TAILQ_REMOVE(&oconf->states, state, entries);
remove_action(state->init, state);
- remove_action(state->always, state);
+ remove_action(state->body, state);
free(state->name);
free(state);
}
remove_action(oconf->always.init, &oconf->always);
- remove_action(oconf->always.always, &oconf->always);
+ remove_action(oconf->always.body, &oconf->always);
free(oconf);
}
-/* $OpenBSD: ifstated.h,v 1.12 2017/06/28 11:10:08 benno Exp $ */
+/* $OpenBSD: ifstated.h,v 1.13 2017/07/02 14:27:30 benno Exp $ */
/*
* Copyright (c) 2004 Ryan McBride
struct ifsd_external_list external_tests;
TAILQ_ENTRY(ifsd_state) entries;
struct ifsd_action *init;
- struct ifsd_action *always;
+ struct ifsd_action *body;
u_int32_t entered;
char *name;
};
-/* $OpenBSD: parse.y,v 1.41 2017/06/18 12:03:47 benno Exp $ */
+/* $OpenBSD: parse.y,v 1.42 2017/07/02 14:27:30 benno Exp $ */
/*
* Copyright (c) 2004 Ryan McBride <mcbride@openbsd.org>
curaction = conf->always.init;
} action_block {
if (curstate != NULL)
- curaction = curstate->always;
+ curaction = curstate->body;
else
- curaction = conf->always.always;
+ curaction = conf->always.body;
}
;
init_state(state);
state->name = $2;
curstate = state;
- curaction = state->always;
+ curaction = state->body;
} optnl '{' optnl stateopts_l '}' {
TAILQ_INSERT_TAIL(&conf->states, curstate, entries);
curstate = NULL;
- curaction = conf->always.always;
+ curaction = conf->always.body;
}
;
TAILQ_INIT(&conf->states);
init_state(&conf->always);
- curaction = conf->always.always;
+ curaction = conf->always.body;
conf->opts = opts;
yyparse();
/* Link states */
TAILQ_FOREACH(state, &conf->states, entries) {
link_states(state->init);
- link_states(state->always);
+ link_states(state->body);
}
errors = file->errors;
state->init->type = IFSD_ACTION_CONDITION;
TAILQ_INIT(&state->init->act.c.actions);
- if ((state->always = calloc(1, sizeof(*state->always))) == NULL)
+ if ((state->body = calloc(1, sizeof(*state->body))) == NULL)
err(1, "init_state: calloc");
- state->always->type = IFSD_ACTION_CONDITION;
- TAILQ_INIT(&state->always->act.c.actions);
+ state->body->type = IFSD_ACTION_CONDITION;
+ TAILQ_INIT(&state->body->act.c.actions);
}
struct ifsd_ifstate *