abg-writer: Refactor write_translation_unit API
authorMatthias Maennich <maennich@google.com>
Tue, 21 May 2019 04:39:15 +0000 (05:39 +0100)
committerDodji Seketeli <dodji@redhat.com>
Wed, 22 May 2019 12:33:45 +0000 (14:33 +0200)
commitf5907c7e7417b6cb34c71790650feed7d5a7139f
tree94f86b705ff215198d02c8aaeb2412b91d66f774
parentb0f123c18ec3b4055ad6de19989f94e365484594
abg-writer: Refactor write_translation_unit API

Introduce a new overload for write_translation_unit that follows the
parameter order context, object (i.e. translation unit), indent.

Deprecate all other overloads that were part of the API and mostly
forward them to the new one. That effort is made to ensure write_context
is always provided. write_context allows access to all options that
influence the output format.

* include/abg-writer.h (write_translation_unit): Declare a new
overload write_translation_unit(ctxt, tu, indent) and deprecate
all others.
* src/abg-writer.cc (write_translation_unit): Likewise in the
definitions.
(write_corpus, dump, write_translation_unit): Adjust.
* tools/abilint.cc (main): use new write_translation_unit() API

Signed-off-by: Matthias Maennich <maennich@google.com>
include/abg-writer.h
src/abg-writer.cc
tools/abilint.cc