fspr_version.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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 APR_VERSION_H
  17. #define APR_VERSION_H
  18. /**
  19. * @file fspr_version.h
  20. * @brief APR Versioning Interface
  21. *
  22. * APR'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 APR by use of the compile-time
  31. * constants and the use of the run-time query function.
  32. *
  33. * APR 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 APR.
  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 APR_MAJOR_VERSION 1
  46. /** minor version
  47. * Minor API changes that do not cause binary compatibility problems.
  48. * Reset to 0 when upgrading APR_MAJOR_VERSION
  49. */
  50. #define APR_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 APR_PATCH_VERSION 8
  56. /**
  57. * The symbol APR_IS_DEV_VERSION is only defined for internal,
  58. * "development" copies of APR. It is undefined for released versions
  59. * of APR.
  60. */
  61. /* #define APR_IS_DEV_VERSION */
  62. #if defined(APR_IS_DEV_VERSION) || defined(DOXYGEN)
  63. /** Internal: string form of the "is dev" flag */
  64. #define APR_IS_DEV_STRING "-dev"
  65. #else
  66. #define APR_IS_DEV_STRING ""
  67. #endif
  68. /* APR_STRINGIFY is defined here, and also in fspr_general.h, so wrap it */
  69. #ifndef APR_STRINGIFY
  70. /** Properly quote a value as a string in the C preprocessor */
  71. #define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  72. /** Helper macro for APR_STRINGIFY */
  73. #define APR_STRINGIFY_HELPER(n) #n
  74. #endif
  75. /** The formatted string of APR's version */
  76. #define APR_VERSION_STRING \
  77. APR_STRINGIFY(APR_MAJOR_VERSION) "." \
  78. APR_STRINGIFY(APR_MINOR_VERSION) "." \
  79. APR_STRINGIFY(APR_PATCH_VERSION) \
  80. APR_IS_DEV_STRING
  81. /** An alternative formatted string of APR's version */
  82. /* macro for Win32 .rc files using numeric csv representation */
  83. #define APR_VERSION_STRING_CSV APR_MAJOR_VERSION ##, \
  84. ##APR_MINOR_VERSION ##, \
  85. ##APR_PATCH_VERSION
  86. #ifndef APR_VERSION_ONLY
  87. /* The C language API to access the version at run time,
  88. * as opposed to compile time. APR_VERSION_ONLY may be defined
  89. * externally when preprocessing fspr_version.h to obtain strictly
  90. * the C Preprocessor macro declarations.
  91. */
  92. #include "fspr.h"
  93. #ifdef __cplusplus
  94. extern "C" {
  95. #endif
  96. /**
  97. * The numeric version information is broken out into fields within this
  98. * structure.
  99. */
  100. typedef struct {
  101. int major; /**< major number */
  102. int minor; /**< minor number */
  103. int patch; /**< patch number */
  104. int is_dev; /**< is development (1 or 0) */
  105. } fspr_version_t;
  106. /**
  107. * Return APR's version information information in a numeric form.
  108. *
  109. * @param pvsn Pointer to a version structure for returning the version
  110. * information.
  111. */
  112. APR_DECLARE(void) fspr_version(fspr_version_t *pvsn);
  113. /** Return APR's version information as a string. */
  114. APR_DECLARE(const char *) fspr_version_string(void);
  115. #ifdef __cplusplus
  116. }
  117. #endif
  118. #endif /* ndef APR_VERSION_ONLY */
  119. #endif /* ndef APR_VERSION_H */