Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
DLR-AMR
GitHub Repository: DLR-AMR/t8code
Path: blob/main/src/t8_version.h
898 views
1
/*
2
This file is part of t8code.
3
t8code is a C library to manage a collection (a forest) of multiple
4
connected adaptive space-trees of general element classes in parallel.
5
6
Copyright (C) 2015 the developers
7
8
t8code is free software; you can redistribute it and/or modify
9
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation; either version 2 of the License, or
11
(at your option) any later version.
12
13
t8code is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
GNU General Public License for more details.
17
18
You should have received a copy of the GNU General Public License
19
along with t8code; if not, write to the Free Software Foundation, Inc.,
20
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21
*/
22
23
/** \file t8_version.h
24
* This file offers additional functions and support regarding the t8code version.
25
* The version number of t8code is a string "X.Y.Z-HASH" where the "-HASH" part is optional.
26
*
27
* Macro | Meaning | example
28
* ------- | ------- | ------
29
* T8_PACKAGE_STRING | The package string of t8code | "t8 0.41.1-288be-dirty"
30
* T8_PACKAGE_VERSION | The full version number X.Y.Z-HASH as string | "0.41.1-288be-dirty"
31
* T8_VERSION_MAJOR | The major version number of t8code X as int | 0
32
* T8_VERSION_MINOR | The minor version number of t8code Y as int | 42
33
* T8_VERSION_POINT | The point version number of t8code Z-HASH as inst | 1-288be-dirty
34
* \ref T8_VERSION_POINT_STRING | The point version number of t8code Z-HASH as string | "1-288be-dirty"
35
*
36
* Attention: By design of git's version handling, T8_VERSION_POINT is not defined as a string.
37
* Since it does often contain chars we additionally define the macro \ref T8_VERSION_POINT_STRING
38
* in this header file.
39
*
40
* The point version number consists of the the patch version number and the HASH part.
41
* To get the patch version number Z alone use \ref t8_get_version_patch.
42
*/
43
44
#ifndef T8_VERSION_H
45
#define T8_VERSION_H
46
47
#include <t8.h>
48
49
/** In order to convert a macro to a string, we
50
* need to pass it through these two helper macros. */
51
#define T8_STRINGIFY(arg) #arg
52
/** In order to convert a macro to a string, we
53
* need to pass it through these two helper macros. */
54
#define T8_STRINGIFY_MIDDLE(arg) T8_STRINGIFY (arg)
55
56
/** The T8_VERSION_POINT macro as a string */
57
#define T8_VERSION_POINT_STRING T8_STRINGIFY_MIDDLE (T8_VERSION_POINT)
58
59
/** Call this after including all headers */
60
T8_EXTERN_C_BEGIN ();
61
62
/** Return the package string of t8code.
63
* This string has the format "t8 version_number".
64
* \return The version string of t8code.
65
*/
66
const char*
67
t8_get_package_string ();
68
69
/** Return the version number of t8code as a string.
70
* \return The version number of t8code as a string.
71
*/
72
const char*
73
t8_get_version_number ();
74
75
/** Return the version point string.
76
* \return The version point point string.
77
*/
78
const char*
79
t8_get_version_point_string ();
80
81
/** Return the major version number of t8code.
82
* \return The major version number of t8code.
83
*/
84
int
85
t8_get_version_major ();
86
87
/** Return the minor version number of t8code.
88
* \return The minor version number of t8code.
89
*/
90
int
91
t8_get_version_minor ();
92
93
/** Return the patch version number of t8code.
94
* \return The patch version number of t8code.
95
*/
96
int
97
t8_get_version_patch ();
98
99
/** Call this at the end of a header file to match T8_EXTERN_C_BEGIN (). */
100
T8_EXTERN_C_END ();
101
102
#endif /* !T8_VERSION_H */
103
104