00001 /* Copyright 2000-2004 The Apache Software Foundation 00002 * 00003 * Licensed under the Apache License, Version 2.0 (the "License"); 00004 * you may not use this file except in compliance with the License. 00005 * You may obtain a copy of the License at 00006 * 00007 * http://www.apache.org/licenses/LICENSE-2.0 00008 * 00009 * Unless required by applicable law or agreed to in writing, software 00010 * distributed under the License is distributed on an "AS IS" BASIS, 00011 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00012 * See the License for the specific language governing permissions and 00013 * limitations under the License. 00014 */ 00015 00016 #ifndef API_VERSION_H 00017 #define API_VERSION_H 00018 00019 /** 00020 * @file api_version.h 00021 * @brief APR-iconv Versioning Interface 00022 * 00023 * APR-iconv's Version 00024 * 00025 * There are several different mechanisms for accessing the version. There 00026 * is a string form, and a set of numbers; in addition, there are constants 00027 * which can be compiled into your application, and you can query the library 00028 * being used for its actual version. 00029 * 00030 * Note that it is possible for an application to detect that it has been 00031 * compiled against a different version of API by use of the compile-time 00032 * constants and the use of the run-time query function. 00033 * 00034 * API version numbering follows the guidelines specified in: 00035 * 00036 * http://apr.apache.org/versioning.html 00037 */ 00038 00039 00040 /* The numeric compile-time version constants. These constants are the 00041 * authoritative version numbers for API. 00042 */ 00043 00044 /** major version 00045 * Major API changes that could cause compatibility problems for older 00046 * programs such as structure size changes. No binary compatibility is 00047 * possible across a change in the major version. 00048 */ 00049 #define API_MAJOR_VERSION 1 00050 00051 /** minor version 00052 * Minor API changes that do not cause binary compatibility problems. 00053 * Reset to 0 when upgrading API_MAJOR_VERSION 00054 */ 00055 #define API_MINOR_VERSION 2 00056 00057 /** patch level 00058 * The Patch Level never includes API changes, simply bug fixes. 00059 * Reset to 0 when upgrading API_MINOR_VERSION 00060 */ 00061 #define API_PATCH_VERSION 1 00062 00063 /** 00064 * The symbol API_IS_DEV_VERSION is only defined for internal, 00065 * "development" copies of API. It is undefined for released versions 00066 * of API. 00067 */ 00068 /* #undef API_IS_DEV_VERSION */ 00069 00070 00071 #if defined(API_IS_DEV_VERSION) || defined(DOXYGEN) 00072 /** Internal: string form of the "is dev" flag */ 00073 #define API_IS_DEV_STRING "-dev" 00074 #else 00075 #define API_IS_DEV_STRING "" 00076 #endif 00077 00078 #ifndef API_STRINGIFY 00079 /** Properly quote a value as a string in the C preprocessor */ 00080 #define API_STRINGIFY(n) API_STRINGIFY_HELPER(n) 00081 /** Helper macro for API_STRINGIFY */ 00082 #define API_STRINGIFY_HELPER(n) #n 00083 #endif 00084 00085 /** The formatted string of API's version */ 00086 #define API_VERSION_STRING \ 00087 API_STRINGIFY(API_MAJOR_VERSION) "." \ 00088 API_STRINGIFY(API_MINOR_VERSION) "." \ 00089 API_STRINGIFY(API_PATCH_VERSION) \ 00090 API_IS_DEV_STRING 00091 00092 /** An alternative formatted string of APR's version */ 00093 /* macro for Win32 .rc files using numeric csv representation */ 00094 #define API_VERSION_STRING_CSV API_MAJOR_VERSION ##, \ 00095 ##API_MINOR_VERSION ##, \ 00096 ##API_PATCH_VERSION 00097 00098 00099 #ifndef API_VERSION_ONLY 00100 00101 /* The C language API to access the version at run time, 00102 * as opposed to compile time. API_VERSION_ONLY may be defined 00103 * externally when preprocessing apr_version.h to obtain strictly 00104 * the C Preprocessor macro declarations. 00105 */ 00106 00107 #include "apr_version.h" 00108 00109 #include "apr_iconv.h" 00110 00111 #ifdef __cplusplus 00112 extern "C" { 00113 #endif 00114 00115 /** 00116 * Return APR-iconv's version information information in a numeric form. 00117 * 00118 * @param pvsn Pointer to a version structure for returning the version 00119 * information. 00120 */ 00121 API_DECLARE(void) api_version(apr_version_t *pvsn); 00122 00123 /** Return API's version information as a string. */ 00124 API_DECLARE(const char *) api_version_string(void); 00125 00126 #ifdef __cplusplus 00127 } 00128 #endif 00129 00130 #endif /* ndef API_VERSION_ONLY */ 00131 00132 #endif /* ndef API_VERSION_H */