cversion.c 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
  3. *
  4. * Licensed under the OpenSSL license (the "License"). You may not use
  5. * this file except in compliance with the License. You can obtain a copy
  6. * in the file LICENSE in the source distribution or at
  7. * https://www.openssl.org/source/license.html
  8. */
  9. #include "internal/cryptlib.h"
  10. #include "buildinf.h"
  11. unsigned long OpenSSL_version_num(void)
  12. {
  13. return OPENSSL_VERSION_NUMBER;
  14. }
  15. const char *OpenSSL_version(int t)
  16. {
  17. switch (t) {
  18. case OPENSSL_VERSION:
  19. return OPENSSL_VERSION_TEXT;
  20. case OPENSSL_BUILT_ON:
  21. return DATE;
  22. case OPENSSL_CFLAGS:
  23. return compiler_flags;
  24. case OPENSSL_PLATFORM:
  25. return PLATFORM;
  26. case OPENSSL_DIR:
  27. #ifdef OPENSSLDIR
  28. return "OPENSSLDIR: \"" OPENSSLDIR "\"";
  29. #else
  30. return "OPENSSLDIR: N/A";
  31. #endif
  32. case OPENSSL_ENGINES_DIR:
  33. #ifdef ENGINESDIR
  34. return "ENGINESDIR: \"" ENGINESDIR "\"";
  35. #else
  36. return "ENGINESDIR: N/A";
  37. #endif
  38. }
  39. return "not available";
  40. }