2 * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
4 * Licensed under the Apache License 2.0 (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
10 #include "internal/cryptlib.h"
15 unsigned long OpenSSL_version_num(void)
17 return OPENSSL_VERSION_NUMBER;
21 unsigned int OPENSSL_version_major(void)
23 return OPENSSL_VERSION_MAJOR;
26 unsigned int OPENSSL_version_minor(void)
28 return OPENSSL_VERSION_MINOR;
31 unsigned int OPENSSL_version_patch(void)
33 return OPENSSL_VERSION_PATCH;
36 const char *OPENSSL_version_pre_release(void)
38 return OPENSSL_VERSION_PRE_RELEASE_STR;
41 const char *OPENSSL_version_build_metadata(void)
43 return OPENSSL_VERSION_BUILD_METADATA_STR;
46 extern char ossl_cpu_info_str[];
48 const char *OpenSSL_version(int t)
52 return OPENSSL_VERSION_TEXT;
53 case OPENSSL_VERSION_STRING:
54 return OPENSSL_VERSION_STR;
55 case OPENSSL_FULL_VERSION_STRING:
56 return OPENSSL_FULL_VERSION_STR;
57 case OPENSSL_BUILT_ON:
60 return compiler_flags;
61 case OPENSSL_PLATFORM:
65 return "OPENSSLDIR: \"" OPENSSLDIR "\"";
67 return "OPENSSLDIR: N/A";
69 case OPENSSL_ENGINES_DIR:
71 return "ENGINESDIR: \"" ENGINESDIR "\"";
73 return "ENGINESDIR: N/A";
75 case OPENSSL_MODULES_DIR:
77 return "MODULESDIR: \"" MODULESDIR "\"";
79 return "MODULESDIR: N/A";
81 case OPENSSL_CPU_INFO:
82 if (OPENSSL_info(OPENSSL_INFO_CPU_SETTINGS) != NULL)
83 return ossl_cpu_info_str;
85 return "CPUINFO: N/A";
87 return "not available";