ucm: add possibility to keep order of childs for If blocks

Because of the nature of the structured parser, it is not guaranteed
that the order of the parsed tree is equal to the lines in the source.

Add possibility to insert the If results before or after the selected
identifier like:

SectionDevice."Speaker" {
  ...
}

If.1 {
	Condition { ... }
	Before.SectionDevice "Speaker"
	True { ... }
}
If.2 {
	Condition { ... }
	After.SectionDevice "Speaker"
	True { ... }
}

If the "After" or "Before" identifiers are not found, the result is added
after the last entry in the block.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2019-11-14 16:57:22 +01:00
parent 4c021697f1
commit a0b00a954e
2 changed files with 70 additions and 10 deletions

View file

@ -175,7 +175,9 @@ static int evaluate_condition(snd_use_case_mgr_t *uc_mgr,
if (err < 0)
return err;
return uc_mgr_evaluate_condition(uc_mgr, cfg, n);
err = uc_mgr_evaluate_condition(uc_mgr, cfg, n);
snd_config_delete(n);
return err;
}
/*