blob: 1db8005cf62edbeb9223626245353e3ad7bf2b72 [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 Bakker407a0da2013-06-27 14:29:21 +02006 * Copyright (C) 2006-2013, Brainspark B.V.
Paul Bakkerb96f1542010-07-18 20:36:00 +00007 *
8 * This file is part of PolarSSL (http://www.polarssl.org)
Paul Bakker84f12b72010-07-18 10:13:04 +00009 * Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
Paul Bakkerb96f1542010-07-18 20:36:00 +000010 *
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000011 * 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 Bakkerf3b86c12011-01-27 15:24:17 +000026 */
27/*
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000028 * 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 Bakker314052f2011-08-15 09:07:52 +000034#include "config.h"
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000035
36/**
37 * The version number x.y.z is split into three parts.
38 * Major, Minor, Patchlevel
39 */
Paul Bakker968bc982011-07-27 17:03:00 +000040#define POLARSSL_VERSION_MAJOR 1
Paul Bakker5ad403f2013-09-18 21:21:30 +020041#define POLARSSL_VERSION_MINOR 3
42#define POLARSSL_VERSION_PATCH 0
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000043
44/**
45 * The single version number has the following structure:
46 * MMNNPP00
47 * Major version | Minor version | Patch version
48 */
Paul Bakker5ad403f2013-09-18 21:21:30 +020049#define POLARSSL_VERSION_NUMBER 0x01030000
50#define POLARSSL_VERSION_STRING "1.3.0"
51#define POLARSSL_VERSION_STRING_FULL "PolarSSL 1.3.0"
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000052
53#if defined(POLARSSL_VERSION_C)
54
Paul Bakker407a0da2013-06-27 14:29:21 +020055#ifdef __cplusplus
56extern "C" {
57#endif
58
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000059/**
60 * Get the version number.
61 *
Paul Bakker0f5f72e2011-01-18 14:58:55 +000062 * \return The constructed version number in the format
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000063 * MMNNPP00 (Major, Minor, Patch).
64 */
Paul Bakker684ddce2011-07-01 09:25:54 +000065unsigned int version_get_number( void );
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000066
67/**
68 * Get the version string ("x.y.z").
69 *
Paul Bakker0f5f72e2011-01-18 14:58:55 +000070 * \param string The string that will receive the value.
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000071 * (Should be at least 9 bytes in size)
72 */
73void version_get_string( char *string );
74
75/**
76 * Get the full version string ("PolarSSL x.y.z").
77 *
Paul Bakker0f5f72e2011-01-18 14:58:55 +000078 * \param string The string that will receive the value.
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000079 * (Should be at least 18 bytes in size)
80 */
81void version_get_string_full( char *string );
82
Paul Bakker407a0da2013-06-27 14:29:21 +020083#ifdef __cplusplus
84}
85#endif
86
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000087#endif /* POLARSSL_VERSION_C */
88
89#endif /* version.h */