Introduce output_primary_name function

Currently simply returns output->name, but this will make it easier to
change how output names are stored in the following commits.

Also replace reading output->name with invocations of
output_primary_name. Code which writes output->name is unchanged. Done
using a mostly mechanical replacement of output->name to
output_primary_name(output).
This commit is contained in:
Vladimir Panteleev
2017-09-09 07:18:29 +00:00
parent 0f2bce3916
commit 30b1ab38b3
12 changed files with 44 additions and 30 deletions

View File

@ -687,7 +687,7 @@ int main(int argc, char *argv[]) {
TAILQ_FOREACH(con, &(croot->nodes_head), nodes) {
Output *output;
TAILQ_FOREACH(output, &outputs, outputs) {
if (output->active || strcmp(con->name, output->name) != 0)
if (output->active || strcmp(con->name, output_primary_name(output)) != 0)
continue;
/* This will correctly correlate the output with its content