Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

apr_version.h

Go to the documentation of this file.
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 APR_VERSION_H
00017 #define APR_VERSION_H
00018 
00019 /**
00020  * @file apr_version.h
00021  * @brief APR Versioning Interface
00022  * 
00023  * APR'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 APR by use of the compile-time
00032  * constants and the use of the run-time query function.
00033  *
00034  * APR 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 APR. 
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 APR_MAJOR_VERSION       1
00050 
00051 /** minor version
00052  * Minor API changes that do not cause binary compatibility problems.
00053  * Reset to 0 when upgrading APR_MAJOR_VERSION
00054  */
00055 #define APR_MINOR_VERSION       1
00056 
00057 /** patch level 
00058  * The Patch Level never includes API changes, simply bug fixes.
00059  * Reset to 0 when upgrading APR_MINOR_VERSION
00060  */
00061 #define APR_PATCH_VERSION       1
00062 
00063 /** 
00064  * The symbol APR_IS_DEV_VERSION is only defined for internal,
00065  * "development" copies of APR.  It is undefined for released versions
00066  * of APR.
00067  */
00068 /* #define APR_IS_DEV_VERSION */
00069 
00070 
00071 #if defined(APR_IS_DEV_VERSION) || defined(DOXYGEN)
00072 /** Internal: string form of the "is dev" flag */
00073 #define APR_IS_DEV_STRING "-dev"
00074 #else
00075 #define APR_IS_DEV_STRING ""
00076 #endif
00077 
00078 /* APR_STRINGIFY is defined here, and also in apr_general.h, so wrap it */
00079 #ifndef APR_STRINGIFY
00080 /** Properly quote a value as a string in the C preprocessor */
00081 #define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
00082 /** Helper macro for APR_STRINGIFY */
00083 #define APR_STRINGIFY_HELPER(n) #n
00084 #endif
00085 
00086 /** The formatted string of APR's version */
00087 #define APR_VERSION_STRING \
00088      APR_STRINGIFY(APR_MAJOR_VERSION) "." \
00089      APR_STRINGIFY(APR_MINOR_VERSION) "." \
00090      APR_STRINGIFY(APR_PATCH_VERSION) \
00091      APR_IS_DEV_STRING
00092 
00093 /** An alternative formatted string of APR's version */
00094 /* macro for Win32 .rc files using numeric csv representation */
00095 #define APR_VERSION_STRING_CSV APR_MAJOR_VERSION ##, \
00096                              ##APR_MINOR_VERSION ##, \
00097                              ##APR_PATCH_VERSION
00098 
00099 
00100 #ifndef APR_VERSION_ONLY
00101 
00102 /* The C language API to access the version at run time, 
00103  * as opposed to compile time.  APR_VERSION_ONLY may be defined 
00104  * externally when preprocessing apr_version.h to obtain strictly 
00105  * the C Preprocessor macro declarations.
00106  */
00107 
00108 #include "apr.h"
00109 
00110 #ifdef __cplusplus
00111 extern "C" {
00112 #endif
00113 
00114 /** 
00115  * The numeric version information is broken out into fields within this 
00116  * structure. 
00117  */
00118 typedef struct {
00119     int major;      /**< major number */
00120     int minor;      /**< minor number */
00121     int patch;      /**< patch number */
00122     int is_dev;     /**< is development (1 or 0) */
00123 } apr_version_t;
00124 
00125 /**
00126  * Return APR's version information information in a numeric form.
00127  *
00128  *  @param pvsn Pointer to a version structure for returning the version
00129  *              information.
00130  */
00131 APR_DECLARE(void) apr_version(apr_version_t *pvsn);
00132 
00133 /** Return APR's version information as a string. */
00134 APR_DECLARE(const char *) apr_version_string(void);
00135 
00136 #ifdef __cplusplus
00137 }
00138 #endif
00139 
00140 #endif /* ndef APR_VERSION_ONLY */
00141 
00142 #endif /* ndef APR_VERSION_H */

Generated on Tue May 10 04:16:54 2005 for Apache Portable Runtime by  doxygen 1.3.9.1