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 9
69 * Modify for every released patch.
73 #define SVN_VER_PATCH 4
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 " (under development)" 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 " (r1740329)"
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 except in release
118 * tags where it is the revision from which the tag was created.
120 #define SVN_VER_REVISION 1740329
123 /* Version strings composed from the above definitions. */
125 /** Version number */
126 #define SVN_VER_NUM APR_STRINGIFY(SVN_VER_MAJOR) \
127 "." APR_STRINGIFY(SVN_VER_MINOR) \
128 "." APR_STRINGIFY(SVN_VER_PATCH)
130 /** Version number with tag (contains no whitespace) */
131 #define SVN_VER_NUMBER SVN_VER_NUM SVN_VER_NUMTAG
133 /** Complete version string */
134 #define SVN_VERSION SVN_VER_NUMBER SVN_VER_TAG
138 /* Version queries and compatibility checks */
141 * Version information. Each library contains a function called
142 * svn_<i>libname</i>_version() that returns a pointer to a statically
143 * allocated object of this type.
149 int major; /**< Major version number */
150 int minor; /**< Minor version number */
151 int patch; /**< Patch number */
154 * The version tag (#SVN_VER_NUMTAG). Must always point to a
155 * statically allocated string.
161 * Define a static svn_version_t object.
165 #define SVN_VERSION_DEFINE(name) \
166 static const svn_version_t name = \
175 * Generate the implementation of a version query function.
178 * @since Since 1.9, embeds a string into the compiled object
179 * file that can be queried with the 'what' utility.
181 #define SVN_VERSION_BODY \
182 static struct versioninfo_t \
184 const char *const str; \
185 const svn_version_t num; \
186 } const versioninfo = \
188 "@(#)" SVN_VERSION, \
196 return &versioninfo.num
199 * Check library version compatibility. Return #TRUE if the client's
200 * version, given in @a my_version, is compatible with the library
201 * version, provided in @a lib_version.
203 * This function checks for version compatibility as per our
204 * guarantees, but requires an exact match when linking to an
205 * unreleased library. A development client is always compatible with
206 * a previous released library.
208 * @note Implements the #svn_ver_check_list2.@a comparator interface.
213 svn_ver_compatible(const svn_version_t *my_version,
214 const svn_version_t *lib_version);
217 * Check if @a my_version and @a lib_version encode the same version number.
219 * @note Implements the #svn_ver_check_list2.@a comparator interface.
224 svn_ver_equal(const svn_version_t *my_version,
225 const svn_version_t *lib_version);
229 * An entry in the compatibility checklist.
230 * @see svn_ver_check_list()
234 typedef struct svn_version_checklist_t
236 const char *label; /**< Entry label */
238 /** Version query function for this entry */
239 const svn_version_t *(*version_query)(void);
240 } svn_version_checklist_t;
244 * Perform a series of version compatibility checks. Checks if @a
245 * my_version is compatible with each entry in @a checklist. @a
246 * checklist must end with an entry whose label is @c NULL.
248 * @a my_version is considered to be compatible with a version in @a checklist
249 * if @a comparator returns #TRUE when called with @a my_version as the first
250 * parammeter and the @a checklist version as the second parameter.
252 * @see svn_ver_compatible(), svn_ver_equal()
254 * @note Subversion's own code invariably uses svn_ver_equal() as @a comparator,
255 * since the cmdline tools sometimes use non-public APIs (such as utility
256 * functions that haven't been promoted to svn_cmdline.h). Third-party code
257 * SHOULD use svn_ver_compatible() as @a comparator.
262 svn_ver_check_list2(const svn_version_t *my_version,
263 const svn_version_checklist_t *checklist,
264 svn_boolean_t (*comparator)(const svn_version_t *,
265 const svn_version_t *));
267 /** Similar to svn_ver_check_list2(), with @a comparator set to
268 * #svn_ver_compatible.
270 * @deprecated Provided for backward compatibility with 1.8 API.
274 svn_ver_check_list(const svn_version_t *my_version,
275 const svn_version_checklist_t *checklist);
279 * Type of function returning library version.
283 typedef const svn_version_t *(*svn_version_func_t)(void);
286 /* libsvn_subr doesn't have an svn_subr header, so put the prototype here. */
288 * Get libsvn_subr version information.
292 const svn_version_t *
293 svn_subr_version(void);
297 * Extended version information, including info about the running system.
301 typedef struct svn_version_extended_t svn_version_extended_t;
304 * Return version information for the running program. If @a verbose
305 * is #TRUE, collect extra information that may be expensive to
306 * retrieve (for example, the OS release name, list of shared
307 * libraries, etc.). Use @a pool for all allocations.
309 * @note This function may allocate significant auxiliary resources
310 * (memory and file descriptors) in @a pool. It is recommended to
311 * copy the returned data to suitable longer-lived memory and clear
312 * @a pool after calling this function.
316 const svn_version_extended_t *
317 svn_version_extended(svn_boolean_t verbose,
322 * Accessor for svn_version_extended_t.
324 * @return The date when the libsvn_subr library was compiled, in the
325 * format defined by the C standard macro @c __DATE__.
330 svn_version_ext_build_date(const svn_version_extended_t *ext_info);
333 * Accessor for svn_version_extended_t.
335 * @return The time when the libsvn_subr library was compiled, in the
336 * format defined by the C standard macro @c __TIME__.
341 svn_version_ext_build_time(const svn_version_extended_t *ext_info);
344 * Accessor for svn_version_extended_t.
346 * @return The canonical host triplet (arch-vendor-osname) of the
347 * system where libsvn_subr was compiled.
349 * @note On Unix-like systems (includng Mac OS X), this string is the
350 * same as the output of the config.guess script.
355 svn_version_ext_build_host(const svn_version_extended_t *ext_info);
358 * Accessor for svn_version_extended_t.
360 * @return The localized copyright notice.
365 svn_version_ext_copyright(const svn_version_extended_t *ext_info);
368 * Accessor for svn_version_extended_t.
370 * @return The canonical host triplet (arch-vendor-osname) of the
371 * system where the current process is running.
373 * @note This string may not be the same as the output of config.guess
374 * on the same system.
379 svn_version_ext_runtime_host(const svn_version_extended_t *ext_info);
382 * Accessor for svn_version_extended_t.
384 * @return The "commercial" release name of the running operating
385 * system, if available. Not to be confused with, e.g., the output of
386 * "uname -v" or "uname -r". The returned value may be @c NULL.
391 svn_version_ext_runtime_osname(const svn_version_extended_t *ext_info);
394 * Dependent library information.
395 * Describes the name and versions of known dependencies
396 * used by libsvn_subr.
400 typedef struct svn_version_ext_linked_lib_t
402 const char *name; /**< Library name */
403 const char *compiled_version; /**< Compile-time version string */
404 const char *runtime_version; /**< Run-time version string (optional) */
405 } svn_version_ext_linked_lib_t;
408 * Accessor for svn_version_extended_t.
410 * @return Array of svn_version_ext_linked_lib_t describing dependent
411 * libraries. The returned value may be @c NULL.
415 const apr_array_header_t *
416 svn_version_ext_linked_libs(const svn_version_extended_t *ext_info);
420 * Loaded shared library information.
421 * Describes the name and, where available, version of the shared libraries
422 * loaded by the running program.
426 typedef struct svn_version_ext_loaded_lib_t
428 const char *name; /**< Library name */
429 const char *version; /**< Library version (optional) */
430 } svn_version_ext_loaded_lib_t;
434 * Accessor for svn_version_extended_t.
436 * @return Array of svn_version_ext_loaded_lib_t describing loaded
437 * shared libraries. The returned value may be @c NULL.
439 * @note On Mac OS X, the loaded frameworks, private frameworks and
440 * system libraries will not be listed.
444 const apr_array_header_t *
445 svn_version_ext_loaded_libs(const svn_version_extended_t *ext_info);
450 #endif /* __cplusplus */
452 #endif /* SVN_VERSION_H */