OpenSSL_version.pod 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. =pod
  2. =head1 NAME
  3. OPENSSL_VERSION_MAJOR, OPENSSL_VERSION_MINOR, OPENSSL_VERSION_PATCH,
  4. OPENSSL_VERSION_PRE_RELEASE, OPENSSL_VERSION_BUILD_METADATA,
  5. OPENSSL_VERSION_PRE_RELEASE_STR, OPENSSL_VERSION_BUILD_METADATA_STR,
  6. OPENSSL_VERSION_TEXT,
  7. OPENSSL_version_major, OPENSSL_version_minor, OPENSSL_version_patch,
  8. OPENSSL_version_pre_release, OPENSSL_version_build_metadata, OpenSSL_version,
  9. OPENSSL_VERSION_NUMBER, OpenSSL_version_num
  10. - get OpenSSL version number
  11. =head1 SYNOPSIS
  12. #include <openssl/opensslv.h>
  13. #define OPENSSL_VERSION_MAJOR x
  14. #define OPENSSL_VERSION_MINOR y
  15. #define OPENSSL_VERSION_PATCH z
  16. /* The definitions here are typical release values */
  17. #undef OPENSSL_VERSION_PRE_RELEASE
  18. #undef OPENSSL_VERSION_BUILD_METADATA
  19. #define OPENSSL_VERSION_PRE_RELEASE_STR ""
  20. #define OPENSSL_VERSION_BUILD_METADATA_STR ""
  21. #define OPENSSL_VERSION_TEXT "OpenSSL x.y.z xx XXX xxxx"
  22. unsigned int OPENSSL_version_major(void);
  23. unsigned int OPENSSL_version_minor(void);
  24. unsigned int OPENSSL_version_patch(void);
  25. const char *OPENSSL_version_pre_release(void);
  26. const char *OPENSSL_version_build_metadata(void);
  27. #include <openssl/crypto.h>
  28. const char *OpenSSL_version(int t);
  29. Deprecated:
  30. /* from openssl/opensslv.h */
  31. #define OPENSSL_VERSION_NUMBER 0xnnnnnnnnnL
  32. /* from openssl/crypto.h */
  33. unsigned long OpenSSL_version_num();
  34. =head1 DESCRIPTION
  35. =head2 Macros
  36. The three macros B<OPENSSL_VERSION_MAJOR>, B<OPENSSL_VERSION_MINOR> and
  37. B<OPENSSL_VERSION_PATCH> represent the three parts of a 3 numbered version
  38. number, MAJOR.MINOR.PATCH.
  39. The macro B<OPENSSL_VERSION_PRE_RELEASE> is an added bit of text that,
  40. when defined, indicates that this is a pre-release version, such as
  41. C<"-dev"> for an ongoing development snapshot, C<"-alpha3"> for an
  42. alpha release, etc...
  43. The value must be a string.
  44. The macro B<OPENSSL_VERSION_BUILD_METADATA> is extra metadata, reserved
  45. for other parties (examples: C<"+fips">, C<"+vendor.1">).
  46. The OpenSSL project will not touch this macro.
  47. The value must be a string.
  48. B<OPENSSL_VERSION_STR> is a convenience macro to get the short version
  49. number string, "MAJOR.MINOR.PATCH".
  50. B<OPENSSL_FULL_VERSION_STR> is a convenience macro to get the longer
  51. version number string, which combines B<OPENSSL_VERSION_STR>,
  52. B<OPENSSL_VERSION_PRE_RELEASE> and B<OPENSSL_VERSION_BUILD_METADATA>.
  53. B<OPENSSL_VERSION_TEXT> is a convenience macro to get a full descriptive
  54. version text, which includes B<OPENSSL_FULL_VERSION_STR> and the release
  55. date.
  56. =head2 Functions
  57. OPENSSL_version_major(), OPENSSL_version_minor(), OPENSSL_version_patch(),
  58. OPENSSL_version_pre_release(), and OPENSSL_version_build_metadata() return
  59. the values of the macros above for the build of the library, respectively.
  60. OpenSSL_version() returns different strings depending on B<t>:
  61. =over 4
  62. =item OPENSSL_VERSION
  63. The value of B<OPENSSL_VERSION_TEXT>
  64. =item OPENSSL_VERSION_STRING
  65. The value of B<OPENSSL_VERSION_STR>
  66. =item OPENSSL_FULL_VERSION_STRING
  67. The value of B<OPENSSL_FULL_VERSION_STR>
  68. =item OPENSSL_CFLAGS
  69. The compiler flags set for the compilation process in the form
  70. "compiler: ..." if available or "compiler: information not available"
  71. otherwise.
  72. =item OPENSSL_BUILT_ON
  73. The date of the build process in the form "built on: ..." if available
  74. or "built on: date not available" otherwise.
  75. =item OPENSSL_PLATFORM
  76. The "Configure" target of the library build in the form "platform: ..."
  77. if available or "platform: information not available" otherwise.
  78. =item OPENSSL_DIR
  79. The "OPENSSLDIR" setting of the library build in the form "OPENSSLDIR: "...""
  80. if available or "OPENSSLDIR: N/A" otherwise.
  81. =item OPENSSL_ENGINES_DIR
  82. The "ENGINESDIR" setting of the library build in the form "ENGINESDIR: "...""
  83. if available or "ENGINESDIR: N/A" otherwise.
  84. =back
  85. For an unknown B<t>, the text "not available" is returned.
  86. =head1 BACKWARD COMPATIBILITY
  87. For compatibility, some older macros and functions are retained or
  88. synthesised.
  89. They are all considered deprecated.
  90. =head2 Macros
  91. B<OPENSSL_VERSION_NUMBER> is a combination of the major, minor and
  92. patch version into a single integer 0xMNN00PP0L, where:
  93. =over 4
  94. =item M
  95. is the number from B<OPENSSL_VERSION_MAJOR>, in hexadecimal notation
  96. =item NN
  97. is the number from B<OPENSSL_VERSION_MINOR>, in hexadecimal notation
  98. =item PP
  99. is the number from B<OPENSSL_VERSION_PATCH>, in hexadecimal notation
  100. =back
  101. =head2 Functions
  102. OpenSSL_version_num() returns the value of B<OPENSSL_VERSION_NUMBER>.
  103. =head1 RETURN VALUES
  104. OPENSSL_version_major(), OPENSSL_version_minor() and OPENSSL_version_patch()
  105. return the version number parts as integers.
  106. OPENSSL_version_pre_release() and OPENSSL_version_build_metadata() return
  107. the values of B<OPENSSL_VERSION_PRE_RELEASE> and
  108. B<OPENSSL_VERSION_BUILD_METADATA> respectively as constant strings.
  109. For any of them that is undefined, the empty string is returned.
  110. OpenSSL_version() returns constant strings.
  111. =head1 SEE ALSO
  112. L<crypto(7)>
  113. =head1 HISTORY
  114. The macros and functions described here were added in OpenSSL 3.0.0,
  115. with the exception of the L</BACKWARD COMPATIBILITY> ones.
  116. =head1 COPYRIGHT
  117. Copyright 2018 The OpenSSL Project Authors. All Rights Reserved.
  118. Licensed under the Apache License 2.0 (the "License"). You may not use
  119. this file except in compliance with the License. You can obtain a copy
  120. in the file LICENSE in the source distribution or at
  121. L<https://www.openssl.org/source/license.html>.
  122. =cut