1 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2 // -*- Mode: C++ -*-
3 //
4 // Copyright (C) 2013-2020 Red Hat, Inc.
5 
6 /// @file
7 
8 #include "abg-internal.h"
9 // <headers defining libabigail's API go under here>
10 ABG_BEGIN_EXPORT_DECLARATIONS
11 
12 #include "abg-config.h"
13 #include "abg-version.h"
14 
15 ABG_END_EXPORT_DECLARATIONS
16 // </headers defining libabigail's API>
17 
18 namespace abigail
19 {
config()20 config::config()
21   : m_format_minor("0"),
22     m_format_major("2"),
23     m_xml_element_indent(2),
24     m_tu_instr_suffix(".bi"),
25     m_tu_instr_archive_suffix(".abi")
26 {
27 }
28 
29 const std::string&
get_format_minor_version_number() const30 config::get_format_minor_version_number() const
31 {return m_format_minor;}
32 
33 void
set_format_minor_version_number(const std::string & v)34 config::set_format_minor_version_number(const std::string& v)
35 {m_format_minor = v;}
36 
37 const std::string&
get_format_major_version_number() const38 config::get_format_major_version_number() const
39 {return m_format_major;}
40 
41 void
set_format_major_version_number(const std::string & v)42 config::set_format_major_version_number(const std::string& v)
43 {m_format_major= v;}
44 
45 unsigned
get_xml_element_indent() const46 config::get_xml_element_indent() const
47 { return m_xml_element_indent; }
48 
49 void
set_xml_element_indent(unsigned indent)50 config::set_xml_element_indent(unsigned indent)
51 {m_xml_element_indent = indent;}
52 
53 const std::string&
get_tu_instr_suffix() const54 config::get_tu_instr_suffix() const
55 {return m_tu_instr_suffix;}
56 
57 void
set_tu_instr_suffix(const std::string & s)58 config::set_tu_instr_suffix(const std::string& s)
59 {m_tu_instr_suffix = s;}
60 
61 const std::string&
get_tu_instr_archive_suffix() const62 config::get_tu_instr_archive_suffix() const
63 {return m_tu_instr_archive_suffix;}
64 
65 void
set_tu_instr_archive_suffix(const std::string & s)66 config::set_tu_instr_archive_suffix(const std::string& s)
67 {m_tu_instr_archive_suffix = s; }
68 
69 extern "C"
70 {
71 void
abigail_get_library_version(std::string & major,std::string & minor,std::string & revision,std::string & suffix)72 abigail_get_library_version(std::string& major,
73 			    std::string& minor,
74 			    std::string& revision,
75 			    std::string& suffix)
76 {
77   major = ABIGAIL_VERSION_MAJOR;
78   minor = ABIGAIL_VERSION_MINOR;
79   revision = ABIGAIL_VERSION_REVISION;
80   suffix = ABIGAIL_VERSION_SUFFIX;
81 }
82 
83 }
84 }//end namespace abigail
85