]>
git.saurik.com Git - apple/libc.git/blob - os/api.h
2 * Copyright (c) 2018 Apple Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
26 * API macros. libdarwin provides APIs for low-level userspace projects in the
27 * Darwin operating system.
29 * - C language additions
30 * - POSIX and BSD API additions
31 * - POSIX and BSD convenience wrappers
32 * - Mach API additions and wrappers with clearer semantics
34 * Additions which extend the C language are not prefixed and are therefore not
35 * included by default when including this header.
37 * Additions to API families conforming to ANSI C carry the "os_" prefix.
39 * Additions to API families conforming to POSIX carry the "_np" ("Not POSIX")
42 * Additions to API families conforming to both POSIX and ANSI C carry the "_np"
45 * Convenience wrappers for POSIX and BSD APIs carry the "os_" prefix.
47 * New APIs formalizing Darwin workflows carry the "os_" prefix.
49 #ifndef __DARWIN_API_H
50 #define __DARWIN_API_H
52 #include <os/availability.h>
56 * @const DARWIN_API_VERSION
57 * The API version of the library. This version will be changed in accordance
58 * with new API introductions so that callers may submit code to the build that
59 * adopts those new APIs before the APIs land by using the following pattern:
61 * #if DARWIN_API_VERSION >= 20180424
65 * In this example, the libdarwin maintainer and API adopter agree on an API
66 * version of 20180424 ahead of time for the introduction of
67 * darwin_new_api_call(). When a libdarwin with that API version is submitted,
68 * the project is rebuilt, and the new API becomes active.
70 * Breaking API changes will be both covered under this mechanism as well as
71 * individual preprocessor macros in this header that declare new behavior as
74 #define DARWIN_API_VERSION 20200526u
76 #if !DARWIN_BUILDING_LIBSYSTEM_DARWIN
77 #define DARWIN_API_AVAILABLE_20170407 \
78 API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0))
79 #define DARWIN_API_AVAILABLE_20180727 \
80 API_AVAILABLE(macos(10.15), ios(13.0), tvos(13.0), watchos(6.0))
81 #define DARWIN_API_AVAILABLE_20181020 \
82 API_AVAILABLE(macos(10.15), ios(13.0), tvos(13.0), watchos(6.0))
83 #define DARWIN_API_AVAILABLE_20181020 \
84 API_AVAILABLE(macos(10.15), ios(13.0), tvos(13.0), watchos(6.0))
85 #define DARWIN_API_AVAILABLE_20190830 \
86 API_AVAILABLE(macos(10.15.2), ios(13.3), tvos(13.3), watchos(6.1.1))
87 #define DARWIN_API_AVAILABLE_20191015 \
88 API_AVAILABLE(macos(10.15.2), ios(13.3), tvos(13.3), watchos(6.1.1))
89 #define DARWIN_API_AVAILABLE_20200220 \
90 API_AVAILABLE(macos(10.16), ios(14.0), tvos(14.0), watchos(7.0))
91 #define DARWIN_API_AVAILABLE_20200401 \
92 API_AVAILABLE(macos(10.16), ios(14.0), tvos(14.0), watchos(7.0))
93 #define DARWIN_API_AVAILABLE_20200526 \
94 API_AVAILABLE(macos(10.16), ios(14.0), tvos(14.0), watchos(7.0))
96 #define DARWIN_API_AVAILABLE_20170407
97 #define DARWIN_API_AVAILABLE_20180727
98 #define DARWIN_API_AVAILABLE_20181020
99 #define DARWIN_API_AVAILABLE_20190830
100 #define DARWIN_API_AVAILABLE_20191015
101 #define DARWIN_API_AVAILABLE_20200220
102 #define DARWIN_API_AVAILABLE_20200401
103 #define DARWIN_API_AVAILABLE_20200526
107 * @typedef os_struct_magic_t
108 * A type representing the magic number of a transparent structure.
110 typedef uint32_t os_struct_magic_t
;
113 * @typedef os_struct_version_t
114 * A type representing the version of a transparent structure.
116 typedef uint32_t os_struct_version_t
;
118 #endif // __DARWIN_API_H