1/*!
2 * @header
3 * API definitions.
4 */
5#ifndef __IMG4_API_H
6#define __IMG4_API_H
7
8#ifndef __IMG4_INDIRECT
9#error "Please #include <img4/firmware.h> instead of this file directly"
10#endif // __IMG4_INDIRECT
11
12#include <img4/shim.h>
13
14/*!
15 * @const IMG4_API_VERSION
16 * The API version of the library. This version will be changed in accordance
17 * with new API introductions so that callers may submit code to the build that
18 * adopts those new APIs before the APIs land by using the following pattern:
19 *
20 * #if IMG4_API_VERSION >= 20180424
21 * img4_new_api();
22 * #endif
23 *
24 * In this example, the library maintainer and API adopter agree on an API
25 * version of 20180424 ahead of time for the introduction of
26 * img4_new_api(). When a libdarwin with that API version is submitted, the
27 * project is rebuilt, and the new API becomes active.
28 *
29 * Breaking API changes will be both covered under this mechanism as well as
30 * individual preprocessor macros in this header that declare new behavior as
31 * required.
32 *
33 * @note
34 * For a period of time, the API version was incorrectly defined as 20212105
35 * when it should have been 20210521. Avoid version comparisons across that
36 * version epoch.
37 */
38#define IMG4_API_VERSION (20221202u)
39
40#if IMG4_TARGET_DARWIN
41#define IMG4_API_AVAILABLE_FALL_2018 \
42 API_AVAILABLE( \
43 macos(10.15), \
44 ios(12.0), \
45 tvos(12.0), \
46 watchos(5.0))
47
48#define IMG4_API_DEPRECATED_FALL_2018 \
49 API_DEPRECATED_WITH_REPLACEMENT( \
50 "img4_firmware_t", \
51 macos(10.15, 11.0), \
52 ios(12.2, 14.0), \
53 tvos(12.2, 14.0), \
54 watchos(5.2, 7.0))
55
56#define IMG4_API_AVAILABLE_SPRING_2019 \
57 API_AVAILABLE(\
58 macos(10.15), \
59 ios(12.2), \
60 tvos(12.2), \
61 watchos(5.2))
62
63#define IMG4_API_AVAILABLE_FALL_2020 \
64 API_AVAILABLE( \
65 macos(11.0), \
66 ios(14.0), \
67 tvos(14.0), \
68 watchos(7.0), \
69 bridgeos(5.0))
70
71#define IMG4_API_AVAILABLE_FALL_2021 \
72 API_AVAILABLE( \
73 macos(12.0), \
74 ios(15.0), \
75 tvos(15.0), \
76 watchos(8.0), \
77 bridgeos(6.0))
78
79#define IMG4_API_AVAILABLE_FALL_2021_B \
80 API_AVAILABLE( \
81 macos(12.1), \
82 ios(15.1), \
83 tvos(15.1), \
84 watchos(8.1), \
85 bridgeos(6.1))
86#define IMG4_API_AVAILABLE_FALL_2022 \
87 API_AVAILABLE( \
88 macos(13.0), \
89 ios(16.0), \
90 tvos(16.0), \
91 watchos(9.0), \
92 bridgeos(7.0))
93#define IMG4_API_AVAILABLE_SPRING_2023 \
94 API_AVAILABLE( \
95 macos(13.3), \
96 ios(16.4), \
97 tvos(16.4), \
98 watchos(9.4), \
99 bridgeos(7.4))
100#else
101#define IMG4_API_AVAILABLE_FALL_2018
102#define IMG4_API_DEPRECATED_FALL_2018
103#define IMG4_API_AVAILABLE_SPRING_2019
104#define IMG4_API_AVAILABLE_FALL_2020
105#define IMG4_API_AVAILABLE_FALL_2021
106#define IMG4_API_AVAILABLE_FALL_2021_B
107#define IMG4_API_AVAILABLE_FALL_2022
108#define IMG4_API_AVAILABLE_SPRING_2023
109#endif
110
111#define IMG4_API_AVAILABLE_20180112 IMG4_API_AVAILABLE_FALL_2018
112#define IMG4_API_AVAILABLE_20181106 IMG4_API_AVAILABLE_SPRING_2019
113#define IMG4_API_AVAILABLE_20200508 IMG4_API_AVAILABLE_FALL_2020
114#define IMG4_API_AVAILABLE_20200608 IMG4_API_AVAILABLE_FALL_2020
115#define IMG4_API_AVAILABLE_20200724 IMG4_API_AVAILABLE_FALL_2020
116#define IMG4_API_AVAILABLE_20210113 IMG4_API_AVAILABLE_FALL_2021
117#define IMG4_API_AVAILABLE_20210205 IMG4_API_AVAILABLE_FALL_2021
118#define IMG4_API_AVAILABLE_20210226 IMG4_API_AVAILABLE_FALL_2021
119#define IMG4_API_AVAILABLE_20210305 IMG4_API_AVAILABLE_FALL_2021
120#define IMG4_API_AVAILABLE_20210521 IMG4_API_AVAILABLE_FALL_2021
121#define IMG4_API_AVAILABLE_20210624 IMG4_API_AVAILABLE_FALL_2021
122#define IMG4_API_AVAILABLE_20210731 IMG4_API_AVAILABLE_FALL_2021_B
123#define IMG4_API_AVAILABLE_20211105 IMG4_API_AVAILABLE_FALL_2022
124#define IMG4_API_AVAILABLE_20211112 IMG4_API_AVAILABLE_FALL_2022
125#define IMG4_API_AVAILABLE_20211119 IMG4_API_AVAILABLE_FALL_2022
126#define IMG4_API_AVAILABLE_20211126 IMG4_API_AVAILABLE_FALL_2022
127#define IMG4_API_AVAILABLE_20211224 IMG4_API_AVAILABLE_FALL_2022
128#define IMG4_API_AVAILABLE_20220128 IMG4_API_AVAILABLE_FALL_2022
129#define IMG4_API_AVAILABLE_20220322 IMG4_API_AVAILABLE_FALL_2022
130#define IMG4_API_AVAILABLE_20220401 IMG4_API_AVAILABLE_FALL_2022
131#define IMG4_API_AVAILABLE_20220513 IMG4_API_AVAILABLE_FALL_2022
132#define IMG4_API_AVAILABLE_20220711 IMG4_API_AVAILABLE_FALL_2022
133#define IMG4_API_AVAILABLE_20220714 IMG4_API_AVAILABLE_FALL_2022
134#define IMG4_API_AVAILABLE_20220715 IMG4_API_AVAILABLE_FALL_2022
135#define IMG4_API_AVAILABLE_20220912 IMG4_API_AVAILABLE_FALL_2022
136#define IMG4_API_AVAILABLE_20220915 IMG4_API_AVAILABLE_SPRING_2023
137#define IMG4_API_AVAILABLE_20221202 IMG4_API_AVAILABLE_SPRING_2023
138
139/*!
140 * @typedef img4_struct_version_t
141 * A type describing the version of a structure in the library.
142 */
143IMG4_API_AVAILABLE_20180112
144typedef uint16_t img4_struct_version_t;
145
146#endif // __IMG4_API_H
147