1 /*
2 **  Licensed to the Apache Software Foundation (ASF) under one or more
3 ** contributor license agreements.  See the NOTICE file distributed with
4 ** this work for additional information regarding copyright ownership.
5 ** The ASF licenses this file to You under the Apache License, Version 2.0
6 ** (the "License"); you may not use this file except in compliance with
7 ** the License.  You may obtain a copy of the License at
8 **
9 **      http://www.apache.org/licenses/LICENSE-2.0
10 **
11 **  Unless required by applicable law or agreed to in writing, software
12 **  distributed under the License is distributed on an "AS IS" BASIS,
13 **  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 **  See the License for the specific language governing permissions and
15 **  limitations under the License.
16 */
17 
18 #ifndef APREQ_VERSION_H
19 #define APREQ_VERSION_H
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 #include "apr_version.h"
26 #include "apreq.h"
27 
28 /**
29  * @file apreq_version.h
30  * @brief Versioning API for libapreq
31  * @ingroup libapreq2
32  *
33  * There are several different mechanisms for accessing the version. There
34  * is a string form, and a set of numbers; in addition, there are constants
35  * which can be compiled into your application, and you can query the library
36  * being used for its actual version.
37  *
38  * Note that it is possible for an application to detect that it has been
39  * compiled against a different version of libapreq by use of the compile-time
40  * constants and the use of the run-time query function.
41  *
42  * libapreq version numbering follows the guidelines specified in:
43  *
44  *     http://apr.apache.org/versioning.html
45  */
46 
47 /* The numeric compile-time version constants. These constants are the
48  * authoritative version numbers for libapreq.
49  */
50 
51 /** major version
52  * Major API changes that could cause compatibility problems for older
53  * programs such as structure size changes.  No binary compatibility is
54  * possible across a change in the major version.
55  */
56 #define APREQ_MAJOR_VERSION       2
57 
58 /**
59  * Minor API changes that do not cause binary compatibility problems.
60  * Should be reset to 0 when upgrading APREQ_MAJOR_VERSION
61  */
62 #define APREQ_MINOR_VERSION       8
63 
64 /** patch level */
65 #define APREQ_PATCH_VERSION       1
66 
67 /**
68  *  This symbol is defined for internal, "development" copies of libapreq.
69  *  This symbol will be \#undef'd for releases.
70  */
71 #undef APREQ_IS_DEV_VERSION
72 
73 
74 /** The formatted string of libapreq's version */
75 #define APREQ_VERSION_STRING \
76      APR_STRINGIFY(APREQ_MAJOR_VERSION) "." \
77      APR_STRINGIFY(APREQ_MINOR_VERSION) "." \
78      APR_STRINGIFY(APREQ_PATCH_VERSION) \
79      APREQ_IS_DEV_STRING
80 
81 /**
82  * Return libapreq's version information information in a numeric form.
83  *
84  *  @param pvsn Pointer to a version structure for returning the version
85  *              information.
86  */
87 APREQ_DECLARE(void) apreq_version(apr_version_t *pvsn);
88 
89 /** Return libapreq's version information as a string. */
90 APREQ_DECLARE(const char *) apreq_version_string(void);
91 
92 
93 /** Internal: string form of the "is dev" flag */
94 #ifdef APREQ_IS_DEV_VERSION
95 #define APREQ_IS_DEV_STRING "-dev"
96 #else
97 #define APREQ_IS_DEV_STRING ""
98 #endif
99 
100 
101 #ifdef __cplusplus
102 }
103 #endif
104 
105 #endif /* APREQ_VERSION_H */
106