aboutsummaryrefslogtreecommitdiff
path: root/include/odp/api/spec/version.h.in
blob: 19c5f2ec1650a404b0db824dce59c0db60a4f399 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/* SPDX-License-Identifier: BSD-3-Clause
 * Copyright (c) 2013-2018 Linaro Limited
 * Copyright (c) 2020-2021 Nokia
 */

/**
 * @file
 *
 * ODP version
 */

#ifndef ODP_API_SPEC_VERSION_H_
#define ODP_API_SPEC_VERSION_H_
#include <odp/visibility_begin.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
 * @defgroup odp_version ODP VERSION
 * API and implementation versions
 *
 * ODP API version is identified by ODP_VERSION_API_XXX preprocessor macros.
 * In addition to these macros, API calls can be used to identify implementation
 * and API version information at run time.
 * @{
 */

/**
 * ODP API generation version
 *
 * Introduction of major new features or changes that make
 * very significant changes to the API. APIs with different
 * versions are likely not backward compatible.
 */
#define ODP_VERSION_API_GENERATION @ODP_VERSION_API_GENERATION@

/**
 * ODP API major version
 *
 * Introduction of major new features or changes. APIs with different major
 * versions are likely not backward compatible.
 */
#define  ODP_VERSION_API_MAJOR @ODP_VERSION_API_MAJOR@

/**
 * ODP API minor version
 *
 * Minor version is incremented when introducing backward compatible changes
 * to the API. For an API with common generation and major version, but with
 * different minor numbers the two versions are backward compatible.
 */
#define ODP_VERSION_API_MINOR @ODP_VERSION_API_MINOR@

/**
 * ODP API version number macro
 *
 * Macro to build a version number for comparisons
 */
#define ODP_VERSION_API_NUM(gen, ma, mi) ((gen) << 24 | (ma) << 16 | (mi) << 8)

/**
 * ODP API version number
 *
 * API version number for comparisons against ODP_VERSION_API_NUM()
 * macro output.
 */
#define ODP_VERSION_API ODP_VERSION_API_NUM(ODP_VERSION_API_GENERATION, \
					    ODP_VERSION_API_MAJOR, \
					    ODP_VERSION_API_MINOR)

/**
 * ODP API version string
 *
 * The API version string defines ODP API version in this format:
 * @verbatim <generation>.<major>.<minor> @endverbatim
 *
 * The string is null terminated.
 *
 * @return Pointer to API version string
 */
const char *odp_version_api_str(void);

/**
 * Implementation name string
 *
 * This is a free format string which identifies the implementation with a
 * unique name. The string should be compact and remain constant over multiple
 * API and implementation versions. Application can use this to identify the
 * underlying implementation at run time. The string is null terminated.
 *
 * @return Pointer to implementation name string
  */
const char *odp_version_impl_name(void);

/**
 * Implementation version string
 *
 * This is a free format string which identifies the implementation with
 * detailed version information. The string may include information about
 * implementation version, bug fix level, version control tags, build number,
 * etc details which exactly identify the implementation code base.
 * User may include this information e.g. to bug reports. The string is null
 * terminated.
 *
 * @see odp_version_api_str(), odp_version_impl_name()
 *
 * @return Pointer to implementation specific version identifier string
  */
const char *odp_version_impl_str(void);
/**
 * @}
 */

#ifdef __cplusplus
}
#endif

#include <odp/visibility_end.h>
#endif