Line data Source code
1 : /*
2 : * Copyright (C) 2004-2026 Savoir-faire Linux Inc.
3 : *
4 : * This program is free software: you can redistribute it and/or modify
5 : * it under the terms of the GNU General Public License as published by
6 : * the Free Software Foundation, either version 3 of the License, or
7 : * (at your option) any later version.
8 : *
9 : * This program is distributed in the hope that it will be useful,
10 : * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 : * GNU General Public License for more details.
13 : *
14 : * You should have received a copy of the GNU General Public License
15 : * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 : */
17 :
18 : #ifdef HAVE_CONFIG_H
19 : #include "config.h"
20 : #endif
21 :
22 : #include "jami.h"
23 : #include "string_utils.h"
24 :
25 : #ifndef JAMI_REVISION
26 : #define JAMI_REVISION ""
27 : #endif
28 :
29 : #ifndef JAMI_DIRTY_REPO
30 : #define JAMI_DIRTY_REPO ""
31 : #endif
32 :
33 : #ifndef PACKAGE_VERSION
34 : #define PACKAGE_VERSION "unknown"
35 : #endif
36 :
37 : namespace libjami {
38 :
39 : const char*
40 40 : version() noexcept
41 : {
42 0 : return JAMI_REVISION[0] and JAMI_DIRTY_REPO[0]
43 80 : ? PACKAGE_VERSION "-" JAMI_REVISION "-" JAMI_DIRTY_REPO
44 80 : : (JAMI_REVISION[0] ? PACKAGE_VERSION "-" JAMI_REVISION : PACKAGE_VERSION);
45 : }
46 :
47 : std::string_view
48 0 : platform() noexcept
49 : {
50 0 : return jami::platform();
51 : }
52 :
53 : std::string_view
54 0 : arch() noexcept
55 : {
56 0 : return jami::arch();
57 : }
58 :
59 : } // namespace libjami
|