apu_version.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /* Copyright 2000-2005 The Apache Software Foundation or its licensors, as
  2. * applicable.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * 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. /* The numeric compile-time version constants. These constants are the
  38. * authoritative version numbers for APU.
  39. */
  40. /** major version
  41. * Major API changes that could cause compatibility problems for older
  42. * programs such as structure size changes. No binary compatibility is
  43. * possible across a change in the major version.
  44. */
  45. #define APU_MAJOR_VERSION 1
  46. /** minor version
  47. * Minor API changes that do not cause binary compatibility problems.
  48. * Reset to 0 when upgrading APU_MAJOR_VERSION
  49. */
  50. #define APU_MINOR_VERSION 2
  51. /** patch level
  52. * The Patch Level never includes API changes, simply bug fixes.
  53. * Reset to 0 when upgrading APR_MINOR_VERSION
  54. */
  55. #define APU_PATCH_VERSION 8
  56. /**
  57. * The symbol APU_IS_DEV_VERSION is only defined for internal,
  58. * "development" copies of APU. It is undefined for released versions
  59. * of APU.
  60. */
  61. /* #define APU_IS_DEV_VERSION */
  62. #if defined(APU_IS_DEV_VERSION) || defined(DOXYGEN)
  63. /** Internal: string form of the "is dev" flag */
  64. #define APU_IS_DEV_STRING "-dev"
  65. #else
  66. #define APU_IS_DEV_STRING ""
  67. #endif
  68. #ifndef APU_STRINGIFY
  69. /** Properly quote a value as a string in the C preprocessor */
  70. #define APU_STRINGIFY(n) APU_STRINGIFY_HELPER(n)
  71. /** Helper macro for APU_STRINGIFY */
  72. #define APU_STRINGIFY_HELPER(n) #n
  73. #endif
  74. /** The formatted string of APU's version */
  75. #define APU_VERSION_STRING \
  76. APU_STRINGIFY(APU_MAJOR_VERSION) "." \
  77. APU_STRINGIFY(APU_MINOR_VERSION) "." \
  78. APU_STRINGIFY(APU_PATCH_VERSION) \
  79. APU_IS_DEV_STRING
  80. /** An alternative formatted string of APR's version */
  81. /* macro for Win32 .rc files using numeric csv representation */
  82. #define APU_VERSION_STRING_CSV APU_MAJOR_VERSION ##, \
  83. ##APU_MINOR_VERSION ##, \
  84. ##APU_PATCH_VERSION
  85. #ifndef APU_VERSION_ONLY
  86. /* The C language API to access the version at run time,
  87. * as opposed to compile time. APU_VERSION_ONLY may be defined
  88. * externally when preprocessing apr_version.h to obtain strictly
  89. * the C Preprocessor macro declarations.
  90. */
  91. #include "apr_version.h"
  92. #include "apu.h"
  93. #ifdef __cplusplus
  94. extern "C" {
  95. #endif
  96. /**
  97. * Return APR-util's version information information in a numeric form.
  98. *
  99. * @param pvsn Pointer to a version structure for returning the version
  100. * information.
  101. */
  102. APU_DECLARE(void) apu_version(apr_version_t *pvsn);
  103. /** Return APU's version information as a string. */
  104. APU_DECLARE(const char *) apu_version_string(void);
  105. #ifdef __cplusplus
  106. }
  107. #endif
  108. #endif /* ndef APU_VERSION_ONLY */
  109. #endif /* ndef APU_VERSION_H */