abidw: Consolidate setting options
authorMatthias Maennich <maennich@google.com>
Tue, 21 May 2019 04:39:19 +0000 (05:39 +0100)
committerDodji Seketeli <dodji@redhat.com>
Wed, 22 May 2019 12:33:45 +0000 (14:33 +0200)
commit344138e6b4d218f7ef09caa97648a6ead58ccf9d
tree0f4a6e7abc8392b4bda8d331652d8d9b39dd5508
parent6c07e829335060e434804fb7d7353cd64aac70a2
abidw: Consolidate setting options

When setting options meant to be used for the write_context, it is easy
to forget to change all relavant locations. In order to consolidate
that, introduce a set_opts function that sets various known options.

We benefit from earlier refactoring as now the write_context is passed
around to carry options for writers. Hence we can be sure, that if we
set up the context correctly (and do not use deprecated functionality),
the respective write_* function will see the options set in the context.

* include/abg-writer.h (set_common_option): Declare new function.
* tools/abidw.cc (load_corpus_and_write_abixml)
(load_kernel_corpus_group_and_write_abixml): Use the newly
introduced set_common_option.

Signed-off-by: Matthias Maennich <maennich@google.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
include/abg-writer.h
tools/abidw.cc