svn_version.h

Go to the documentation of this file.
00001 /**
00002  * @copyright
00003  * ====================================================================
00004  *    Licensed to the Apache Software Foundation (ASF) under one
00005  *    or more contributor license agreements.  See the NOTICE file
00006  *    distributed with this work for additional information
00007  *    regarding copyright ownership.  The ASF licenses this file
00008  *    to you under the Apache License, Version 2.0 (the
00009  *    "License"); you may not use this file except in compliance
00010  *    with the License.  You may obtain a copy of the License at
00011  *
00012  *      http://www.apache.org/licenses/LICENSE-2.0
00013  *
00014  *    Unless required by applicable law or agreed to in writing,
00015  *    software distributed under the License is distributed on an
00016  *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
00017  *    KIND, either express or implied.  See the License for the
00018  *    specific language governing permissions and limitations
00019  *    under the License.
00020  * ====================================================================
00021  * @endcopyright
00022  *
00023  * @file svn_version.h
00024  * @brief Version information.
00025  */
00026 
00027 #ifndef SVN_VERSION_H
00028 #define SVN_VERSION_H
00029 
00030 /* Hack to prevent the resource compiler from including
00031    apr and other headers. */
00032 #ifndef SVN_WIN32_RESOURCE_COMPILATION
00033 #include <apr_general.h>
00034 #include <apr_tables.h>
00035 
00036 #include "svn_types.h"
00037 #endif
00038 
00039 #ifdef __cplusplus
00040 extern "C" {
00041 #endif /* __cplusplus */
00042 
00043 
00044 /* Symbols that define the version number. */
00045 
00046 /* Version numbers: <major>.<minor>.<micro>
00047  *
00048  * The version numbers in this file follow the rules established by:
00049  *
00050  *   http://apr.apache.org/versioning.html
00051  */
00052 
00053 /** Major version number.
00054  *
00055  * Modify when incompatible changes are made to published interfaces.
00056  */
00057 #define SVN_VER_MAJOR      1
00058 
00059 /** Minor version number.
00060  *
00061  * Modify when new functionality is added or new interfaces are
00062  * defined, but all changes are backward compatible.
00063  */
00064 #define SVN_VER_MINOR      9
00065 
00066 /**
00067  * Patch number.
00068  *
00069  * Modify for every released patch.
00070  *
00071  * @since New in 1.1.
00072  */
00073 #define SVN_VER_PATCH      6
00074 
00075 
00076 /** @deprecated Provided for backward compatibility with the 1.0 API. */
00077 #define SVN_VER_MICRO      SVN_VER_PATCH
00078 
00079 /** @deprecated Provided for backward compatibility with the 1.0 API. */
00080 #define SVN_VER_LIBRARY    SVN_VER_MAJOR
00081 
00082 
00083 /** Version tag: a string describing the version.
00084  *
00085  * This tag remains " (under development)" in the repository so that we can
00086  * always see from "svn --version" that the software has been built
00087  * from the repository rather than a "blessed" distribution.
00088  *
00089  * When rolling a tarball, we automatically replace this text with " (r1234)"
00090  * (where 1234 is the last revision on the branch prior to the release)
00091  * for final releases; in prereleases, it becomes " (Alpha 1)",
00092  * " (Beta 1)", etc., as appropriate.
00093  *
00094  * Always change this at the same time as SVN_VER_NUMTAG.
00095  */
00096 #define SVN_VER_TAG        " (r1800392)"
00097 
00098 
00099 /** Number tag: a string describing the version.
00100  *
00101  * This tag is used to generate a version number string to identify
00102  * the client and server in HTTP requests, for example. It must not
00103  * contain any spaces. This value remains "-dev" in the repository.
00104  *
00105  * When rolling a tarball, we automatically replace this text with ""
00106  * for final releases; in prereleases, it becomes "-alpha1, "-beta1",
00107  * etc., as appropriate.
00108  *
00109  * Always change this at the same time as SVN_VER_TAG.
00110  */
00111 #define SVN_VER_NUMTAG     ""
00112 
00113 
00114 /** Revision number: The repository revision number of this release.
00115  *
00116  * This constant is used to generate the build number part of the Windows
00117  * file version. Its value remains 0 in the repository except in release
00118  * tags where it is the revision from which the tag was created.
00119  */
00120 #define SVN_VER_REVISION   1800392
00121 
00122 
00123 /* Version strings composed from the above definitions. */
00124 
00125 /** Version number */
00126 #define SVN_VER_NUM        APR_STRINGIFY(SVN_VER_MAJOR) \
00127                            "." APR_STRINGIFY(SVN_VER_MINOR) \
00128                            "." APR_STRINGIFY(SVN_VER_PATCH)
00129 
00130 /** Version number with tag (contains no whitespace) */
00131 #define SVN_VER_NUMBER     SVN_VER_NUM SVN_VER_NUMTAG
00132 
00133 /** Complete version string */
00134 #define SVN_VERSION        SVN_VER_NUMBER SVN_VER_TAG
00135 
00136 
00137 
00138 /* Version queries and compatibility checks */
00139 
00140 /**
00141  * Version information. Each library contains a function called
00142  * svn_<i>libname</i>_version() that returns a pointer to a statically
00143  * allocated object of this type.
00144  *
00145  * @since New in 1.1.
00146  */
00147 struct svn_version_t
00148 {
00149   int major;                    /**< Major version number */
00150   int minor;                    /**< Minor version number */
00151   int patch;                    /**< Patch number */
00152 
00153   /**
00154    * The version tag (#SVN_VER_NUMTAG). Must always point to a
00155    * statically allocated string.
00156    */
00157   const char *tag;
00158 };
00159 
00160 /**
00161  * Define a static svn_version_t object.
00162  *
00163  * @since New in 1.1.
00164  */
00165 #define SVN_VERSION_DEFINE(name) \
00166   static const svn_version_t name = \
00167     { \
00168       SVN_VER_MAJOR, \
00169       SVN_VER_MINOR, \
00170       SVN_VER_PATCH, \
00171       SVN_VER_NUMTAG \
00172     } \
00173 
00174 /**
00175  * Generate the implementation of a version query function.
00176  *
00177  * @since New in 1.1.
00178  * @since Since 1.9, embeds a string into the compiled object
00179  *        file that can be queried with the 'what' utility.
00180  */
00181 #define SVN_VERSION_BODY            \
00182   static struct versioninfo_t       \
00183     {                               \
00184       const char *const str;        \
00185       const svn_version_t num;      \
00186     } const versioninfo =           \
00187     {                               \
00188       "@(#)" SVN_VERSION,           \
00189       {                             \
00190         SVN_VER_MAJOR,              \
00191         SVN_VER_MINOR,              \
00192         SVN_VER_PATCH,              \
00193         SVN_VER_NUMTAG              \
00194       }                             \
00195     };                              \
00196   return &versioninfo.num
00197 
00198 /**
00199  * Check library version compatibility. Return #TRUE if the client's
00200  * version, given in @a my_version, is compatible with the library
00201  * version, provided in @a lib_version.
00202  *
00203  * This function checks for version compatibility as per our
00204  * guarantees, but requires an exact match when linking to an
00205  * unreleased library. A development client is always compatible with
00206  * a previous released library.
00207  *
00208  * @note Implements the #svn_ver_check_list2.@a comparator interface.
00209  *
00210  * @since New in 1.1.
00211  */
00212 svn_boolean_t
00213 svn_ver_compatible(const svn_version_t *my_version,
00214                    const svn_version_t *lib_version);
00215 
00216 /**
00217  * Check if @a my_version and @a lib_version encode the same version number.
00218  *
00219  * @note Implements the #svn_ver_check_list2.@a comparator interface.
00220  *
00221  * @since New in 1.2.
00222  */
00223 svn_boolean_t
00224 svn_ver_equal(const svn_version_t *my_version,
00225               const svn_version_t *lib_version);
00226 
00227 
00228 /**
00229  * An entry in the compatibility checklist.
00230  * @see svn_ver_check_list()
00231  *
00232  * @since New in 1.1.
00233  */
00234 typedef struct svn_version_checklist_t
00235 {
00236   const char *label;            /**< Entry label */
00237 
00238   /** Version query function for this entry */
00239   const svn_version_t *(*version_query)(void);
00240 } svn_version_checklist_t;
00241 
00242 
00243 /**
00244  * Perform a series of version compatibility checks. Checks if @a
00245  * my_version is compatible with each entry in @a checklist. @a
00246  * checklist must end with an entry whose label is @c NULL.
00247  *
00248  * @a my_version is considered to be compatible with a version in @a checklist
00249  * if @a comparator returns #TRUE when called with @a my_version as the first
00250  * parammeter and the @a checklist version as the second parameter.
00251  *
00252  * @see svn_ver_compatible(), svn_ver_equal()
00253  *
00254  * @note Subversion's own code invariably uses svn_ver_equal() as @a comparator,
00255  * since the cmdline tools sometimes use non-public APIs (such as utility
00256  * functions that haven't been promoted to svn_cmdline.h).  Third-party code
00257  * SHOULD use svn_ver_compatible() as @a comparator.
00258  *
00259  * @since New in 1.9.
00260  */
00261 svn_error_t *
00262 svn_ver_check_list2(const svn_version_t *my_version,
00263                     const svn_version_checklist_t *checklist,
00264                     svn_boolean_t (*comparator)(const svn_version_t *,
00265                                                 const svn_version_t *));
00266 
00267 /** Similar to svn_ver_check_list2(), with @a comparator set to
00268  * #svn_ver_compatible.
00269  *
00270  * @deprecated Provided for backward compatibility with 1.8 API.
00271  */
00272 SVN_DEPRECATED
00273 svn_error_t *
00274 svn_ver_check_list(const svn_version_t *my_version,
00275                    const svn_version_checklist_t *checklist);
00276 
00277 
00278 /**
00279  * Type of function returning library version.
00280  *
00281  * @since New in 1.6.
00282  */
00283 typedef const svn_version_t *(*svn_version_func_t)(void);
00284 
00285 
00286 /* libsvn_subr doesn't have an svn_subr header, so put the prototype here. */
00287 /**
00288  * Get libsvn_subr version information.
00289  *
00290  * @since New in 1.1.
00291  */
00292 const svn_version_t *
00293 svn_subr_version(void);
00294 
00295 
00296 /**
00297  * Extended version information, including info about the running system.
00298  *
00299  * @since New in 1.8.
00300  */
00301 typedef struct svn_version_extended_t svn_version_extended_t;
00302 
00303 /**
00304  * Return version information for the running program.  If @a verbose
00305  * is #TRUE, collect extra information that may be expensive to
00306  * retrieve (for example, the OS release name, list of shared
00307  * libraries, etc.).  Use @a pool for all allocations.
00308  *
00309  * @note This function may allocate significant auxiliary resources
00310  * (memory and file descriptors) in @a pool.  It is recommended to
00311  * copy the returned data to suitable longer-lived memory and clear
00312  * @a pool after calling this function.
00313  *
00314  * @since New in 1.8.
00315  */
00316 const svn_version_extended_t *
00317 svn_version_extended(svn_boolean_t verbose,
00318                      apr_pool_t *pool);
00319 
00320 
00321 /**
00322  * Accessor for svn_version_extended_t.
00323  *
00324  * @return The date when the libsvn_subr library was compiled, in the
00325  * format defined by the C standard macro @c __DATE__.
00326  *
00327  * @since New in 1.8.
00328  */
00329 const char *
00330 svn_version_ext_build_date(const svn_version_extended_t *ext_info);
00331 
00332 /**
00333  * Accessor for svn_version_extended_t.
00334  *
00335  * @return The time when the libsvn_subr library was compiled, in the
00336  * format defined by the C standard macro @c __TIME__.
00337  *
00338  * @since New in 1.8.
00339  */
00340 const char *
00341 svn_version_ext_build_time(const svn_version_extended_t *ext_info);
00342 
00343 /**
00344  * Accessor for svn_version_extended_t.
00345  *
00346  * @return The canonical host triplet (arch-vendor-osname) of the
00347  * system where libsvn_subr was compiled.
00348  *
00349  * @note On Unix-like systems (includng Mac OS X), this string is the
00350  * same as the output of the config.guess script.
00351  *
00352  * @since New in 1.8.
00353  */
00354 const char *
00355 svn_version_ext_build_host(const svn_version_extended_t *ext_info);
00356 
00357 /**
00358  * Accessor for svn_version_extended_t.
00359  *
00360  * @return The localized copyright notice.
00361  *
00362  * @since New in 1.8.
00363  */
00364 const char *
00365 svn_version_ext_copyright(const svn_version_extended_t *ext_info);
00366 
00367 /**
00368  * Accessor for svn_version_extended_t.
00369  *
00370  * @return The canonical host triplet (arch-vendor-osname) of the
00371  * system where the current process is running.
00372  *
00373  * @note This string may not be the same as the output of config.guess
00374  * on the same system.
00375  *
00376  * @since New in 1.8.
00377  */
00378 const char *
00379 svn_version_ext_runtime_host(const svn_version_extended_t *ext_info);
00380 
00381 /**
00382  * Accessor for svn_version_extended_t.
00383  *
00384  * @return The "commercial" release name of the running operating
00385  * system, if available.  Not to be confused with, e.g., the output of
00386  * "uname -v" or "uname -r".  The returned value may be @c NULL.
00387  *
00388  * @since New in 1.8.
00389  */
00390 const char *
00391 svn_version_ext_runtime_osname(const svn_version_extended_t *ext_info);
00392 
00393 /**
00394  * Dependent library information.
00395  * Describes the name and versions of known dependencies
00396  * used by libsvn_subr.
00397  *
00398  * @since New in 1.8.
00399  */
00400 typedef struct svn_version_ext_linked_lib_t
00401 {
00402   const char *name;             /**< Library name */
00403   const char *compiled_version; /**< Compile-time version string */
00404   const char *runtime_version;  /**< Run-time version string (optional) */
00405 } svn_version_ext_linked_lib_t;
00406 
00407 /**
00408  * Accessor for svn_version_extended_t.
00409  *
00410  * @return Array of svn_version_ext_linked_lib_t describing dependent
00411  * libraries.  The returned value may be @c NULL.
00412  *
00413  * @since New in 1.8.
00414  */
00415 const apr_array_header_t *
00416 svn_version_ext_linked_libs(const svn_version_extended_t *ext_info);
00417 
00418 
00419 /**
00420  * Loaded shared library information.
00421  * Describes the name and, where available, version of the shared libraries
00422  * loaded by the running program.
00423  *
00424  * @since New in 1.8.
00425  */
00426 typedef struct svn_version_ext_loaded_lib_t
00427 {
00428   const char *name;             /**< Library name */
00429   const char *version;          /**< Library version (optional) */
00430 } svn_version_ext_loaded_lib_t;
00431 
00432 
00433 /**
00434  * Accessor for svn_version_extended_t.
00435  *
00436  * @return Array of svn_version_ext_loaded_lib_t describing loaded
00437  * shared libraries.  The returned value may be @c NULL.
00438  *
00439  * @note On Mac OS X, the loaded frameworks, private frameworks and
00440  * system libraries will not be listed.
00441  *
00442  * @since New in 1.8.
00443  */
00444 const apr_array_header_t *
00445 svn_version_ext_loaded_libs(const svn_version_extended_t *ext_info);
00446 
00447 
00448 #ifdef __cplusplus
00449 }
00450 #endif /* __cplusplus */
00451 
00452 #endif /* SVN_VERSION_H */

Generated on Tue Jul 18 08:58:12 2017 for Subversion by  doxygen 1.4.7