rule.c
// execute a ruleset on open windows
execute a ruleset on open windows
execute a ruleset on open windows
void ruleset_execute(char *name)
{
	winruleset *set = NULL;
	for (set = config_rulesets; set && strcasecmp(name, set->name); set = set->next);
	if (set && set->rules)
	{
		winrule *rule = set->rules;
		while (rule->next) rule = rule->next;
		while (rule)
		{
			rule_apply(rule);
			winrule *prev = set->rules;
			while (prev && prev->next != rule) prev = prev->next;
			rule = prev;
		}
	}
}
void ruleset_execute ( char * name ) { winruleset * set = NULL ; for ( set = config_rulesets ; set && strcasecmp ( name , set -> name ) ; set = set -> next ) ; if ( set && set -> rules ) { winrule * rule = set -> rules ; while ( rule -> next ) rule = rule -> next ; while ( rule ) { rule_apply ( rule ) ; winrule * prev = set -> rules ; while ( prev && prev -> next != rule ) prev = prev -> next ; rule = prev ; } } }
execute a ruleset on open windows
execute a ruleset on open windows
// find ruleset by index // bit odd. rules lists are lifos present, but it's more intuitive to process // rulesets in the order they were defined. should clean this up, but for now, // labouriously walk the list backwards