apr_version.inc 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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. //#include "apr.h"
  17. {
  18. * @file apr_version.h
  19. * @brief APR Versioning Interface
  20. *
  21. * APR's Version
  22. *
  23. * There are several different mechanisms for accessing the version. There
  24. * is a string form, and a set of numbers; in addition, there are constants
  25. * which can be compiled into your application, and you can query the library
  26. * being used for its actual version.
  27. *
  28. * Note that it is possible for an application to detect that it has been
  29. * compiled against a different version of APR by use of the compile-time
  30. * constants and the use of the run-time query function.
  31. *
  32. * APR version numbering follows the guidelines specified in:
  33. *
  34. * http://apr.apache.org/versioning.html
  35. }
  36. { The numeric compile-time version constants. These constants are the
  37. * authoritative version numbers for APR.
  38. }
  39. const
  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. 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. 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. APR_PATCH_VERSION = 7;
  56. {$if defined(APR_IS_DEV_VERSION) or defined(DOXYGEN)}
  57. { Internal: string form of the "is dev" flag }
  58. APR_IS_DEV_STRING = '-dev';
  59. {$else}
  60. APR_IS_DEV_STRING = '';
  61. {$endif}
  62. { APR_STRINGIFY is defined here, and also in apr_general.h, so wrap it }
  63. {#ifndef APR_STRINGIFY
  64. /** Properly quote a value as a string in the C preprocessor */
  65. #define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
  66. /** Helper macro for APR_STRINGIFY */
  67. #define APR_STRINGIFY_HELPER(n) #n
  68. #endif}
  69. {
  70. * The symbol APR_IS_DEV_VERSION is only defined for internal,
  71. * "development" copies of APR. It is undefined for released versions
  72. * of APR.
  73. }
  74. {$undef APR_IS_DEV_VERSION}
  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 apr_version.h to obtain strictly
  90. * the C Preprocessor macro declarations.
  91. }
  92. //#include "apr.h"
  93. {
  94. * The numeric version information is broken out into fields within this
  95. * structure.
  96. }
  97. type
  98. apr_version_t = record
  99. major: Integer; {< major number }
  100. minor: Integer; {< minor number }
  101. patch: Integer; {< patch number }
  102. is_dev: Integer; {< is development (1 or 0) }
  103. end;
  104. Papr_version_t = ^apr_version_t;
  105. {
  106. * Return APR's version information information in a numeric form.
  107. *
  108. * @param pvsn Pointer to a version structure for returning the version
  109. * information.
  110. }
  111. procedure apr_version(pvsn: Papr_version_t);
  112. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  113. external LibAPR name LibNamePrefix + 'apr_version' + LibSuff4;
  114. { Return APR's version information as a string. }
  115. function apr_version_string: PChar;
  116. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  117. external LibAPR name LibNamePrefix + 'apr_version_string' + LibSuff0;
  118. //#endif