Paul Bakker | 3ac1b2d | 2010-06-18 22:47:29 +0000 | [diff] [blame] | 1 | /** |
| 2 | * \file version.h |
| 3 | * |
Paul Bakker | f3b86c1 | 2011-01-27 15:24:17 +0000 | [diff] [blame] | 4 | * \brief Run-time version information |
| 5 | * |
Paul Bakker | 530927b | 2015-02-13 14:24:10 +0100 | [diff] [blame^] | 6 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved |
Paul Bakker | b96f154 | 2010-07-18 20:36:00 +0000 | [diff] [blame] | 7 | * |
Manuel Pégourié-Gonnard | e12abf9 | 2015-01-28 17:13:45 +0000 | [diff] [blame] | 8 | * This file is part of mbed TLS (https://polarssl.org) |
Paul Bakker | 3ac1b2d | 2010-06-18 22:47:29 +0000 | [diff] [blame] | 9 | * |
| 10 | * This program is free software; you can redistribute it and/or modify |
| 11 | * it under the terms of the GNU General Public License as published by |
| 12 | * the Free Software Foundation; either version 2 of the License, or |
| 13 | * (at your option) any later version. |
| 14 | * |
| 15 | * This program is distributed in the hope that it will be useful, |
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 | * GNU General Public License for more details. |
| 19 | * |
| 20 | * You should have received a copy of the GNU General Public License along |
| 21 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 22 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
Paul Bakker | f3b86c1 | 2011-01-27 15:24:17 +0000 | [diff] [blame] | 23 | */ |
| 24 | /* |
Paul Bakker | 3ac1b2d | 2010-06-18 22:47:29 +0000 | [diff] [blame] | 25 | * This set of compile-time defines and run-time variables can be used to |
| 26 | * determine the version number of the PolarSSL library used. |
| 27 | */ |
| 28 | #ifndef POLARSSL_VERSION_H |
| 29 | #define POLARSSL_VERSION_H |
| 30 | |
Paul Bakker | 314052f | 2011-08-15 09:07:52 +0000 | [diff] [blame] | 31 | #include "config.h" |
Paul Bakker | 3ac1b2d | 2010-06-18 22:47:29 +0000 | [diff] [blame] | 32 | |
| 33 | /** |
| 34 | * The version number x.y.z is split into three parts. |
| 35 | * Major, Minor, Patchlevel |
| 36 | */ |
Paul Bakker | 968bc98 | 2011-07-27 17:03:00 +0000 | [diff] [blame] | 37 | #define POLARSSL_VERSION_MAJOR 1 |
Paul Bakker | 8f387e6 | 2012-10-02 15:26:45 +0000 | [diff] [blame] | 38 | #define POLARSSL_VERSION_MINOR 2 |
Paul Bakker | fc3697c | 2014-10-24 10:42:25 +0200 | [diff] [blame] | 39 | #define POLARSSL_VERSION_PATCH 12 |
Paul Bakker | 3ac1b2d | 2010-06-18 22:47:29 +0000 | [diff] [blame] | 40 | |
| 41 | /** |
| 42 | * The single version number has the following structure: |
| 43 | * MMNNPP00 |
| 44 | * Major version | Minor version | Patch version |
| 45 | */ |
Paul Bakker | fc3697c | 2014-10-24 10:42:25 +0200 | [diff] [blame] | 46 | #define POLARSSL_VERSION_NUMBER 0x01020C00 |
| 47 | #define POLARSSL_VERSION_STRING "1.2.12" |
| 48 | #define POLARSSL_VERSION_STRING_FULL "PolarSSL 1.2.12" |
Paul Bakker | 3ac1b2d | 2010-06-18 22:47:29 +0000 | [diff] [blame] | 49 | |
| 50 | #if defined(POLARSSL_VERSION_C) |
| 51 | |
| 52 | /** |
| 53 | * Get the version number. |
| 54 | * |
Paul Bakker | 0f5f72e | 2011-01-18 14:58:55 +0000 | [diff] [blame] | 55 | * \return The constructed version number in the format |
Paul Bakker | 3ac1b2d | 2010-06-18 22:47:29 +0000 | [diff] [blame] | 56 | * MMNNPP00 (Major, Minor, Patch). |
| 57 | */ |
Paul Bakker | 684ddce | 2011-07-01 09:25:54 +0000 | [diff] [blame] | 58 | unsigned int version_get_number( void ); |
Paul Bakker | 3ac1b2d | 2010-06-18 22:47:29 +0000 | [diff] [blame] | 59 | |
| 60 | /** |
| 61 | * Get the version string ("x.y.z"). |
| 62 | * |
Paul Bakker | 0f5f72e | 2011-01-18 14:58:55 +0000 | [diff] [blame] | 63 | * \param string The string that will receive the value. |
Paul Bakker | 3ac1b2d | 2010-06-18 22:47:29 +0000 | [diff] [blame] | 64 | * (Should be at least 9 bytes in size) |
| 65 | */ |
| 66 | void version_get_string( char *string ); |
| 67 | |
| 68 | /** |
| 69 | * Get the full version string ("PolarSSL x.y.z"). |
| 70 | * |
Paul Bakker | 3dfa07b | 2014-04-30 10:21:23 +0200 | [diff] [blame] | 71 | * \param string The string that will receive the value. The PolarSSL version |
| 72 | * string will use 18 bytes AT MOST including a terminating |
| 73 | * null byte. |
| 74 | * (So the buffer should be at least 18 bytes to receive this |
| 75 | * version string). |
Paul Bakker | 3ac1b2d | 2010-06-18 22:47:29 +0000 | [diff] [blame] | 76 | */ |
| 77 | void version_get_string_full( char *string ); |
| 78 | |
| 79 | #endif /* POLARSSL_VERSION_C */ |
| 80 | |
| 81 | #endif /* version.h */ |