2 Unix SMB/CIFS implementation.
3 Samba Version functions
5 Copyright (C) Stefan Metzmacher 2003
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 const char *samba_version_string(void)
27 const char *official_string = SAMBA_VERSION_OFFICIAL_STRING;
28 #ifdef SAMBA_VERSION_RELEASE_NICKNAME
29 const char *release_nickname = SAMBA_VERSION_RELEASE_NICKNAME;
31 const char *release_nickname = NULL;
33 #ifdef SAMBA_VERSION_VENDOR_SUFFIX
34 const char *vendor_suffix = SAMBA_VERSION_VENDOR_SUFFIX;
36 const char *vendor_suffix = NULL;
38 #ifdef SAMBA_VERSION_VENDOR_PATCH
39 const char *vendor_patch = SAMBA_VERSION_VENDOR_PATCH;
41 const char *vendor_patch = NULL;
43 static char *samba_version;
44 static BOOL init_samba_version;
46 if (init_samba_version) {
50 samba_version = talloc_asprintf(talloc_autofree_context(),
53 (vendor_suffix?"-":""),
54 (vendor_suffix?vendor_suffix:""),
55 (vendor_patch?"-":""),
56 (vendor_patch?vendor_patch:""),
57 (release_nickname?" (":""),
58 (release_nickname?release_nickname:""),
59 (release_nickname?")":""));
61 init_samba_version = True;