3 * ====================================================================
4 * Copyright (c) 2000-2004 CollabNet. All rights reserved.
6 * This software is licensed as described in the file COPYING, which
7 * you should have received as part of this distribution. The terms
8 * are also available at http://subversion.tigris.org/license-1.html.
9 * If newer versions of this license are posted there, you may use a
10 * newer version instead, at your option.
12 * This software consists of voluntary contributions made by many
13 * individuals. For exact contribution history, see the revision
14 * history and logs, available at http://subversion.tigris.org/.
15 * ====================================================================
19 * @brief Version information.
25 /* Hack to prevent the resource compiler from including
26 apr_general.h. It doesn't resolve the include paths
27 correctly and blows up without this.
30 #include <apr_general.h>
33 #include "svn_types.h"
37 #endif /* __cplusplus */
40 /* Symbols that define the version number. */
42 /* Version numbers: <major>.<minor>.<micro>
44 * The version numbers in this file follow the rules established by:
46 * http://apr.apache.org/versioning.html
49 /** Major version number.
51 * Modify when incompatible changes are made to published interfaces.
53 #define SVN_VER_MAJOR 1
55 /** Minor version number.
57 * Modify when new functionality is added or new interfaces are
58 * defined, but all changes are backward compatible.
60 #define SVN_VER_MINOR 6
65 * Modify for every released patch.
69 #define SVN_VER_PATCH 0
72 /** @deprecated Provided for backward compatibility with the 1.0 API. */
73 #define SVN_VER_MICRO SVN_VER_PATCH
75 /** @deprecated Provided for backward compatibility with the 1.0 API. */
76 #define SVN_VER_LIBRARY SVN_VER_MAJOR
79 /** Version tag: a string describing the version.
81 * This tag remains " (dev build)" in the repository so that we can
82 * always see from "svn --version" that the software has been built
83 * from the repository rather than a "blessed" distribution.
85 * When rolling a tarball, we automatically replace this text with " (r1234)"
86 * (where 1234 is the last revision on the branch prior to the release)
87 * for final releases; in prereleases, it becomes " (Alpha 1)",
88 * " (Beta 1)", etc., as appropriate.
90 * Always change this at the same time as SVN_VER_NUMTAG.
92 #define SVN_VER_TAG " (dev build)"
95 /** Number tag: a string describing the version.
97 * This tag is used to generate a version number string to identify
98 * the client and server in HTTP requests, for example. It must not
99 * contain any spaces. This value remains "-dev" in the repository.
101 * When rolling a tarball, we automatically replace this text with ""
102 * for final releases; in prereleases, it becomes "-alpha1, "-beta1",
103 * etc., as appropriate.
105 * Always change this at the same time as SVN_VER_TAG.
107 #define SVN_VER_NUMTAG "-dev"
110 /** Revision number: The repository revision number of this release.
112 * This constant is used to generate the build number part of the Windows
113 * file version. Its value remains 0 in the repository.
115 * When rolling a tarball, we automatically replace it with what we
116 * guess to be the correct revision number.
118 #define SVN_VER_REVISION 0
121 /* Version strings composed from the above definitions. */
123 /** Version number */
124 #define SVN_VER_NUM APR_STRINGIFY(SVN_VER_MAJOR) \
125 "." APR_STRINGIFY(SVN_VER_MINOR) \
126 "." APR_STRINGIFY(SVN_VER_PATCH)
128 /** Version number with tag (contains no whitespace) */
129 #define SVN_VER_NUMBER SVN_VER_NUM SVN_VER_NUMTAG
131 /** Complete version string */
132 #define SVN_VERSION SVN_VER_NUM SVN_VER_TAG
136 /* Version queries and compatibility checks */
139 * Version information. Each library contains a function called
140 * svn_<i>libname</i>_version() that returns a pointer to a statically
141 * allocated object of this type.
145 typedef struct svn_version_t
147 int major
; /**< Major version number */
148 int minor
; /**< Minor version number */
149 int patch
; /**< Patch number */
152 * The version tag (#SVN_VER_NUMTAG).\ Must always point to a
153 * statically allocated string.
159 * Define a static svn_version_t object.
163 #define SVN_VERSION_DEFINE(name) \
164 static const svn_version_t name = \
173 * Generate the implementation of a version query function.
177 #define SVN_VERSION_BODY \
178 SVN_VERSION_DEFINE(versioninfo); \
182 * Check library version compatibility. Return #TRUE if the client's
183 * version, given in @a my_version, is compatible with the library
184 * version, provided in @a lib_version.
186 * This function checks for version compatibility as per our
187 * guarantees, but requires an exact match when linking to an
188 * unreleased library. A development client is always compatible with
189 * a previous released library.
193 svn_boolean_t
svn_ver_compatible(const svn_version_t
*my_version
,
194 const svn_version_t
*lib_version
);
197 * Check if @a my_version and @a lib_version encode the same version number.
201 svn_boolean_t
svn_ver_equal(const svn_version_t
*my_version
,
202 const svn_version_t
*lib_version
);
206 * An entry in the compatibility checklist.
207 * @see svn_ver_check_list()
211 typedef struct svn_version_checklist_t
213 const char *label
; /**< Entry label */
215 /** Version query function for this entry */
216 const svn_version_t
*(*version_query
)(void);
217 } svn_version_checklist_t
;
221 * Perform a series of version compatibility checks. Checks if @a
222 * my_version is compatible with each entry in @a checklist. @a
223 * checklist must end with an entry whose label is @c NULL.
225 * @see svn_ver_compatible()
229 svn_error_t
*svn_ver_check_list(const svn_version_t
*my_version
,
230 const svn_version_checklist_t
*checklist
);
233 /* libsvn_subr doesn't have an svn_subr header, so put the prototype here. */
235 * Get libsvn_subr version information.
239 const svn_version_t
*svn_subr_version(void);
244 #endif /* __cplusplus */
246 #endif /* SVN_VERSION_H */