Subversion
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
svn_version.h
Go to the documentation of this file.
1 /**
2  * @copyright
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
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
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
19  * under the License.
20  * ====================================================================
21  * @endcopyright
22  *
23  * @file svn_version.h
24  * @brief Version information.
25  */
26 
27 #ifndef SVN_VERSION_H
28 #define SVN_VERSION_H
29 
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>
35 
36 #include "svn_types.h"
37 #endif
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif /* __cplusplus */
42 
43 
44 /* Symbols that define the version number. */
45 
46 /* Version numbers: <major>.<minor>.<micro>
47  *
48  * The version numbers in this file follow the rules established by:
49  *
50  * http://apr.apache.org/versioning.html
51  */
52 
53 /** Major version number.
54  *
55  * Modify when incompatible changes are made to published interfaces.
56  */
57 #define SVN_VER_MAJOR 1
58 
59 /** Minor version number.
60  *
61  * Modify when new functionality is added or new interfaces are
62  * defined, but all changes are backward compatible.
63  */
64 #define SVN_VER_MINOR 8
65 
66 /**
67  * Patch number.
68  *
69  * Modify for every released patch.
70  *
71  * @since New in 1.1.
72  */
73 #define SVN_VER_PATCH 15
74 
75 
76 /** @deprecated Provided for backward compatibility with the 1.0 API. */
77 #define SVN_VER_MICRO SVN_VER_PATCH
78 
79 /** @deprecated Provided for backward compatibility with the 1.0 API. */
80 #define SVN_VER_LIBRARY SVN_VER_MAJOR
81 
82 
83 /** Version tag: a string describing the version.
84  *
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.
88  *
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.
93  *
94  * Always change this at the same time as SVN_VER_NUMTAG.
95  */
96 #define SVN_VER_TAG " (under development)"
97 
98 
99 /** Number tag: a string describing the version.
100  *
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.
104  *
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.
108  *
109  * Always change this at the same time as SVN_VER_TAG.
110  */
111 #define SVN_VER_NUMTAG "-dev"
112 
113 
114 /** Revision number: The repository revision number of this release.
115  *
116  * This constant is used to generate the build number part of the Windows
117  * file version. Its value remains 0 in the repository.
118  *
119  * When rolling a tarball, we automatically replace it with what we
120  * guess to be the correct revision number.
121  */
122 #define SVN_VER_REVISION 0
123 
124 
125 /* Version strings composed from the above definitions. */
126 
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)
131 
132 /** Version number with tag (contains no whitespace) */
133 #define SVN_VER_NUMBER SVN_VER_NUM SVN_VER_NUMTAG
134 
135 /** Complete version string */
136 #define SVN_VERSION SVN_VER_NUMBER SVN_VER_TAG
137 
138 
139 
140 /* Version queries and compatibility checks */
141 
142 /**
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.
146  *
147  * @since New in 1.1.
148  */
150 {
151  int major; /**< Major version number */
152  int minor; /**< Minor version number */
153  int patch; /**< Patch number */
154 
155  /**
156  * The version tag (#SVN_VER_NUMTAG). Must always point to a
157  * statically allocated string.
158  */
159  const char *tag;
160 };
161 
162 /**
163  * Define a static svn_version_t object.
164  *
165  * @since New in 1.1.
166  */
167 #define SVN_VERSION_DEFINE(name) \
168  static const svn_version_t name = \
169  { \
170  SVN_VER_MAJOR, \
171  SVN_VER_MINOR, \
172  SVN_VER_PATCH, \
173  SVN_VER_NUMTAG \
174  } \
175 
176 /**
177  * Generate the implementation of a version query function.
178  *
179  * @since New in 1.1.
180  */
181 #define SVN_VERSION_BODY \
182  SVN_VERSION_DEFINE(versioninfo); \
183  return &versioninfo
184 
185 /**
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.
189  *
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.
194  *
195  * @since New in 1.1.
196  */
198 svn_ver_compatible(const svn_version_t *my_version,
199  const svn_version_t *lib_version);
200 
201 /**
202  * Check if @a my_version and @a lib_version encode the same version number.
203  *
204  * @since New in 1.2.
205  */
207 svn_ver_equal(const svn_version_t *my_version,
208  const svn_version_t *lib_version);
209 
210 
211 /**
212  * An entry in the compatibility checklist.
213  * @see svn_ver_check_list()
214  *
215  * @since New in 1.1.
216  */
218 {
219  const char *label; /**< Entry label */
220 
221  /** Version query function for this entry */
222  const svn_version_t *(*version_query)(void);
224 
225 
226 /**
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.
230  *
231  * @see svn_ver_compatible()
232  *
233  * @since New in 1.1.
234  */
235 svn_error_t *
236 svn_ver_check_list(const svn_version_t *my_version,
237  const svn_version_checklist_t *checklist);
238 
239 
240 /**
241  * Type of function returning library version.
242  *
243  * @since New in 1.6.
244  */
245 typedef const svn_version_t *(*svn_version_func_t)(void);
246 
247 
248 /* libsvn_subr doesn't have an svn_subr header, so put the prototype here. */
249 /**
250  * Get libsvn_subr version information.
251  *
252  * @since New in 1.1.
253  */
254 const svn_version_t *
255 svn_subr_version(void);
256 
257 
258 /**
259  * Extended version information, including info about the running system.
260  *
261  * @since New in 1.8.
262  */
264 
265 /**
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.
270  *
271  * @since New in 1.8.
272  */
275  apr_pool_t *pool);
276 
277 
278 /**
279  * Accessor for svn_version_extended_t.
280  *
281  * @return The date when the libsvn_subr library was compiled, in the
282  * format defined by the C standard macro @c __DATE__.
283  *
284  * @since New in 1.8.
285  */
286 const char *
288 
289 /**
290  * Accessor for svn_version_extended_t.
291  *
292  * @return The time when the libsvn_subr library was compiled, in the
293  * format defined by the C standard macro @c __TIME__.
294  *
295  * @since New in 1.8.
296  */
297 const char *
299 
300 /**
301  * Accessor for svn_version_extended_t.
302  *
303  * @return The canonical host triplet (arch-vendor-osname) of the
304  * system where libsvn_subr was compiled.
305  *
306  * @note On Unix-like systems (includng Mac OS X), this string is the
307  * same as the output of the config.guess script.
308  *
309  * @since New in 1.8.
310  */
311 const char *
313 
314 /**
315  * Accessor for svn_version_extended_t.
316  *
317  * @return The localized copyright notice.
318  *
319  * @since New in 1.8.
320  */
321 const char *
323 
324 /**
325  * Accessor for svn_version_extended_t.
326  *
327  * @return The canonical host triplet (arch-vendor-osname) of the
328  * system where the current process is running.
329  *
330  * @note This string may not be the same as the output of config.guess
331  * on the same system.
332  *
333  * @since New in 1.8.
334  */
335 const char *
337 
338 /**
339  * Accessor for svn_version_extended_t.
340  *
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.
344  *
345  * @since New in 1.8.
346  */
347 const char *
349 
350 /**
351  * Dependent library information.
352  * Describes the name and versions of known dependencies
353  * used by libsvn_subr.
354  *
355  * @since New in 1.8.
356  */
358 {
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) */
363 
364 /**
365  * Accessor for svn_version_extended_t.
366  *
367  * @return Array of svn_version_ext_linked_lib_t describing dependent
368  * libraries. The returned value may be @c NULL.
369  *
370  * @since New in 1.8.
371  */
372 const apr_array_header_t *
374 
375 
376 /**
377  * Loaded shared library information.
378  * Describes the name and, where available, version of the shared libraries
379  * loaded by the running program.
380  *
381  * @since New in 1.8.
382  */
384 {
385  const char *name; /**< Library name */
386  const char *version; /**< Library version (optional) */
388 
389 
390 /**
391  * Accessor for svn_version_extended_t.
392  *
393  * @return Array of svn_version_ext_loaded_lib_t describing loaded
394  * shared libraries. The returned value may be @c NULL.
395  *
396  * @note On Mac OS X, the loaded frameworks, private frameworks and
397  * system libraries will not be listed.
398  *
399  * @since New in 1.8.
400  */
401 const apr_array_header_t *
403 
404 
405 #ifdef __cplusplus
406 }
407 #endif /* __cplusplus */
408 
409 #endif /* SVN_VERSION_H */
int minor
Minor version number.
Definition: svn_version.h:152
const char * name
Library name.
Definition: svn_version.h:359
struct svn_version_checklist_t svn_version_checklist_t
An entry in the compatibility checklist.
An entry in the compatibility checklist.
Definition: svn_version.h:217
const apr_array_header_t * svn_version_ext_linked_libs(const svn_version_extended_t *ext_info)
Accessor for svn_version_extended_t.
svn_boolean_t svn_ver_equal(const svn_version_t *my_version, const svn_version_t *lib_version)
Check if my_version and lib_version encode the same version number.
struct svn_version_ext_loaded_lib_t svn_version_ext_loaded_lib_t
Loaded shared library information.
const char * tag
The version tag (SVN_VER_NUMTAG).
Definition: svn_version.h:159
const char * svn_version_ext_runtime_host(const svn_version_extended_t *ext_info)
Accessor for svn_version_extended_t.
svn_boolean_t svn_ver_compatible(const svn_version_t *my_version, const svn_version_t *lib_version)
Check library version compatibility.
const svn_version_extended_t * svn_version_extended(svn_boolean_t verbose, apr_pool_t *pool)
Return version information for the running program.
const svn_version_t * svn_subr_version(void)
Get libsvn_subr version information.
Subversion error object.
Definition: svn_types.h:113
svn_error_t * svn_ver_check_list(const svn_version_t *my_version, const svn_version_checklist_t *checklist)
Perform a series of version compatibility checks.
const char * svn_version_ext_build_date(const svn_version_extended_t *ext_info)
Accessor for svn_version_extended_t.
const char * version
Library version (optional)
Definition: svn_version.h:386
Loaded shared library information.
Definition: svn_version.h:383
Version information.
Definition: svn_version.h:149
const char * svn_version_ext_build_host(const svn_version_extended_t *ext_info)
Accessor for svn_version_extended_t.
const char * svn_version_ext_runtime_osname(const svn_version_extended_t *ext_info)
Accessor for svn_version_extended_t.
Subversion&#39;s data types.
const char * compiled_version
Compile-time version string.
Definition: svn_version.h:360
const char * runtime_version
Run-time version string (optional)
Definition: svn_version.h:361
struct svn_version_ext_linked_lib_t svn_version_ext_linked_lib_t
Dependent library information.
const apr_array_header_t * svn_version_ext_loaded_libs(const svn_version_extended_t *ext_info)
Accessor for svn_version_extended_t.
int major
Major version number.
Definition: svn_version.h:151
const char * label
Entry label.
Definition: svn_version.h:219
struct svn_version_extended_t svn_version_extended_t
Extended version information, including info about the running system.
Definition: svn_version.h:263
int svn_boolean_t
YABT: Yet Another Boolean Type.
Definition: svn_types.h:94
const char * svn_version_ext_build_time(const svn_version_extended_t *ext_info)
Accessor for svn_version_extended_t.
int patch
Patch number.
Definition: svn_version.h:153
Dependent library information.
Definition: svn_version.h:357
const char * name
Library name.
Definition: svn_version.h:385
const char * svn_version_ext_copyright(const svn_version_extended_t *ext_info)
Accessor for svn_version_extended_t.