xref: /xnu-8020.140.41/EXTERNAL_HEADERS/img4/api.h (revision 27b03b360a988dfd3dfdf34262bb0042026747cc)
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 #define IMG4_API_VERSION (20212105u)
34 
35 #if IMG4_TARGET_DARWIN
36 #define IMG4_API_AVAILABLE_FALL_2018 \
37 		API_AVAILABLE( \
38 			macos(10.15), \
39 			ios(12.0), \
40 			tvos(12.0), \
41 			watchos(5.0))
42 
43 #define IMG4_API_DEPRECATED_FALL_2018 \
44 		API_DEPRECATED_WITH_REPLACEMENT( \
45 			"img4_firmware_t", \
46 			macos(10.15, 11.0), \
47 			ios(12.2, 14.0), \
48 			tvos(12.2, 14.0), \
49 			watchos(5.2, 7.0))
50 
51 #define IMG4_API_AVAILABLE_SPRING_2019 \
52 		API_AVAILABLE(\
53 			macos(10.15), \
54 			ios(12.2), \
55 			tvos(12.2), \
56 			watchos(5.2))
57 
58 #define IMG4_API_AVAILABLE_FALL_2020 \
59 		API_AVAILABLE( \
60 			macos(11.0), \
61 			ios(14.0), \
62 			tvos(14.0), \
63 			watchos(7.0), \
64 			bridgeos(5.0))
65 
66 #define IMG4_API_AVAILABLE_FALL_2021 \
67 		API_AVAILABLE( \
68 			macos(12.0), \
69 			ios(15.0), \
70 			tvos(15.0), \
71 			watchos(8.0), \
72 			bridgeos(6.0))
73 #else
74 #define IMG4_API_AVAILABLE_FALL_2018
75 #define IMG4_API_DEPRECATED_FALL_2018
76 #define IMG4_API_AVAILABLE_SPRING_2019
77 #define IMG4_API_AVAILABLE_FALL_2020
78 #define IMG4_API_AVAILABLE_FALL_2021
79 #endif
80 
81 #define IMG4_API_AVAILABLE_20180112 IMG4_API_AVAILABLE_FALL_2018
82 #define IMG4_API_AVAILABLE_20181106 IMG4_API_AVAILABLE_SPRING_2019
83 #define IMG4_API_AVAILABLE_20200508 IMG4_API_AVAILABLE_FALL_2020
84 #define IMG4_API_AVAILABLE_20200608 IMG4_API_AVAILABLE_FALL_2020
85 #define IMG4_API_AVAILABLE_20200724 IMG4_API_AVAILABLE_FALL_2020
86 #define IMG4_API_AVAILABLE_20210113 IMG4_API_AVAILABLE_FALL_2021
87 #define IMG4_API_AVAILABLE_20210205 IMG4_API_AVAILABLE_FALL_2021
88 #define IMG4_API_AVAILABLE_20210226 IMG4_API_AVAILABLE_FALL_2021
89 #define IMG4_API_AVAILABLE_20210305 IMG4_API_AVAILABLE_FALL_2021
90 #define IMG4_API_AVAILABLE_20210521 IMG4_API_AVAILABLE_FALL_2021
91 
92 /*!
93  * @typedef img4_struct_version_t
94  * A type describing the version of a structure in the library.
95  */
96 IMG4_API_AVAILABLE_20180112
97 typedef uint16_t img4_struct_version_t;
98 
99 #endif // __IMG4_API_H
100