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 8 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 14 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 " (r1692801)" 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. 00118 * 00119 * When rolling a tarball, we automatically replace it with what we 00120 * guess to be the correct revision number. 00121 */ 00122 #define SVN_VER_REVISION 1692801 00123 00124 00125 /* Version strings composed from the above definitions. */ 00126 00127 /** Version number */ 00128 #define SVN_VER_NUM APR_STRINGIFY(SVN_VER_MAJOR) \ 00129 "." APR_STRINGIFY(SVN_VER_MINOR) \ 00130 "." APR_STRINGIFY(SVN_VER_PATCH) 00131 00132 /** Version number with tag (contains no whitespace) */ 00133 #define SVN_VER_NUMBER SVN_VER_NUM SVN_VER_NUMTAG 00134 00135 /** Complete version string */ 00136 #define SVN_VERSION SVN_VER_NUMBER SVN_VER_TAG 00137 00138 00139 00140 /* Version queries and compatibility checks */ 00141 00142 /** 00143 * Version information. Each library contains a function called 00144 * svn_<i>libname</i>_version() that returns a pointer to a statically 00145 * allocated object of this type. 00146 * 00147 * @since New in 1.1. 00148 */ 00149 struct svn_version_t 00150 { 00151 int major; /**< Major version number */ 00152 int minor; /**< Minor version number */ 00153 int patch; /**< Patch number */ 00154 00155 /** 00156 * The version tag (#SVN_VER_NUMTAG). Must always point to a 00157 * statically allocated string. 00158 */ 00159 const char *tag; 00160 }; 00161 00162 /** 00163 * Define a static svn_version_t object. 00164 * 00165 * @since New in 1.1. 00166 */ 00167 #define SVN_VERSION_DEFINE(name) \ 00168 static const svn_version_t name = \ 00169 { \ 00170 SVN_VER_MAJOR, \ 00171 SVN_VER_MINOR, \ 00172 SVN_VER_PATCH, \ 00173 SVN_VER_NUMTAG \ 00174 } \ 00175 00176 /** 00177 * Generate the implementation of a version query function. 00178 * 00179 * @since New in 1.1. 00180 */ 00181 #define SVN_VERSION_BODY \ 00182 SVN_VERSION_DEFINE(versioninfo); \ 00183 return &versioninfo 00184 00185 /** 00186 * Check library version compatibility. Return #TRUE if the client's 00187 * version, given in @a my_version, is compatible with the library 00188 * version, provided in @a lib_version. 00189 * 00190 * This function checks for version compatibility as per our 00191 * guarantees, but requires an exact match when linking to an 00192 * unreleased library. A development client is always compatible with 00193 * a previous released library. 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 * @since New in 1.2. 00205 */ 00206 svn_boolean_t 00207 svn_ver_equal(const svn_version_t *my_version, 00208 const svn_version_t *lib_version); 00209 00210 00211 /** 00212 * An entry in the compatibility checklist. 00213 * @see svn_ver_check_list() 00214 * 00215 * @since New in 1.1. 00216 */ 00217 typedef struct svn_version_checklist_t 00218 { 00219 const char *label; /**< Entry label */ 00220 00221 /** Version query function for this entry */ 00222 const svn_version_t *(*version_query)(void); 00223 } svn_version_checklist_t; 00224 00225 00226 /** 00227 * Perform a series of version compatibility checks. Checks if @a 00228 * my_version is compatible with each entry in @a checklist. @a 00229 * checklist must end with an entry whose label is @c NULL. 00230 * 00231 * @see svn_ver_compatible() 00232 * 00233 * @since New in 1.1. 00234 */ 00235 svn_error_t * 00236 svn_ver_check_list(const svn_version_t *my_version, 00237 const svn_version_checklist_t *checklist); 00238 00239 00240 /** 00241 * Type of function returning library version. 00242 * 00243 * @since New in 1.6. 00244 */ 00245 typedef const svn_version_t *(*svn_version_func_t)(void); 00246 00247 00248 /* libsvn_subr doesn't have an svn_subr header, so put the prototype here. */ 00249 /** 00250 * Get libsvn_subr version information. 00251 * 00252 * @since New in 1.1. 00253 */ 00254 const svn_version_t * 00255 svn_subr_version(void); 00256 00257 00258 /** 00259 * Extended version information, including info about the running system. 00260 * 00261 * @since New in 1.8. 00262 */ 00263 typedef struct svn_version_extended_t svn_version_extended_t; 00264 00265 /** 00266 * Return version information for the running program. If @a verbose 00267 * is #TRUE, collect extra information that may be expensive to 00268 * retrieve (for example, the OS release name, list of shared 00269 * libraries, etc.). Use @a pool for all allocations. 00270 * 00271 * @since New in 1.8. 00272 */ 00273 const svn_version_extended_t * 00274 svn_version_extended(svn_boolean_t verbose, 00275 apr_pool_t *pool); 00276 00277 00278 /** 00279 * Accessor for svn_version_extended_t. 00280 * 00281 * @return The date when the libsvn_subr library was compiled, in the 00282 * format defined by the C standard macro @c __DATE__. 00283 * 00284 * @since New in 1.8. 00285 */ 00286 const char * 00287 svn_version_ext_build_date(const svn_version_extended_t *ext_info); 00288 00289 /** 00290 * Accessor for svn_version_extended_t. 00291 * 00292 * @return The time when the libsvn_subr library was compiled, in the 00293 * format defined by the C standard macro @c __TIME__. 00294 * 00295 * @since New in 1.8. 00296 */ 00297 const char * 00298 svn_version_ext_build_time(const svn_version_extended_t *ext_info); 00299 00300 /** 00301 * Accessor for svn_version_extended_t. 00302 * 00303 * @return The canonical host triplet (arch-vendor-osname) of the 00304 * system where libsvn_subr was compiled. 00305 * 00306 * @note On Unix-like systems (includng Mac OS X), this string is the 00307 * same as the output of the config.guess script. 00308 * 00309 * @since New in 1.8. 00310 */ 00311 const char * 00312 svn_version_ext_build_host(const svn_version_extended_t *ext_info); 00313 00314 /** 00315 * Accessor for svn_version_extended_t. 00316 * 00317 * @return The localized copyright notice. 00318 * 00319 * @since New in 1.8. 00320 */ 00321 const char * 00322 svn_version_ext_copyright(const svn_version_extended_t *ext_info); 00323 00324 /** 00325 * Accessor for svn_version_extended_t. 00326 * 00327 * @return The canonical host triplet (arch-vendor-osname) of the 00328 * system where the current process is running. 00329 * 00330 * @note This string may not be the same as the output of config.guess 00331 * on the same system. 00332 * 00333 * @since New in 1.8. 00334 */ 00335 const char * 00336 svn_version_ext_runtime_host(const svn_version_extended_t *ext_info); 00337 00338 /** 00339 * Accessor for svn_version_extended_t. 00340 * 00341 * @return The "commercial" release name of the running operating 00342 * system, if available. Not to be confused with, e.g., the output of 00343 * "uname -v" or "uname -r". The returned value may be @c NULL. 00344 * 00345 * @since New in 1.8. 00346 */ 00347 const char * 00348 svn_version_ext_runtime_osname(const svn_version_extended_t *ext_info); 00349 00350 /** 00351 * Dependent library information. 00352 * Describes the name and versions of known dependencies 00353 * used by libsvn_subr. 00354 * 00355 * @since New in 1.8. 00356 */ 00357 typedef struct svn_version_ext_linked_lib_t 00358 { 00359 const char *name; /**< Library name */ 00360 const char *compiled_version; /**< Compile-time version string */ 00361 const char *runtime_version; /**< Run-time version string (optional) */ 00362 } svn_version_ext_linked_lib_t; 00363 00364 /** 00365 * Accessor for svn_version_extended_t. 00366 * 00367 * @return Array of svn_version_ext_linked_lib_t describing dependent 00368 * libraries. The returned value may be @c NULL. 00369 * 00370 * @since New in 1.8. 00371 */ 00372 const apr_array_header_t * 00373 svn_version_ext_linked_libs(const svn_version_extended_t *ext_info); 00374 00375 00376 /** 00377 * Loaded shared library information. 00378 * Describes the name and, where available, version of the shared libraries 00379 * loaded by the running program. 00380 * 00381 * @since New in 1.8. 00382 */ 00383 typedef struct svn_version_ext_loaded_lib_t 00384 { 00385 const char *name; /**< Library name */ 00386 const char *version; /**< Library version (optional) */ 00387 } svn_version_ext_loaded_lib_t; 00388 00389 00390 /** 00391 * Accessor for svn_version_extended_t. 00392 * 00393 * @return Array of svn_version_ext_loaded_lib_t describing loaded 00394 * shared libraries. The returned value may be @c NULL. 00395 * 00396 * @note On Mac OS X, the loaded frameworks, private frameworks and 00397 * system libraries will not be listed. 00398 * 00399 * @since New in 1.8. 00400 */ 00401 const apr_array_header_t * 00402 svn_version_ext_loaded_libs(const svn_version_extended_t *ext_info); 00403 00404 00405 #ifdef __cplusplus 00406 } 00407 #endif /* __cplusplus */ 00408 00409 #endif /* SVN_VERSION_H */