18232165peter/* Licensed to the Apache Software Foundation (ASF) under one or more
28232165peter * contributor license agreements.  See the NOTICE file distributed with
38232165peter * this work for additional information regarding copyright ownership.
48232165peter * The ASF licenses this file to You under the Apache License, Version 2.0
58232165peter * (the "License"); you may not use this file except in compliance with
68232165peter * the License.  You may obtain a copy of the License at
78232165peter *
88232165peter *     http://www.apache.org/licenses/LICENSE-2.0
98232165peter *
108232165peter * Unless required by applicable law or agreed to in writing, software
118232165peter * distributed under the License is distributed on an "AS IS" BASIS,
128232165peter * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
138232165peter * See the License for the specific language governing permissions and
148232165peter * limitations under the License.
158232165peter */
168232165peter
178232165peter#ifndef APR_VERSION_H
188232165peter#define APR_VERSION_H
198232165peter
208232165peter/**
218232165peter * @file apr_version.h
228232165peter * @brief APR Versioning Interface
238232165peter *
248232165peter * APR's Version
258232165peter *
268232165peter * There are several different mechanisms for accessing the version. There
278232165peter * is a string form, and a set of numbers; in addition, there are constants
288232165peter * which can be compiled into your application, and you can query the library
298232165peter * being used for its actual version.
308232165peter *
318232165peter * Note that it is possible for an application to detect that it has been
328232165peter * compiled against a different version of APR by use of the compile-time
338232165peter * constants and the use of the run-time query function.
348232165peter *
358232165peter * APR version numbering follows the guidelines specified in:
368232165peter *
378232165peter *     http://apr.apache.org/versioning.html
388232165peter */
398232165peter
408232165peter
41944f5bcdim#define APR_COPYRIGHT "Copyright (c) 2000-2019 The Apache Software " \
42ed0c2f8peter                      "Foundation or its licensors, as applicable."
43ed0c2f8peter
448232165peter/* The numeric compile-time version constants. These constants are the
458232165peter * authoritative version numbers for APR.
468232165peter */
478232165peter
488232165peter/** major version
498232165peter * Major API changes that could cause compatibility problems for older
508232165peter * programs such as structure size changes.  No binary compatibility is
518232165peter * possible across a change in the major version.
528232165peter */
538232165peter#define APR_MAJOR_VERSION       1
548232165peter
558232165peter/** minor version
568232165peter * Minor API changes that do not cause binary compatibility problems.
578232165peter * Reset to 0 when upgrading APR_MAJOR_VERSION
588232165peter */
59944f5bcdim#define APR_MINOR_VERSION       7
608232165peter
618232165peter/** patch level
628232165peter * The Patch Level never includes API changes, simply bug fixes.
638232165peter * Reset to 0 when upgrading APR_MINOR_VERSION
648232165peter */
65944f5bcdim#define APR_PATCH_VERSION       0
668232165peter
678232165peter/**
688232165peter * The symbol APR_IS_DEV_VERSION is only defined for internal,
698232165peter * "development" copies of APR.  It is undefined for released versions
708232165peter * of APR.
718232165peter */
72c88884apeter/* #undef APR_IS_DEV_VERSION */
738232165peter
748232165peter/**
758232165peter * Check at compile time if the APR version is at least a certain
768232165peter * level.
778232165peter * @param major The major version component of the version checked
788232165peter * for (e.g., the "1" of "1.3.0").
798232165peter * @param minor The minor version component of the version checked
808232165peter * for (e.g., the "3" of "1.3.0").
818232165peter * @param patch The patch level component of the version checked
828232165peter * for (e.g., the "0" of "1.3.0").
838232165peter * @remark This macro is available with APR versions starting with
848232165peter * 1.3.0.
858232165peter */
868232165peter#define APR_VERSION_AT_LEAST(major,minor,patch)                    \
878232165peter(((major) < APR_MAJOR_VERSION)                                     \
888232165peter || ((major) == APR_MAJOR_VERSION && (minor) < APR_MINOR_VERSION) \
898232165peter || ((major) == APR_MAJOR_VERSION && (minor) == APR_MINOR_VERSION && (patch) <= APR_PATCH_VERSION))
908232165peter
918232165peter#if defined(APR_IS_DEV_VERSION) || defined(DOXYGEN)
928232165peter/** Internal: string form of the "is dev" flag */
93ed0c2f8peter#ifndef APR_IS_DEV_STRING
948232165peter#define APR_IS_DEV_STRING "-dev"
95ed0c2f8peter#endif
968232165peter#else
978232165peter#define APR_IS_DEV_STRING ""
988232165peter#endif
998232165peter
1008232165peter/* APR_STRINGIFY is defined here, and also in apr_general.h, so wrap it */
1018232165peter#ifndef APR_STRINGIFY
1028232165peter/** Properly quote a value as a string in the C preprocessor */
1038232165peter#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
1048232165peter/** Helper macro for APR_STRINGIFY */
1058232165peter#define APR_STRINGIFY_HELPER(n) #n
1068232165peter#endif
1078232165peter
1088232165peter/** The formatted string of APR's version */
1098232165peter#define APR_VERSION_STRING \
1108232165peter     APR_STRINGIFY(APR_MAJOR_VERSION) "." \
1118232165peter     APR_STRINGIFY(APR_MINOR_VERSION) "." \
1128232165peter     APR_STRINGIFY(APR_PATCH_VERSION) \
1138232165peter     APR_IS_DEV_STRING
1148232165peter
1158232165peter/** An alternative formatted string of APR's version */
1168232165peter/* macro for Win32 .rc files using numeric csv representation */
1178232165peter#define APR_VERSION_STRING_CSV APR_MAJOR_VERSION ##, \
1188232165peter                             ##APR_MINOR_VERSION ##, \
1198232165peter                             ##APR_PATCH_VERSION
1208232165peter
1218232165peter
1228232165peter#ifndef APR_VERSION_ONLY
1238232165peter
1248232165peter/* The C language API to access the version at run time,
1258232165peter * as opposed to compile time.  APR_VERSION_ONLY may be defined
1268232165peter * externally when preprocessing apr_version.h to obtain strictly
1278232165peter * the C Preprocessor macro declarations.
1288232165peter */
1298232165peter
1308232165peter#include "apr.h"
1318232165peter
1328232165peter#ifdef __cplusplus
1338232165peterextern "C" {
1348232165peter#endif
1358232165peter
1368232165peter/**
1378232165peter * The numeric version information is broken out into fields within this
1388232165peter * structure.
1398232165peter */
1408232165petertypedef struct {
1418232165peter    int major;      /**< major number */
1428232165peter    int minor;      /**< minor number */
1438232165peter    int patch;      /**< patch number */
1448232165peter    int is_dev;     /**< is development (1 or 0) */
1458232165peter} apr_version_t;
1468232165peter
1478232165peter/**
1488232165peter * Return APR's version information information in a numeric form.
1498232165peter *
1508232165peter *  @param pvsn Pointer to a version structure for returning the version
1518232165peter *              information.
1528232165peter */
1538232165peterAPR_DECLARE(void) apr_version(apr_version_t *pvsn);
1548232165peter
1558232165peter/** Return APR's version information as a string. */
1568232165peterAPR_DECLARE(const char *) apr_version_string(void);
1578232165peter
1588232165peter#ifdef __cplusplus
1598232165peter}
1608232165peter#endif
1618232165peter
1628232165peter#endif /* ndef APR_VERSION_ONLY */
1638232165peter
1648232165peter#endif /* ndef APR_VERSION_H */
165