reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
ReproVersion.cxx
Go to the documentation of this file.
1
2/*
3** Build system provides these.
4** VERSION comes from a file and is the 'marketing' version
5** of repro (major.minor)
6** BUILD_REV is the subversion svnversion output (lightly formatted)
7** (ends in M if there are local modifications)
8** RELEASE_VERSION
9*/
10
11#if defined(TESTDRIVER)
12#include <iostream>
13#endif
14
16#ifdef HAVE_CONFIG_H
17#include "config.h"
18#endif
19#ifdef HAVE_VERSION_H
20#include "version.h"
21#endif
22#if !defined(REPRO_BUILD_REV)
23# define REPRO_BUILD_REV "000000"
24#endif
25
26#if !defined(REPRO_BUILD_HOST)
27# define REPRO_BUILD_HOST "unknown.invalid"
28#endif
29
30#if !defined(RESIPROCATE_VERSION_STR)
31# define RESIPROCATE_VERSION_STR "0.0.0"
32#endif
33
34#if !defined(REPRO_NAME)
35# define REPRO_NAME "Repro"
36#endif
37
38
39
40namespace repro
41{
42 VersionUtils::VersionUtils():
43 mBuildHost(REPRO_BUILD_HOST),
44 mReleaseVersion(RESIPROCATE_VERSION_STR),
45 mScmRevision(REPRO_BUILD_REV),
46 mDisplayVersion(REPRO_NAME),
47 mBuildStamp(REPRO_BUILD_REV)
48 {
49 mDisplayVersion += ' ';
50 mDisplayVersion += mReleaseVersion;
51 mDisplayVersion += '/';
52
53 mBuildStamp += '@';
54 mBuildStamp += mBuildHost;
55
56 mDisplayVersion += mBuildStamp;
57 }
58
59 VersionUtils* VersionUtils::sVU = 0;
60
61 const VersionUtils&
63 {
64 if (sVU == 0)
65 {
66 sVU = new VersionUtils;
67 }
68 return *sVU;
69 }
70
71 VersionUtils::~VersionUtils() {};
72
73 const std::string&
75 {
76 return mBuildStamp;
77 }
78
79 const std::string&
81 {
82 return mReleaseVersion;
83 }
84
85
86 const std::string&
88 {
89 return mBuildHost;
90 }
91
92 const std::string&
94 {
95 return mDisplayVersion;
96 }
97
98 const std::string&
100 {
101 return mScmRevision;
102 }
103
104};
105
106
107#if defined(TESTDRIVER)
108int main()
109{
110#define T(x) std::cout << #x << " = " << repro::VersionUtils::instance().x() << std::endl;
111 T(displayVersion);
112 T(buildStamp);
113 T(scmRevision);
114 T(releaseVersion);
115 T(buildHost);
116 return 0;
117}
118#undef T
119#endif
120/* ====================================================================
121 * The Vovida Software License, Version 1.0
122 *
123 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
124 *
125 * Redistribution and use in source and binary forms, with or without
126 * modification, are permitted provided that the following conditions
127 * are met:
128 *
129 * 1. Redistributions of source code must retain the above copyright
130 * notice, this list of conditions and the following disclaimer.
131 *
132 * 2. Redistributions in binary form must reproduce the above copyright
133 * notice, this list of conditions and the following disclaimer in
134 * the documentation and/or other materials provided with the
135 * distribution.
136 *
137 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
138 * and "Vovida Open Communication Application Library (VOCAL)" must
139 * not be used to endorse or promote products derived from this
140 * software without prior written permission. For written
141 * permission, please contact vocal@vovida.org.
142 *
143 * 4. Products derived from this software may not be called "VOCAL", nor
144 * may "VOCAL" appear in their name, without prior written
145 * permission of Vovida Networks, Inc.
146 *
147 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
148 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
149 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
150 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
151 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
152 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
153 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
154 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
155 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
156 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
157 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
158 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
159 * DAMAGE.
160 *
161 * ====================================================================
162 */
#define RESIPROCATE_VERSION_STR
#define REPRO_BUILD_HOST
#define REPRO_BUILD_REV
#define REPRO_NAME
int main(int argc, char **argv)
Definition adig.c:209
static const VersionUtils & instance()
const std::string & buildHost() const
const std::string & scmRevision() const
const std::string & releaseVersion() const
const std::string & buildStamp() const
const std::string & displayVersion() const
This Class is used to implement a primitive form of RPC using loose XML formatting.