apr_version.h

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

Generated on Mon Nov 26 11:23:52 2007 for Apache Portable Runtime by  doxygen 1.5.2