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"
14 unsigned long OpenSSL_version_num(void)
16 return OPENSSL_VERSION_NUMBER;
19 unsigned int OPENSSL_version_major(void)
21 return OPENSSL_VERSION_MAJOR;
24 unsigned int OPENSSL_version_minor(void)
26 return OPENSSL_VERSION_MINOR;
29 unsigned int OPENSSL_version_patch(void)
31 return OPENSSL_VERSION_PATCH;
34 const char *OPENSSL_version_pre_release(void)
36 return OPENSSL_VERSION_PRE_RELEASE;
39 const char *OPENSSL_version_build_metadata(void)
41 return OPENSSL_VERSION_BUILD_METADATA;
44 extern char ossl_cpu_info_str[];
46 const char *OpenSSL_version(int t)
50 return OPENSSL_VERSION_TEXT;
51 case OPENSSL_VERSION_STRING:
52 return OPENSSL_VERSION_STR;
53 case OPENSSL_FULL_VERSION_STRING:
54 return OPENSSL_FULL_VERSION_STR;
55 case OPENSSL_BUILT_ON:
58 return compiler_flags;
59 case OPENSSL_PLATFORM:
63 return "OPENSSLDIR: \"" OPENSSLDIR "\"";
65 return "OPENSSLDIR: N/A";
67 case OPENSSL_ENGINES_DIR:
69 return "ENGINESDIR: \"" ENGINESDIR "\"";
71 return "ENGINESDIR: N/A";
73 case OPENSSL_MODULES_DIR:
75 return "MODULESDIR: \"" MODULESDIR "\"";
77 return "MODULESDIR: N/A";
79 case OPENSSL_CPU_INFO:
80 if (OPENSSL_info(OPENSSL_INFO_CPU_SETTINGS) != NULL)
81 return ossl_cpu_info_str;
83 return "CPUINFO: N/A";
85 return "not available";