libabigail
abg-config.cc
Go to the documentation of this file.
1 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2 // -*- Mode: C++ -*-
3 //
4 // Copyright (C) 2013-2023 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 {
20 config::config()
21  : m_format_minor(ABIGAIL_ABIXML_VERSION_MINOR),
22  m_format_major(ABIGAIL_ABIXML_VERSION_MAJOR),
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&
30 config::get_format_minor_version_number() const
31 {return m_format_minor;}
32 
33 void
34 config::set_format_minor_version_number(const std::string& v)
35 {m_format_minor = v;}
36 
37 const std::string&
38 config::get_format_major_version_number() const
39 {return m_format_major;}
40 
41 void
42 config::set_format_major_version_number(const std::string& v)
43 {m_format_major= v;}
44 
45 unsigned
46 config::get_xml_element_indent() const
47 { return m_xml_element_indent; }
48 
49 void
50 config::set_xml_element_indent(unsigned indent)
51 {m_xml_element_indent = indent;}
52 
53 const std::string&
54 config::get_tu_instr_suffix() const
55 {return m_tu_instr_suffix;}
56 
57 void
58 config::set_tu_instr_suffix(const std::string& s)
59 {m_tu_instr_suffix = s;}
60 
61 const std::string&
62 config::get_tu_instr_archive_suffix() const
63 {return m_tu_instr_archive_suffix;}
64 
65 void
66 config::set_tu_instr_archive_suffix(const std::string& s)
67 {m_tu_instr_archive_suffix = s; }
68 
69 extern "C"
70 {
71 /// Return the relevant version numbers of the library.
72 ///
73 /// @param maj the major version number of the library.
74 ///
75 /// @param min the minor version number of the library.
76 ///
77 /// @param rev the revision version number of the library.
78 ///
79 /// @param suf the version suffix of the library.
80 void
81 abigail_get_library_version(std::string& major,
82  std::string& minor,
83  std::string& revision,
84  std::string& suffix)
85 {
86  major = ABIGAIL_VERSION_MAJOR;
87  minor = ABIGAIL_VERSION_MINOR;
88  revision = ABIGAIL_VERSION_REVISION;
89  suffix = ABIGAIL_VERSION_SUFFIX;
90 }
91 
92 /// Return the version numbers for the ABIXML format.
93 ///
94 /// @param maj the major version number of the ABIXML format.
95 ///
96 /// @param min the minor version number of the ABIXML format.
97 void
98 abigail_get_abixml_version(std::string& major,
99  std::string& minor)
100 {
101  major = ABIGAIL_ABIXML_VERSION_MAJOR;
102  minor = ABIGAIL_ABIXML_VERSION_MINOR;
103 }
104 
105 }
106 }//end namespace abigail
Toplevel namespace for libabigail.
void abigail_get_library_version(std::string &major, std::string &minor, std::string &revision, std::string &suffix)
Return the relevant version numbers of the library.
Definition: abg-config.cc:81
void abigail_get_abixml_version(std::string &major, std::string &minor)
Return the version numbers for the ABIXML format.
Definition: abg-config.cc:98