Example #1
0
static int conf_add_reset(Connection *c, const char *s) {
  const Action *a;

  if(c->nresets == MAX_CONNECTION_RESETS) {
    parse_error(c->name,"too many reset actions",0);
    return -1;
  }

  a = action_find(s);
  if(!a) {
    parse_error(c->name,"no such action",s);
    return -1;
  }

  c->resets[c->nresets++] = a;
  return 0;
}
Example #2
0
static int conf_add_update(Connection *c, const char *s) {
  const Action *a;

  if(c->nupdates == MAX_CONNECTION_UPDATES) {
    parse_error(c->name,"too many update actions",0);
    return -1;
  }

  a = action_find(s);
  if(!a) {
    parse_error(c->name,"no such action",s);
    return -1;
  }

  c->updates[c->nupdates++] = a;
  return 0;
}
Example #3
0
static void
parse_actions(trigger_t *t, mowgli_config_file_entry_t *entry)
{
	mowgli_config_file_entry_t *ce;
	triggeraction_t *ta;

	MOWGLI_ITER_FOREACH(ce, entry)
	{
		action_t *act;

		act = action_find(ce->varname);
		if (act == NULL)
			continue;

		ta = calloc(sizeof(triggeraction_t), 1);
		ta->act = act;
		ta->next = t->list;
		t->list = ta;
	}