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      0
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 " (dev build)" 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        " (Alpha 2)"
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     "-alpha2"
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   1573927
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  */
00179 #define SVN_VERSION_BODY \
00180   SVN_VERSION_DEFINE(versioninfo);              \
00181   return &versioninfo
00182 
00183 /**
00184  * Check library version compatibility. Return #TRUE if the client's
00185  * version, given in @a my_version, is compatible with the library
00186  * version, provided in @a lib_version.
00187  *
00188  * This function checks for version compatibility as per our
00189  * guarantees, but requires an exact match when linking to an
00190  * unreleased library. A development client is always compatible with
00191  * a previous released library.
00192  *
00193  * @note Implements the #svn_ver_check_list2.@a comparator interface.
00194  *
00195  * @since New in 1.1.
00196  */
00197 svn_boolean_t
00198 svn_ver_compatible(const svn_version_t *my_version,
00199                    const svn_version_t *lib_version);
00200 
00201 /**
00202  * Check if @a my_version and @a lib_version encode the same version number.
00203  *
00204  * @note Implements the #svn_ver_check_list2.@a comparator interface.
00205  *
00206  * @since New in 1.2.
00207  */
00208 svn_boolean_t
00209 svn_ver_equal(const svn_version_t *my_version,
00210               const svn_version_t *lib_version);
00211 
00212 
00213 /**
00214  * An entry in the compatibility checklist.
00215  * @see svn_ver_check_list()
00216  *
00217  * @since New in 1.1.
00218  */
00219 typedef struct svn_version_checklist_t
00220 {
00221   const char *label;            /**< Entry label */
00222 
00223   /** Version query function for this entry */
00224   const svn_version_t *(*version_query)(void);
00225 } svn_version_checklist_t;
00226 
00227 
00228 /**
00229  * Perform a series of version compatibility checks. Checks if @a
00230  * my_version is compatible with each entry in @a checklist. @a
00231  * checklist must end with an entry whose label is @c NULL.
00232  *
00233  * @a my_version is considered to be compatible with a version in @a checklist
00234  * if @a comparator returns #TRUE when called with @a my_version as the first
00235  * parammeter and the @a checklist version as the second parameter.
00236  *
00237  * @see svn_ver_compatible(), svn_ver_equal()
00238  *
00239  * @note Subversion's own code invariably uses svn_ver_equal() as @a comparator,
00240  * since the cmdline tools sometimes use non-public APIs (such as utility
00241  * functions that haven't been promoted to svn_cmdline.h).  Third-party code
00242  * SHOULD use svn_ver_compatible() as @a comparator.
00243  *
00244  * @since New in 1.9.
00245  */
00246 svn_error_t *
00247 svn_ver_check_list2(const svn_version_t *my_version,
00248                     const svn_version_checklist_t *checklist,
00249                     svn_boolean_t (*comparator)(const svn_version_t *,
00250                                                 const svn_version_t *));
00251 
00252 /** Similar to svn_ver_check_list2(), with @a comparator set to
00253  * #svn_ver_compatible.
00254  *
00255  * @deprecated Provided for backward compatibility with 1.8 API.
00256  */
00257 SVN_DEPRECATED
00258 svn_error_t *
00259 svn_ver_check_list(const svn_version_t *my_version,
00260                    const svn_version_checklist_t *checklist);
00261 
00262 
00263 /**
00264  * Type of function returning library version.
00265  *
00266  * @since New in 1.6.
00267  */
00268 typedef const svn_version_t *(*svn_version_func_t)(void);
00269 
00270 
00271 /* libsvn_subr doesn't have an svn_subr header, so put the prototype here. */
00272 /**
00273  * Get libsvn_subr version information.
00274  *
00275  * @since New in 1.1.
00276  */
00277 const svn_version_t *
00278 svn_subr_version(void);
00279 
00280 
00281 /**
00282  * Extended version information, including info about the running system.
00283  *
00284  * @since New in 1.8.
00285  */
00286 typedef struct svn_version_extended_t svn_version_extended_t;
00287 
00288 /**
00289  * Return version information for the running program.  If @a verbose
00290  * is #TRUE, collect extra information that may be expensive to
00291  * retrieve (for example, the OS release name, list of shared
00292  * libraries, etc.).  Use @a pool for all allocations.
00293  *
00294  * @since New in 1.8.
00295  */
00296 const svn_version_extended_t *
00297 svn_version_extended(svn_boolean_t verbose,
00298                      apr_pool_t *pool);
00299 
00300 
00301 /**
00302  * Accessor for svn_version_extended_t.
00303  *
00304  * @return The date when the libsvn_subr library was compiled, in the
00305  * format defined by the C standard macro @c __DATE__.
00306  *
00307  * @since New in 1.8.
00308  */
00309 const char *
00310 svn_version_ext_build_date(const svn_version_extended_t *ext_info);
00311 
00312 /**
00313  * Accessor for svn_version_extended_t.
00314  *
00315  * @return The time when the libsvn_subr library was compiled, in the
00316  * format defined by the C standard macro @c __TIME__.
00317  *
00318  * @since New in 1.8.
00319  */
00320 const char *
00321 svn_version_ext_build_time(const svn_version_extended_t *ext_info);
00322 
00323 /**
00324  * Accessor for svn_version_extended_t.
00325  *
00326  * @return The canonical host triplet (arch-vendor-osname) of the
00327  * system where libsvn_subr was compiled.
00328  *
00329  * @note On Unix-like systems (includng Mac OS X), this string is the
00330  * same as the output of the config.guess script.
00331  *
00332  * @since New in 1.8.
00333  */
00334 const char *
00335 svn_version_ext_build_host(const svn_version_extended_t *ext_info);
00336 
00337 /**
00338  * Accessor for svn_version_extended_t.
00339  *
00340  * @return The localized copyright notice.
00341  *
00342  * @since New in 1.8.
00343  */
00344 const char *
00345 svn_version_ext_copyright(const svn_version_extended_t *ext_info);
00346 
00347 /**
00348  * Accessor for svn_version_extended_t.
00349  *
00350  * @return The canonical host triplet (arch-vendor-osname) of the
00351  * system where the current process is running.
00352  *
00353  * @note This string may not be the same as the output of config.guess
00354  * on the same system.
00355  *
00356  * @since New in 1.8.
00357  */
00358 const char *
00359 svn_version_ext_runtime_host(const svn_version_extended_t *ext_info);
00360 
00361 /**
00362  * Accessor for svn_version_extended_t.
00363  *
00364  * @return The "commercial" release name of the running operating
00365  * system, if available.  Not to be confused with, e.g., the output of
00366  * "uname -v" or "uname -r".  The returned value may be @c NULL.
00367  *
00368  * @since New in 1.8.
00369  */
00370 const char *
00371 svn_version_ext_runtime_osname(const svn_version_extended_t *ext_info);
00372 
00373 /**
00374  * Dependent library information.
00375  * Describes the name and versions of known dependencies
00376  * used by libsvn_subr.
00377  *
00378  * @since New in 1.8.
00379  */
00380 typedef struct svn_version_ext_linked_lib_t
00381 {
00382   const char *name;             /**< Library name */
00383   const char *compiled_version; /**< Compile-time version string */
00384   const char *runtime_version;  /**< Run-time version string (optional) */
00385 } svn_version_ext_linked_lib_t;
00386 
00387 /**
00388  * Accessor for svn_version_extended_t.
00389  *
00390  * @return Array of svn_version_ext_linked_lib_t describing dependent
00391  * libraries.  The returned value may be @c NULL.
00392  *
00393  * @since New in 1.8.
00394  */
00395 const apr_array_header_t *
00396 svn_version_ext_linked_libs(const svn_version_extended_t *ext_info);
00397 
00398 
00399 /**
00400  * Loaded shared library information.
00401  * Describes the name and, where available, version of the shared libraries
00402  * loaded by the running program.
00403  *
00404  * @since New in 1.8.
00405  */
00406 typedef struct svn_version_ext_loaded_lib_t
00407 {
00408   const char *name;             /**< Library name */
00409   const char *version;          /**< Library version (optional) */
00410 } svn_version_ext_loaded_lib_t;
00411 
00412 
00413 /**
00414  * Accessor for svn_version_extended_t.
00415  *
00416  * @return Array of svn_version_ext_loaded_lib_t describing loaded
00417  * shared libraries.  The returned value may be @c NULL.
00418  *
00419  * @note On Mac OS X, the loaded frameworks, private frameworks and
00420  * system libraries will not be listed.
00421  *
00422  * @since New in 1.8.
00423  */
00424 const apr_array_header_t *
00425 svn_version_ext_loaded_libs(const svn_version_extended_t *ext_info);
00426 
00427 
00428 #ifdef __cplusplus
00429 }
00430 #endif /* __cplusplus */
00431 
00432 #endif /* SVN_VERSION_H */

Generated on Mon Mar 17 15:45:52 2014 for Subversion by  doxygen 1.4.7