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