GnuCash  5.6-150-g038405b370+
gnc-version.c
1 /********************************************************************\
2  * gnc-version.cpp -- functions to query the build-time version info *
3  * *
4  * Copyright (C) 2019 Geert Janssens <geert@kobaltwit.be> *
5  * *
6  * This program is free software; you can redistribute it and/or *
7  * modify it under the terms of the GNU General Public License as *
8  * published by the Free Software Foundation; either version 2 of *
9  * the License, or (at your option) any later version. *
10  * *
11  * This program is distributed in the hope that it will be useful, *
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14  * GNU General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU General Public License*
17  * along with this program; if not, contact: *
18  * *
19  * Free Software Foundation Voice: +1-617-542-5942 *
20  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
21  * Boston, MA 02110-1301, USA gnu@gnu.org *
22  * *
23  ********************************************************************/
24 
25 #include "gnc-version.h"
26 #include <config.h>
27 
28 #ifdef GNC_VCS
29  #define vcs GNC_VCS " "
30 #else
31  #define vcs ""
32 #endif
33 #define dflt_build_id vcs GNC_VCS_REV "(" GNC_VCS_REV_DATE ")"
34 
35 const char *gnc_version(void)
36 {
37  return PROJECT_VERSION;
38 }
39 
40 const char *gnc_build_id(void)
41 {
42  /* GNUCASH_BUILD_ID can be set by the builder prior to compiling to anything
43  * the builder sees fit (eg distributions may want to print a package source
44  * version number (rpm, dpkg,...)
45  * If not set by a builder it will be set by default to our
46  * git revision ("git706a3b (<commit-date>)"
47  */
48  if (GNUCASH_BUILD_ID[0] != '\0')
49  return GNUCASH_BUILD_ID;
50  else
51  return dflt_build_id;
52 
53 }
54 
55 const char *gnc_vcs_rev(void)
56 {
57  return GNC_VCS_REV;
58 }
59 
60 const char *gnc_vcs_rev_date(void)
61 {
62  return GNC_VCS_REV_DATE;
63 }
64 
65 const int gnc_gnucash_major_version(void)
66 {
67  return PROJECT_VERSION_MAJOR;
68 }
functions to query various version related strings that were set at build time.
const char * gnc_version(void)
Parse <prefix>/etc/gnucash/environment and set environment variables based on the contents of that fi...
Definition: gnc-version.c:35