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 and other headers. */
32 #ifndef SVN_WIN32_RESOURCE_COMPILATION
33 #include <apr_general.h>
34 #include <apr_tables.h>
36 #include "svn_types.h"
41 #endif /* __cplusplus */
44 /* Symbols that define the version number. */
46 /* Version numbers: <major>.<minor>.<micro>
48 * The version numbers in this file follow the rules established by:
50 * http://apr.apache.org/versioning.html
53 /** Major version number.
55 * Modify when incompatible changes are made to published interfaces.
57 #define SVN_VER_MAJOR 1
59 /** Minor version number.
61 * Modify when new functionality is added or new interfaces are
62 * defined, but all changes are backward compatible.
64 #define SVN_VER_MINOR 8
69 * Modify for every released patch.
73 #define SVN_VER_PATCH 14
76 /** @deprecated Provided for backward compatibility with the 1.0 API. */
77 #define SVN_VER_MICRO SVN_VER_PATCH
79 /** @deprecated Provided for backward compatibility with the 1.0 API. */
80 #define SVN_VER_LIBRARY SVN_VER_MAJOR
83 /** Version tag: a string describing the version.
85 * This tag remains " (dev build)" in the repository so that we can
86 * always see from "svn --version" that the software has been built
87 * from the repository rather than a "blessed" distribution.
89 * When rolling a tarball, we automatically replace this text with " (r1234)"
90 * (where 1234 is the last revision on the branch prior to the release)
91 * for final releases; in prereleases, it becomes " (Alpha 1)",
92 * " (Beta 1)", etc., as appropriate.
94 * Always change this at the same time as SVN_VER_NUMTAG.
96 #define SVN_VER_TAG " (r1692801)"
99 /** Number tag: a string describing the version.
101 * This tag is used to generate a version number string to identify
102 * the client and server in HTTP requests, for example. It must not
103 * contain any spaces. This value remains "-dev" in the repository.
105 * When rolling a tarball, we automatically replace this text with ""
106 * for final releases; in prereleases, it becomes "-alpha1, "-beta1",
107 * etc., as appropriate.
109 * Always change this at the same time as SVN_VER_TAG.
111 #define SVN_VER_NUMTAG ""
114 /** Revision number: The repository revision number of this release.
116 * This constant is used to generate the build number part of the Windows
117 * file version. Its value remains 0 in the repository.
119 * When rolling a tarball, we automatically replace it with what we
120 * guess to be the correct revision number.
122 #define SVN_VER_REVISION 1692801
125 /* Version strings composed from the above definitions. */
127 /** Version number */
128 #define SVN_VER_NUM APR_STRINGIFY(SVN_VER_MAJOR) \
129 "." APR_STRINGIFY(SVN_VER_MINOR) \
130 "." APR_STRINGIFY(SVN_VER_PATCH)
132 /** Version number with tag (contains no whitespace) */
133 #define SVN_VER_NUMBER SVN_VER_NUM SVN_VER_NUMTAG
135 /** Complete version string */
136 #define SVN_VERSION SVN_VER_NUMBER SVN_VER_TAG
140 /* Version queries and compatibility checks */
143 * Version information. Each library contains a function called
144 * svn_<i>libname</i>_version() that returns a pointer to a statically
145 * allocated object of this type.
151 int major; /**< Major version number */
152 int minor; /**< Minor version number */
153 int patch; /**< Patch number */
156 * The version tag (#SVN_VER_NUMTAG). Must always point to a
157 * statically allocated string.
163 * Define a static svn_version_t object.
167 #define SVN_VERSION_DEFINE(name) \
168 static const svn_version_t name = \
177 * Generate the implementation of a version query function.
181 #define SVN_VERSION_BODY \
182 SVN_VERSION_DEFINE(versioninfo); \
186 * Check library version compatibility. Return #TRUE if the client's
187 * version, given in @a my_version, is compatible with the library
188 * version, provided in @a lib_version.
190 * This function checks for version compatibility as per our
191 * guarantees, but requires an exact match when linking to an
192 * unreleased library. A development client is always compatible with
193 * a previous released library.
198 svn_ver_compatible(const svn_version_t *my_version,
199 const svn_version_t *lib_version);
202 * Check if @a my_version and @a lib_version encode the same version number.
207 svn_ver_equal(const svn_version_t *my_version,
208 const svn_version_t *lib_version);
212 * An entry in the compatibility checklist.
213 * @see svn_ver_check_list()
217 typedef struct svn_version_checklist_t
219 const char *label; /**< Entry label */
221 /** Version query function for this entry */
222 const svn_version_t *(*version_query)(void);
223 } svn_version_checklist_t;
227 * Perform a series of version compatibility checks. Checks if @a
228 * my_version is compatible with each entry in @a checklist. @a
229 * checklist must end with an entry whose label is @c NULL.
231 * @see svn_ver_compatible()
236 svn_ver_check_list(const svn_version_t *my_version,
237 const svn_version_checklist_t *checklist);
241 * Type of function returning library version.
245 typedef const svn_version_t *(*svn_version_func_t)(void);
248 /* libsvn_subr doesn't have an svn_subr header, so put the prototype here. */
250 * Get libsvn_subr version information.
254 const svn_version_t *
255 svn_subr_version(void);
259 * Extended version information, including info about the running system.
263 typedef struct svn_version_extended_t svn_version_extended_t;
266 * Return version information for the running program. If @a verbose
267 * is #TRUE, collect extra information that may be expensive to
268 * retrieve (for example, the OS release name, list of shared
269 * libraries, etc.). Use @a pool for all allocations.
273 const svn_version_extended_t *
274 svn_version_extended(svn_boolean_t verbose,
279 * Accessor for svn_version_extended_t.
281 * @return The date when the libsvn_subr library was compiled, in the
282 * format defined by the C standard macro @c __DATE__.
287 svn_version_ext_build_date(const svn_version_extended_t *ext_info);
290 * Accessor for svn_version_extended_t.
292 * @return The time when the libsvn_subr library was compiled, in the
293 * format defined by the C standard macro @c __TIME__.
298 svn_version_ext_build_time(const svn_version_extended_t *ext_info);
301 * Accessor for svn_version_extended_t.
303 * @return The canonical host triplet (arch-vendor-osname) of the
304 * system where libsvn_subr was compiled.
306 * @note On Unix-like systems (includng Mac OS X), this string is the
307 * same as the output of the config.guess script.
312 svn_version_ext_build_host(const svn_version_extended_t *ext_info);
315 * Accessor for svn_version_extended_t.
317 * @return The localized copyright notice.
322 svn_version_ext_copyright(const svn_version_extended_t *ext_info);
325 * Accessor for svn_version_extended_t.
327 * @return The canonical host triplet (arch-vendor-osname) of the
328 * system where the current process is running.
330 * @note This string may not be the same as the output of config.guess
331 * on the same system.
336 svn_version_ext_runtime_host(const svn_version_extended_t *ext_info);
339 * Accessor for svn_version_extended_t.
341 * @return The "commercial" release name of the running operating
342 * system, if available. Not to be confused with, e.g., the output of
343 * "uname -v" or "uname -r". The returned value may be @c NULL.
348 svn_version_ext_runtime_osname(const svn_version_extended_t *ext_info);
351 * Dependent library information.
352 * Describes the name and versions of known dependencies
353 * used by libsvn_subr.
357 typedef struct svn_version_ext_linked_lib_t
359 const char *name; /**< Library name */
360 const char *compiled_version; /**< Compile-time version string */
361 const char *runtime_version; /**< Run-time version string (optional) */
362 } svn_version_ext_linked_lib_t;
365 * Accessor for svn_version_extended_t.
367 * @return Array of svn_version_ext_linked_lib_t describing dependent
368 * libraries. The returned value may be @c NULL.
372 const apr_array_header_t *
373 svn_version_ext_linked_libs(const svn_version_extended_t *ext_info);
377 * Loaded shared library information.
378 * Describes the name and, where available, version of the shared libraries
379 * loaded by the running program.
383 typedef struct svn_version_ext_loaded_lib_t
385 const char *name; /**< Library name */
386 const char *version; /**< Library version (optional) */
387 } svn_version_ext_loaded_lib_t;
391 * Accessor for svn_version_extended_t.
393 * @return Array of svn_version_ext_loaded_lib_t describing loaded
394 * shared libraries. The returned value may be @c NULL.
396 * @note On Mac OS X, the loaded frameworks, private frameworks and
397 * system libraries will not be listed.
401 const apr_array_header_t *
402 svn_version_ext_loaded_libs(const svn_version_extended_t *ext_info);
407 #endif /* __cplusplus */
409 #endif /* SVN_VERSION_H */