3 * ====================================================================
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
20 * ====================================================================
24 * @brief Version information.
30 /* Hack to prevent the resource compiler from including
31 apr_general.h. It doesn't resolve the include paths
32 correctly and blows up without this.
35 #include <apr_general.h>
37 #include <apr_tables.h>
39 #include "svn_types.h"
43 #endif /* __cplusplus */
46 /* Symbols that define the version number. */
48 /* Version numbers: <major>.<minor>.<micro>
50 * The version numbers in this file follow the rules established by:
52 * http://apr.apache.org/versioning.html
55 /** Major version number.
57 * Modify when incompatible changes are made to published interfaces.
59 #define SVN_VER_MAJOR 1
61 /** Minor version number.
63 * Modify when new functionality is added or new interfaces are
64 * defined, but all changes are backward compatible.
66 #define SVN_VER_MINOR 8
71 * Modify for every released patch.
75 #define SVN_VER_PATCH 0
78 /** @deprecated Provided for backward compatibility with the 1.0 API. */
79 #define SVN_VER_MICRO SVN_VER_PATCH
81 /** @deprecated Provided for backward compatibility with the 1.0 API. */
82 #define SVN_VER_LIBRARY SVN_VER_MAJOR
85 /** Version tag: a string describing the version.
87 * This tag remains " (dev build)" in the repository so that we can
88 * always see from "svn --version" that the software has been built
89 * from the repository rather than a "blessed" distribution.
91 * When rolling a tarball, we automatically replace this text with " (r1234)"
92 * (where 1234 is the last revision on the branch prior to the release)
93 * for final releases; in prereleases, it becomes " (Alpha 1)",
94 * " (Beta 1)", etc., as appropriate.
96 * Always change this at the same time as SVN_VER_NUMTAG.
98 #define SVN_VER_TAG " (under development)"
101 /** Number tag: a string describing the version.
103 * This tag is used to generate a version number string to identify
104 * the client and server in HTTP requests, for example. It must not
105 * contain any spaces. This value remains "-dev" in the repository.
107 * When rolling a tarball, we automatically replace this text with ""
108 * for final releases; in prereleases, it becomes "-alpha1, "-beta1",
109 * etc., as appropriate.
111 * Always change this at the same time as SVN_VER_TAG.
113 #define SVN_VER_NUMTAG "-dev"
116 /** Revision number: The repository revision number of this release.
118 * This constant is used to generate the build number part of the Windows
119 * file version. Its value remains 0 in the repository.
121 * When rolling a tarball, we automatically replace it with what we
122 * guess to be the correct revision number.
124 #define SVN_VER_REVISION 0
127 /* Version strings composed from the above definitions. */
129 /** Version number */
130 #define SVN_VER_NUM APR_STRINGIFY(SVN_VER_MAJOR) \
131 "." APR_STRINGIFY(SVN_VER_MINOR) \
132 "." APR_STRINGIFY(SVN_VER_PATCH)
134 /** Version number with tag (contains no whitespace) */
135 #define SVN_VER_NUMBER SVN_VER_NUM SVN_VER_NUMTAG
137 /** Complete version string */
138 #define SVN_VERSION SVN_VER_NUMBER SVN_VER_TAG
142 /* Version queries and compatibility checks */
145 * Version information. Each library contains a function called
146 * svn_<i>libname</i>_version() that returns a pointer to a statically
147 * allocated object of this type.
153 int major
; /**< Major version number */
154 int minor
; /**< Minor version number */
155 int patch
; /**< Patch number */
158 * The version tag (#SVN_VER_NUMTAG). Must always point to a
159 * statically allocated string.
165 * Define a static svn_version_t object.
169 #define SVN_VERSION_DEFINE(name) \
170 static const svn_version_t name = \
179 * Generate the implementation of a version query function.
183 #define SVN_VERSION_BODY \
184 SVN_VERSION_DEFINE(versioninfo); \
188 * Check library version compatibility. Return #TRUE if the client's
189 * version, given in @a my_version, is compatible with the library
190 * version, provided in @a lib_version.
192 * This function checks for version compatibility as per our
193 * guarantees, but requires an exact match when linking to an
194 * unreleased library. A development client is always compatible with
195 * a previous released library.
200 svn_ver_compatible(const svn_version_t
*my_version
,
201 const svn_version_t
*lib_version
);
204 * Check if @a my_version and @a lib_version encode the same version number.
209 svn_ver_equal(const svn_version_t
*my_version
,
210 const svn_version_t
*lib_version
);
214 * An entry in the compatibility checklist.
215 * @see svn_ver_check_list()
219 typedef struct svn_version_checklist_t
221 const char *label
; /**< Entry label */
223 /** Version query function for this entry */
224 const svn_version_t
*(*version_query
)(void);
225 } svn_version_checklist_t
;
229 * Perform a series of version compatibility checks. Checks if @a
230 * my_version is compatible with each entry in @a checklist. @a
231 * checklist must end with an entry whose label is @c NULL.
233 * @see svn_ver_compatible()
238 svn_ver_check_list(const svn_version_t
*my_version
,
239 const svn_version_checklist_t
*checklist
);
243 * Type of function returning library version.
247 typedef const svn_version_t
*(*svn_version_func_t
)(void);
250 /* libsvn_subr doesn't have an svn_subr header, so put the prototype here. */
252 * Get libsvn_subr version information.
256 const svn_version_t
*
257 svn_subr_version(void);
261 * Extended version information, including info about the running system.
265 typedef struct svn_version_extended_t svn_version_extended_t
;
268 * Return version information for the running program. If @a verbose
269 * is #TRUE, collect extra information that may be expensive to
270 * retrieve (for example, the OS release name, list of shared
271 * libraries, etc.). Use @a pool for all allocations.
275 const svn_version_extended_t
*
276 svn_version_extended(svn_boolean_t verbose
,
281 * Accessor for svn_version_extended_t.
283 * @return The date when the libsvn_subr library was compiled, in the
284 * format defined by the C standard macro @c __DATE__.
289 svn_version_ext_build_date(const svn_version_extended_t
*ext_info
);
292 * Accessor for svn_version_extended_t.
294 * @return The time when the libsvn_subr library was compiled, in the
295 * format defined by the C standard macro @c __TIME__.
300 svn_version_ext_build_time(const svn_version_extended_t
*ext_info
);
303 * Accessor for svn_version_extended_t.
305 * @return The canonical host triplet (arch-vendor-osname) of the
306 * system where libsvn_subr was compiled.
308 * @note On Unix-like systems (includng Mac OS X), this string is the
309 * same as the output of the config.guess script.
314 svn_version_ext_build_host(const svn_version_extended_t
*ext_info
);
317 * Accessor for svn_version_extended_t.
319 * @return The localized copyright notice.
324 svn_version_ext_copyright(const svn_version_extended_t
*ext_info
);
327 * Accessor for svn_version_extended_t.
329 * @return The canonical host triplet (arch-vendor-osname) of the
330 * system where the current process is running.
332 * @note This string may not be the same as the output of config.guess
333 * on the same system.
338 svn_version_ext_runtime_host(const svn_version_extended_t
*ext_info
);
341 * Accessor for svn_version_extended_t.
343 * @return The "commercial" release name of the running operating
344 * system, if available. Not to be confused with, e.g., the output of
345 * "uname -v" or "uname -r". The returned value may be @c NULL.
350 svn_version_ext_runtime_osname(const svn_version_extended_t
*ext_info
);
353 * Dependent library information.
354 * Describes the name and versions of known dependencies
355 * used by libsvn_subr.
359 typedef struct svn_version_ext_linked_lib_t
361 const char *name
; /**< Library name */
362 const char *compiled_version
; /**< Compile-time version string */
363 const char *runtime_version
; /**< Run-time version string (optional) */
364 } svn_version_ext_linked_lib_t
;
367 * Accessor for svn_version_extended_t.
369 * @return Array of svn_version_ext_linked_lib_t describing dependent
370 * libraries. The returned value may be @c NULL.
374 const apr_array_header_t
*
375 svn_version_ext_linked_libs(const svn_version_extended_t
*ext_info
);
379 * Loaded shared library information.
380 * Describes the name and, where available, version of the shared libraries
381 * loaded by the running program.
385 typedef struct svn_version_ext_loaded_lib_t
387 const char *name
; /**< Library name */
388 const char *version
; /**< Library version (optional) */
389 } svn_version_ext_loaded_lib_t
;
393 * Accessor for svn_version_extended_t.
395 * @return Array of svn_version_ext_loaded_lib_t describing loaded
396 * shared libraries. The returned value may be @c NULL.
398 * @note On Mac OS X, the loaded frameworks, private frameworks and
399 * system libraries will not be listed.
403 const apr_array_header_t
*
404 svn_version_ext_loaded_libs(const svn_version_extended_t
*ext_info
);
409 #endif /* __cplusplus */
411 #endif /* SVN_VERSION_H */