]> git.saurik.com Git - apple/xnu.git/blame_incremental - EXTERNAL_HEADERS/img4/api.h
xnu-7195.101.1.tar.gz
[apple/xnu.git] / EXTERNAL_HEADERS / img4 / api.h
... / ...
CommitLineData
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 <stdint.h>
13#include <stdbool.h>
14#include <os/base.h>
15
16#ifndef KERNEL
17#include <os/availability.h>
18#include <unistd.h>
19#endif
20
21#if !XNU_KERNEL_PRIVATE
22#include <TargetConditionals.h>
23#endif
24
25/*!
26 * @const IMG4_API_VERSION
27 * The API version of the library. This version will be changed in accordance
28 * with new API introductions so that callers may submit code to the build that
29 * adopts those new APIs before the APIs land by using the following pattern:
30 *
31 * #if IMG4_API_VERSION >= 20180424
32 * img4_new_api();
33 * #endif
34 *
35 * In this example, the library maintainer and API adopter agree on an API
36 * version of 20180424 ahead of time for the introduction of
37 * img4_new_api(). When a libdarwin with that API version is submitted, the
38 * project is rebuilt, and the new API becomes active.
39 *
40 * Breaking API changes will be both covered under this mechanism as well as
41 * individual preprocessor macros in this header that declare new behavior as
42 * required.
43 */
44#define IMG4_API_VERSION (20200724u)
45
46#if IMG4_TAPI || (!defined(KERNEL) && !IMG4_PROJECT_BUILD)
47#define IMG4_API_AVAILABLE_20180112 \
48 API_AVAILABLE( \
49 macos(10.15), \
50 ios(12.0), \
51 tvos(12.0), \
52 watchos(5.0))
53
54#define IMG4_API_AVAILABLE_20180112_DEPRECATED \
55 API_DEPRECATED_WITH_REPLACEMENT( \
56 "img4_firmware_t", \
57 macos(10.15, 11.0), \
58 ios(12.0, 14.0), \
59 tvos(12.0, 14.0), \
60 watchos(5.0, 7.0))
61#define IMG4_API_AVAILABLE_20181004 \
62 API_DEPRECATED_WITH_REPLACEMENT( \
63 "img4_firmware_t", \
64 macos(10.15, 11.0), \
65 ios(12.2, 14.0), \
66 tvos(12.2, 14.0), \
67 watchos(5.2, 7.0))
68
69// This API version introduced the nonce manager which was not deprecated when
70// the new API was introduced.
71#define IMG4_API_AVAILABLE_20181106 \
72 API_AVAILABLE( \
73 macos(10.15), \
74 ios(12.2), \
75 tvos(12.2), \
76 watchos(5.2))
77#define IMG4_API_AVAILABLE_20181106_DEPRECATED \
78 API_DEPRECATED_WITH_REPLACEMENT( \
79 "img4_firmware_t", \
80 macos(10.15, 11.0), \
81 ios(12.2, 14.0), \
82 tvos(12.2, 14.0), \
83 watchos(5.2, 7.0))
84#define IMG4_API_AVAILABLE_20190125 \
85 API_DEPRECATED_WITH_REPLACEMENT( \
86 "img4_firmware_t", \
87 macos(10.15, 11.0), \
88 ios(13.0, 14.0), \
89 tvos(13.0, 14.0), \
90 watchos(6.0, 7.0))
91#define IMG4_API_AVAILABLE_20191001 \
92 API_DEPRECATED_WITH_REPLACEMENT( \
93 "img4_firmware_t", \
94 macos(10.15.2, 11.0), \
95 ios(13.3, 14.0), \
96 tvos(13.3, 14.0), \
97 watchos(6.1.1, 7.0))
98#define IMG4_API_AVAILABLE_20191108 \
99 API_DEPRECATED_WITH_REPLACEMENT( \
100 "img4_firmware_t", \
101 macos(11.0, 11.0), \
102 ios(14.0, 14.0), \
103 tvos(14.0, 14.0), \
104 watchos(7.0, 7.0))
105#define IMG4_API_AVAILABLE_20200221 \
106 API_DEPRECATED_WITH_REPLACEMENT( \
107 "img4_firmware_t", \
108 macos(11.0, 11.0), \
109 ios(14.0, 14.0), \
110 tvos(14.0, 14.0), \
111 watchos(7.0, 7.0))
112#define IMG4_API_AVAILABLE_20200310 \
113 API_DEPRECATED_WITH_REPLACEMENT( \
114 "img4_firmware_t", \
115 macos(11.0, 11.0), \
116 ios(14.0, 14.0), \
117 tvos(14.0, 14.0), \
118 watchos(7.0, 7.0))
119#define IMG4_API_AVAILABLE_20200508 \
120 API_AVAILABLE( \
121 macos(11.0), \
122 ios(14.0), \
123 tvos(14.0), \
124 watchos(7.0), \
125 bridgeos(5.0))
126#define IMG4_API_AVAILABLE_20200608 \
127 API_AVAILABLE( \
128 macos(11.0), \
129 ios(14.0), \
130 tvos(14.0), \
131 watchos(7.0), \
132 bridgeos(5.0))
133#define IMG4_API_AVAILABLE_20200724 \
134 API_AVAILABLE( \
135 macos(11.0), \
136 ios(14.0), \
137 tvos(14.0), \
138 watchos(7.0), \
139 bridgeos(5.0))
140#else
141#define IMG4_API_AVAILABLE_20180112
142#define IMG4_API_AVAILABLE_20180112_DEPRECATED
143#define IMG4_API_AVAILABLE_20181004
144#define IMG4_API_AVAILABLE_20181106
145#define IMG4_API_AVAILABLE_20181106_DEPRECATED
146#define IMG4_API_AVAILABLE_20190125
147#define IMG4_API_AVAILABLE_20191001
148#define IMG4_API_AVAILABLE_20191108
149#define IMG4_API_AVAILABLE_20200221
150#define IMG4_API_AVAILABLE_20200310
151#define IMG4_API_AVAILABLE_20200508
152#define IMG4_API_AVAILABLE_20200608
153#define IMG4_API_AVAILABLE_20200724
154#endif
155
156/*!
157 * @typedef img4_struct_version_t
158 * A type describing the version of a structure in the library.
159 */
160IMG4_API_AVAILABLE_20180112
161typedef uint16_t img4_struct_version_t;
162
163#endif // __IMG4_API_H