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_general.h.  It doesn't resolve the include paths
00032    correctly and blows up without this.
00033  */
00034 #ifndef APR_STRINGIFY
00035 #include <apr_general.h>
00036 #endif
00037 #include <apr_tables.h>
00038 
00039 #include "svn_types.h"
00040 
00041 #ifdef __cplusplus
00042 extern "C" {
00043 #endif /* __cplusplus */
00044 
00045 
00046 /* Symbols that define the version number. */
00047 
00048 /* Version numbers: <major>.<minor>.<micro>
00049  *
00050  * The version numbers in this file follow the rules established by:
00051  *
00052  *   http://apr.apache.org/versioning.html
00053  */
00054 
00055 /** Major version number.
00056  *
00057  * Modify when incompatible changes are made to published interfaces.
00058  */
00059 #define SVN_VER_MAJOR      1
00060 
00061 /** Minor version number.
00062  *
00063  * Modify when new functionality is added or new interfaces are
00064  * defined, but all changes are backward compatible.
00065  */
00066 #define SVN_VER_MINOR      8
00067 
00068 /**
00069  * Patch number.
00070  *
00071  * Modify for every released patch.
00072  *
00073  * @since New in 1.1.
00074  */
00075 #define SVN_VER_PATCH      4
00076 
00077 
00078 /** @deprecated Provided for backward compatibility with the 1.0 API. */
00079 #define SVN_VER_MICRO      SVN_VER_PATCH
00080 
00081 /** @deprecated Provided for backward compatibility with the 1.0 API. */
00082 #define SVN_VER_LIBRARY    SVN_VER_MAJOR
00083 
00084 
00085 /** Version tag: a string describing the version.
00086  *
00087  * This tag remains " (dev build)" in the repository so that we can
00088  * always see from "svn --version" that the software has been built
00089  * from the repository rather than a "blessed" distribution.
00090  *
00091  * When rolling a tarball, we automatically replace this text with " (r1234)"
00092  * (where 1234 is the last revision on the branch prior to the release)
00093  * for final releases; in prereleases, it becomes " (Alpha 1)",
00094  * " (Beta 1)", etc., as appropriate.
00095  *
00096  * Always change this at the same time as SVN_VER_NUMTAG.
00097  */
00098 #define SVN_VER_TAG        " (r1534716)"
00099 
00100 
00101 /** Number tag: a string describing the version.
00102  *
00103  * This tag is used to generate a version number string to identify
00104  * the client and server in HTTP requests, for example. It must not
00105  * contain any spaces. This value remains "-dev" in the repository.
00106  *
00107  * When rolling a tarball, we automatically replace this text with ""
00108  * for final releases; in prereleases, it becomes "-alpha1, "-beta1",
00109  * etc., as appropriate.
00110  *
00111  * Always change this at the same time as SVN_VER_TAG.
00112  */
00113 #define SVN_VER_NUMTAG     ""
00114 
00115 
00116 /** Revision number: The repository revision number of this release.
00117  *
00118  * This constant is used to generate the build number part of the Windows
00119  * file version. Its value remains 0 in the repository.
00120  *
00121  * When rolling a tarball, we automatically replace it with what we
00122  * guess to be the correct revision number.
00123  */
00124 #define SVN_VER_REVISION   1534716
00125 
00126 
00127 /* Version strings composed from the above definitions. */
00128 
00129 /** Version number */
00130 #define SVN_VER_NUM        APR_STRINGIFY(SVN_VER_MAJOR) \
00131                            "." APR_STRINGIFY(SVN_VER_MINOR) \
00132                            "." APR_STRINGIFY(SVN_VER_PATCH)
00133 
00134 /** Version number with tag (contains no whitespace) */
00135 #define SVN_VER_NUMBER     SVN_VER_NUM SVN_VER_NUMTAG
00136 
00137 /** Complete version string */
00138 #define SVN_VERSION        SVN_VER_NUMBER SVN_VER_TAG
00139 
00140 
00141 
00142 /* Version queries and compatibility checks */
00143 
00144 /**
00145  * Version information. Each library contains a function called
00146  * svn_<i>libname</i>_version() that returns a pointer to a statically
00147  * allocated object of this type.
00148  *
00149  * @since New in 1.1.
00150  */
00151 struct svn_version_t
00152 {
00153   int major;                    /**< Major version number */
00154   int minor;                    /**< Minor version number */
00155   int patch;                    /**< Patch number */
00156 
00157   /**
00158    * The version tag (#SVN_VER_NUMTAG). Must always point to a
00159    * statically allocated string.
00160    */
00161   const char *tag;
00162 };
00163 
00164 /**
00165  * Define a static svn_version_t object.
00166  *
00167  * @since New in 1.1.
00168  */
00169 #define SVN_VERSION_DEFINE(name) \
00170   static const svn_version_t name = \
00171     { \
00172       SVN_VER_MAJOR, \
00173       SVN_VER_MINOR, \
00174       SVN_VER_PATCH, \
00175       SVN_VER_NUMTAG \
00176     } \
00177 
00178 /**
00179  * Generate the implementation of a version query function.
00180  *
00181  * @since New in 1.1.
00182  */
00183 #define SVN_VERSION_BODY \
00184   SVN_VERSION_DEFINE(versioninfo);              \
00185   return &versioninfo
00186 
00187 /**
00188  * Check library version compatibility. Return #TRUE if the client's
00189  * version, given in @a my_version, is compatible with the library
00190  * version, provided in @a lib_version.
00191  *
00192  * This function checks for version compatibility as per our
00193  * guarantees, but requires an exact match when linking to an
00194  * unreleased library. A development client is always compatible with
00195  * a previous released library.
00196  *
00197  * @since New in 1.1.
00198  */
00199 svn_boolean_t
00200 svn_ver_compatible(const svn_version_t *my_version,
00201                    const svn_version_t *lib_version);
00202 
00203 /**
00204  * Check if @a my_version and @a lib_version encode the same version number.
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  * @see svn_ver_compatible()
00234  *
00235  * @since New in 1.1.
00236  */
00237 svn_error_t *
00238 svn_ver_check_list(const svn_version_t *my_version,
00239                    const svn_version_checklist_t *checklist);
00240 
00241 
00242 /**
00243  * Type of function returning library version.
00244  *
00245  * @since New in 1.6.
00246  */
00247 typedef const svn_version_t *(*svn_version_func_t)(void);
00248 
00249 
00250 /* libsvn_subr doesn't have an svn_subr header, so put the prototype here. */
00251 /**
00252  * Get libsvn_subr version information.
00253  *
00254  * @since New in 1.1.
00255  */
00256 const svn_version_t *
00257 svn_subr_version(void);
00258 
00259 
00260 /**
00261  * Extended version information, including info about the running system.
00262  *
00263  * @since New in 1.8.
00264  */
00265 typedef struct svn_version_extended_t svn_version_extended_t;
00266 
00267 /**
00268  * Return version information for the running program.  If @a verbose
00269  * is #TRUE, collect extra information that may be expensive to
00270  * retrieve (for example, the OS release name, list of shared
00271  * libraries, etc.).  Use @a pool for all allocations.
00272  *
00273  * @since New in 1.8.
00274  */
00275 const svn_version_extended_t *
00276 svn_version_extended(svn_boolean_t verbose,
00277                      apr_pool_t *pool);
00278 
00279 
00280 /**
00281  * Accessor for svn_version_extended_t.
00282  *
00283  * @return The date when the libsvn_subr library was compiled, in the
00284  * format defined by the C standard macro @c __DATE__.
00285  *
00286  * @since New in 1.8.
00287  */
00288 const char *
00289 svn_version_ext_build_date(const svn_version_extended_t *ext_info);
00290 
00291 /**
00292  * Accessor for svn_version_extended_t.
00293  *
00294  * @return The time when the libsvn_subr library was compiled, in the
00295  * format defined by the C standard macro @c __TIME__.
00296  *
00297  * @since New in 1.8.
00298  */
00299 const char *
00300 svn_version_ext_build_time(const svn_version_extended_t *ext_info);
00301 
00302 /**
00303  * Accessor for svn_version_extended_t.
00304  *
00305  * @return The canonical host triplet (arch-vendor-osname) of the
00306  * system where libsvn_subr was compiled.
00307  *
00308  * @note On Unix-like systems (includng Mac OS X), this string is the
00309  * same as the output of the config.guess script.
00310  *
00311  * @since New in 1.8.
00312  */
00313 const char *
00314 svn_version_ext_build_host(const svn_version_extended_t *ext_info);
00315 
00316 /**
00317  * Accessor for svn_version_extended_t.
00318  *
00319  * @return The localized copyright notice.
00320  *
00321  * @since New in 1.8.
00322  */
00323 const char *
00324 svn_version_ext_copyright(const svn_version_extended_t *ext_info);
00325 
00326 /**
00327  * Accessor for svn_version_extended_t.
00328  *
00329  * @return The canonical host triplet (arch-vendor-osname) of the
00330  * system where the current process is running.
00331  *
00332  * @note This string may not be the same as the output of config.guess
00333  * on the same system.
00334  *
00335  * @since New in 1.8.
00336  */
00337 const char *
00338 svn_version_ext_runtime_host(const svn_version_extended_t *ext_info);
00339 
00340 /**
00341  * Accessor for svn_version_extended_t.
00342  *
00343  * @return The "commercial" release name of the running operating
00344  * system, if available.  Not to be confused with, e.g., the output of
00345  * "uname -v" or "uname -r".  The returned value may be @c NULL.
00346  *
00347  * @since New in 1.8.
00348  */
00349 const char *
00350 svn_version_ext_runtime_osname(const svn_version_extended_t *ext_info);
00351 
00352 /**
00353  * Dependent library information.
00354  * Describes the name and versions of known dependencies
00355  * used by libsvn_subr.
00356  *
00357  * @since New in 1.8.
00358  */
00359 typedef struct svn_version_ext_linked_lib_t
00360 {
00361   const char *name;             /**< Library name */
00362   const char *compiled_version; /**< Compile-time version string */
00363   const char *runtime_version;  /**< Run-time version string (optional) */
00364 } svn_version_ext_linked_lib_t;
00365 
00366 /**
00367  * Accessor for svn_version_extended_t.
00368  *
00369  * @return Array of svn_version_ext_linked_lib_t describing dependent
00370  * libraries.  The returned value may be @c NULL.
00371  *
00372  * @since New in 1.8.
00373  */
00374 const apr_array_header_t *
00375 svn_version_ext_linked_libs(const svn_version_extended_t *ext_info);
00376 
00377 
00378 /**
00379  * Loaded shared library information.
00380  * Describes the name and, where available, version of the shared libraries
00381  * loaded by the running program.
00382  *
00383  * @since New in 1.8.
00384  */
00385 typedef struct svn_version_ext_loaded_lib_t
00386 {
00387   const char *name;             /**< Library name */
00388   const char *version;          /**< Library version (optional) */
00389 } svn_version_ext_loaded_lib_t;
00390 
00391 
00392 /**
00393  * Accessor for svn_version_extended_t.
00394  *
00395  * @return Array of svn_version_ext_loaded_lib_t describing loaded
00396  * shared libraries.  The returned value may be @c NULL.
00397  *
00398  * @note On Mac OS X, the loaded frameworks, private frameworks and
00399  * system libraries will not be listed.
00400  *
00401  * @since New in 1.8.
00402  */
00403 const apr_array_header_t *
00404 svn_version_ext_loaded_libs(const svn_version_extended_t *ext_info);
00405 
00406 
00407 #ifdef __cplusplus
00408 }
00409 #endif /* __cplusplus */
00410 
00411 #endif /* SVN_VERSION_H */

Generated on Fri Nov 1 15:57:36 2013 for Subversion by  doxygen 1.4.7