Subversion 1.6.16
|
00001 /** 00002 * @copyright 00003 * ==================================================================== 00004 * Copyright (c) 2001-2008 CollabNet. All rights reserved. 00005 * 00006 * This software is licensed as described in the file COPYING, which 00007 * you should have received as part of this distribution. The terms 00008 * are also available at http://subversion.tigris.org/license-1.html. 00009 * If newer versions of this license are posted there, you may use a 00010 * newer version instead, at your option. 00011 * 00012 * This software consists of voluntary contributions made by many 00013 * individuals. For exact contribution history, see the revision 00014 * history and logs, available at http://subversion.tigris.org/. 00015 * ==================================================================== 00016 * @endcopyright 00017 * 00018 * @file svn_version.h 00019 * @brief Version information. 00020 */ 00021 00022 #ifndef SVN_VERSION_H 00023 #define SVN_VERSION_H 00024 00025 /* Hack to prevent the resource compiler from including 00026 apr_general.h. It doesn't resolve the include paths 00027 correctly and blows up without this. 00028 */ 00029 #ifndef APR_STRINGIFY 00030 #include <apr_general.h> 00031 #endif 00032 00033 #include "svn_types.h" 00034 00035 #ifdef __cplusplus 00036 extern "C" { 00037 #endif /* __cplusplus */ 00038 00039 00040 /* Symbols that define the version number. */ 00041 00042 /* Version numbers: <major>.<minor>.<micro> 00043 * 00044 * The version numbers in this file follow the rules established by: 00045 * 00046 * http://apr.apache.org/versioning.html 00047 */ 00048 00049 /** Major version number. 00050 * 00051 * Modify when incompatible changes are made to published interfaces. 00052 */ 00053 #define SVN_VER_MAJOR 1 00054 00055 /** Minor version number. 00056 * 00057 * Modify when new functionality is added or new interfaces are 00058 * defined, but all changes are backward compatible. 00059 */ 00060 #define SVN_VER_MINOR 6 00061 00062 /** 00063 * Patch number. 00064 * 00065 * Modify for every released patch. 00066 * 00067 * @since New in 1.1. 00068 */ 00069 #define SVN_VER_PATCH 17 00070 00071 00072 /** @deprecated Provided for backward compatibility with the 1.0 API. */ 00073 #define SVN_VER_MICRO SVN_VER_PATCH 00074 00075 /** @deprecated Provided for backward compatibility with the 1.0 API. */ 00076 #define SVN_VER_LIBRARY SVN_VER_MAJOR 00077 00078 00079 /** Version tag: a string describing the version. 00080 * 00081 * This tag remains " (dev build)" in the repository so that we can 00082 * always see from "svn --version" that the software has been built 00083 * from the repository rather than a "blessed" distribution. 00084 * 00085 * When rolling a tarball, we automatically replace this text with " (r1234)" 00086 * (where 1234 is the last revision on the branch prior to the release) 00087 * for final releases; in prereleases, it becomes " (Alpha 1)", 00088 * " (Beta 1)", etc., as appropriate. 00089 * 00090 * Always change this at the same time as SVN_VER_NUMTAG. 00091 */ 00092 #define SVN_VER_TAG " (under development)" 00093 00094 00095 /** Number tag: a string describing the version. 00096 * 00097 * This tag is used to generate a version number string to identify 00098 * the client and server in HTTP requests, for example. It must not 00099 * contain any spaces. This value remains "-dev" in the repository. 00100 * 00101 * When rolling a tarball, we automatically replace this text with "" 00102 * for final releases; in prereleases, it becomes "-alpha1, "-beta1", 00103 * etc., as appropriate. 00104 * 00105 * Always change this at the same time as SVN_VER_TAG. 00106 */ 00107 #define SVN_VER_NUMTAG "-dev" 00108 00109 00110 /** Revision number: The repository revision number of this release. 00111 * 00112 * This constant is used to generate the build number part of the Windows 00113 * file version. Its value remains 0 in the repository. 00114 * 00115 * When rolling a tarball, we automatically replace it with what we 00116 * guess to be the correct revision number. 00117 */ 00118 #define SVN_VER_REVISION 0 00119 00120 00121 /* Version strings composed from the above definitions. */ 00122 00123 /** Version number */ 00124 #define SVN_VER_NUM APR_STRINGIFY(SVN_VER_MAJOR) \ 00125 "." APR_STRINGIFY(SVN_VER_MINOR) \ 00126 "." APR_STRINGIFY(SVN_VER_PATCH) 00127 00128 /** Version number with tag (contains no whitespace) */ 00129 #define SVN_VER_NUMBER SVN_VER_NUM SVN_VER_NUMTAG 00130 00131 /** Complete version string */ 00132 #define SVN_VERSION SVN_VER_NUMBER SVN_VER_TAG 00133 00134 00135 00136 /* Version queries and compatibility checks */ 00137 00138 /** 00139 * Version information. Each library contains a function called 00140 * svn_<i>libname</i>_version() that returns a pointer to a statically 00141 * allocated object of this type. 00142 * 00143 * @since New in 1.1. 00144 */ 00145 typedef struct svn_version_t 00146 { 00147 int major; /**< Major version number */ 00148 int minor; /**< Minor version number */ 00149 int patch; /**< Patch number */ 00150 00151 /** 00152 * The version tag (#SVN_VER_NUMTAG).\ Must always point to a 00153 * statically allocated string. 00154 */ 00155 const char *tag; 00156 } svn_version_t; 00157 00158 /** 00159 * Define a static svn_version_t object. 00160 * 00161 * @since New in 1.1. 00162 */ 00163 #define SVN_VERSION_DEFINE(name) \ 00164 static const svn_version_t name = \ 00165 { \ 00166 SVN_VER_MAJOR, \ 00167 SVN_VER_MINOR, \ 00168 SVN_VER_PATCH, \ 00169 SVN_VER_NUMTAG \ 00170 } \ 00171 00172 /** 00173 * Generate the implementation of a version query function. 00174 * 00175 * @since New in 1.1. 00176 */ 00177 #define SVN_VERSION_BODY \ 00178 SVN_VERSION_DEFINE(versioninfo); \ 00179 return &versioninfo 00180 00181 /** 00182 * Check library version compatibility. Return #TRUE if the client's 00183 * version, given in @a my_version, is compatible with the library 00184 * version, provided in @a lib_version. 00185 * 00186 * This function checks for version compatibility as per our 00187 * guarantees, but requires an exact match when linking to an 00188 * unreleased library. A development client is always compatible with 00189 * a previous released library. 00190 * 00191 * @since New in 1.1. 00192 */ 00193 svn_boolean_t 00194 svn_ver_compatible(const svn_version_t *my_version, 00195 const svn_version_t *lib_version); 00196 00197 /** 00198 * Check if @a my_version and @a lib_version encode the same version number. 00199 * 00200 * @since New in 1.2. 00201 */ 00202 svn_boolean_t 00203 svn_ver_equal(const svn_version_t *my_version, 00204 const svn_version_t *lib_version); 00205 00206 00207 /** 00208 * An entry in the compatibility checklist. 00209 * @see svn_ver_check_list() 00210 * 00211 * @since New in 1.1. 00212 */ 00213 typedef struct svn_version_checklist_t 00214 { 00215 const char *label; /**< Entry label */ 00216 00217 /** Version query function for this entry */ 00218 const svn_version_t *(*version_query)(void); 00219 } svn_version_checklist_t; 00220 00221 00222 /** 00223 * Perform a series of version compatibility checks. Checks if @a 00224 * my_version is compatible with each entry in @a checklist. @a 00225 * checklist must end with an entry whose label is @c NULL. 00226 * 00227 * @see svn_ver_compatible() 00228 * 00229 * @since New in 1.1. 00230 */ 00231 svn_error_t * 00232 svn_ver_check_list(const svn_version_t *my_version, 00233 const svn_version_checklist_t *checklist); 00234 00235 00236 /** 00237 * Type of function returning library version. 00238 * 00239 * @since New in 1.6. 00240 */ 00241 typedef const svn_version_t *(*svn_version_func_t)(void); 00242 00243 00244 /* libsvn_subr doesn't have an svn_subr header, so put the prototype here. */ 00245 /** 00246 * Get libsvn_subr version information. 00247 * 00248 * @since New in 1.1. 00249 */ 00250 const svn_version_t * 00251 svn_subr_version(void); 00252 00253 00254 #ifdef __cplusplus 00255 } 00256 #endif /* __cplusplus */ 00257 00258 #endif /* SVN_VERSION_H */