apu_version.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. /* Licensed to the Apache Software Foundation (ASF) under one or more
  2. * contributor license agreements. See the NOTICE file distributed with
  3. * this work for additional information regarding copyright ownership.
  4. * The ASF licenses this file to You under the Apache License, Version 2.0
  5. * (the "License"); you may not use this file except in compliance with
  6. * the License. You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #ifndef APU_VERSION_H
  17. #define APU_VERSION_H
  18. /**
  19. * @file apu_version.h
  20. * @brief APR-util Versioning Interface
  21. *
  22. * APR-util's Version
  23. *
  24. * There are several different mechanisms for accessing the version. There
  25. * is a string form, and a set of numbers; in addition, there are constants
  26. * which can be compiled into your application, and you can query the library
  27. * being used for its actual version.
  28. *
  29. * Note that it is possible for an application to detect that it has been
  30. * compiled against a different version of APU by use of the compile-time
  31. * constants and the use of the run-time query function.
  32. *
  33. * APU version numbering follows the guidelines specified in:
  34. *
  35. * http://apr.apache.org/versioning.html
  36. */
  37. #define APU_COPYRIGHT "Copyright (c) 2000-2016 The Apache Software " \
  38. "Foundation or its licensors, as applicable."
  39. /* The numeric compile-time version constants. These constants are the
  40. * authoritative version numbers for APU.
  41. */
  42. /** major version
  43. * Major API changes that could cause compatibility problems for older
  44. * programs such as structure size changes. No binary compatibility is
  45. * possible across a change in the major version.
  46. */
  47. #define APU_MAJOR_VERSION 1
  48. /** minor version
  49. * Minor API changes that do not cause binary compatibility problems.
  50. * Reset to 0 when upgrading APU_MAJOR_VERSION
  51. */
  52. #define APU_MINOR_VERSION 6
  53. /** patch level
  54. * The Patch Level never includes API changes, simply bug fixes.
  55. * Reset to 0 when upgrading APR_MINOR_VERSION
  56. */
  57. #define APU_PATCH_VERSION 1
  58. /**
  59. * The symbol APU_IS_DEV_VERSION is only defined for internal,
  60. * "development" copies of APU. It is undefined for released versions
  61. * of APU.
  62. */
  63. /* #undef APU_IS_DEV_VERSION */
  64. #if defined(APU_IS_DEV_VERSION) || defined(DOXYGEN)
  65. /** Internal: string form of the "is dev" flag */
  66. #ifndef APU_IS_DEV_STRING
  67. #define APU_IS_DEV_STRING "-dev"
  68. #endif
  69. #else
  70. #define APU_IS_DEV_STRING ""
  71. #endif
  72. #ifndef APU_STRINGIFY
  73. /** Properly quote a value as a string in the C preprocessor */
  74. #define APU_STRINGIFY(n) APU_STRINGIFY_HELPER(n)
  75. /** Helper macro for APU_STRINGIFY */
  76. #define APU_STRINGIFY_HELPER(n) #n
  77. #endif
  78. /** The formatted string of APU's version */
  79. #define APU_VERSION_STRING \
  80. APU_STRINGIFY(APU_MAJOR_VERSION) "." \
  81. APU_STRINGIFY(APU_MINOR_VERSION) "." \
  82. APU_STRINGIFY(APU_PATCH_VERSION) \
  83. APU_IS_DEV_STRING
  84. /** An alternative formatted string of APR's version */
  85. /* macro for Win32 .rc files using numeric csv representation */
  86. #define APU_VERSION_STRING_CSV APU_MAJOR_VERSION ##, \
  87. ##APU_MINOR_VERSION ##, \
  88. ##APU_PATCH_VERSION
  89. #ifndef APU_VERSION_ONLY
  90. /* The C language API to access the version at run time,
  91. * as opposed to compile time. APU_VERSION_ONLY may be defined
  92. * externally when preprocessing apr_version.h to obtain strictly
  93. * the C Preprocessor macro declarations.
  94. */
  95. #include "apr_version.h"
  96. #include "apu.h"
  97. #ifdef __cplusplus
  98. extern "C" {
  99. #endif
  100. /**
  101. * Return APR-util's version information information in a numeric form.
  102. *
  103. * @param pvsn Pointer to a version structure for returning the version
  104. * information.
  105. */
  106. APU_DECLARE(void) apu_version(apr_version_t *pvsn);
  107. /** Return APU's version information as a string. */
  108. APU_DECLARE(const char *) apu_version_string(void);
  109. #ifdef __cplusplus
  110. }
  111. #endif
  112. #endif /* ndef APU_VERSION_ONLY */
  113. #endif /* ndef APU_VERSION_H */