blob: c348b960192abcf0434437b20619b2c6aa337520 [file] [log] [blame]
Paul Bakker3ac1b2d2010-06-18 22:47:29 +00001/**
2 * \file version.h
3 *
Paul Bakkerf3b86c12011-01-27 15:24:17 +00004 * \brief Run-time version information
5 *
Paul Bakker530927b2015-02-13 14:24:10 +01006 * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
Paul Bakkerb96f1542010-07-18 20:36:00 +00007 *
Manuel Pégourié-Gonnarde12abf92015-01-28 17:13:45 +00008 * This file is part of mbed TLS (https://polarssl.org)
Paul Bakker3ac1b2d2010-06-18 22:47:29 +00009 *
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 Bakkerf3b86c12011-01-27 15:24:17 +000023 */
24/*
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000025 * 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 Bakker314052f2011-08-15 09:07:52 +000031#include "config.h"
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000032
33/**
34 * The version number x.y.z is split into three parts.
35 * Major, Minor, Patchlevel
36 */
Paul Bakker968bc982011-07-27 17:03:00 +000037#define POLARSSL_VERSION_MAJOR 1
Paul Bakker8f387e62012-10-02 15:26:45 +000038#define POLARSSL_VERSION_MINOR 2
Simon Butcher0d1cf0f2015-11-05 19:54:02 +000039#define POLARSSL_VERSION_PATCH 18
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000040
41/**
42 * The single version number has the following structure:
43 * MMNNPP00
44 * Major version | Minor version | Patch version
45 */
Simon Butcher0d1cf0f2015-11-05 19:54:02 +000046#define POLARSSL_VERSION_NUMBER 0x01021200
47#define POLARSSL_VERSION_STRING "1.2.18"
48#define POLARSSL_VERSION_STRING_FULL "PolarSSL 1.2.18"
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000049
50#if defined(POLARSSL_VERSION_C)
51
52/**
53 * Get the version number.
54 *
Paul Bakker0f5f72e2011-01-18 14:58:55 +000055 * \return The constructed version number in the format
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000056 * MMNNPP00 (Major, Minor, Patch).
57 */
Paul Bakker684ddce2011-07-01 09:25:54 +000058unsigned int version_get_number( void );
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000059
60/**
61 * Get the version string ("x.y.z").
62 *
Paul Bakker0f5f72e2011-01-18 14:58:55 +000063 * \param string The string that will receive the value.
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000064 * (Should be at least 9 bytes in size)
65 */
66void version_get_string( char *string );
67
68/**
69 * Get the full version string ("PolarSSL x.y.z").
70 *
Paul Bakker3dfa07b2014-04-30 10:21:23 +020071 * \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 Bakker3ac1b2d2010-06-18 22:47:29 +000076 */
77void version_get_string_full( char *string );
78
79#endif /* POLARSSL_VERSION_C */
80
81#endif /* version.h */