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