]> git.saurik.com Git - apple/libc.git/blame_incremental - os/api.h
Libc-1439.100.3.tar.gz
[apple/libc.git] / os / api.h
... / ...
CommitLineData
1/*
2 * Copyright (c) 2018 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
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
11 * file.
12 *
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.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24/*!
25 * @header
26 * API macros. libdarwin provides APIs for low-level userspace projects in the
27 * Darwin operating system.
28 *
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
33 *
34 * Additions which extend the C language are not prefixed and are therefore not
35 * included by default when including this header.
36 *
37 * Additions to API families conforming to ANSI C carry the "os_" prefix.
38 *
39 * Additions to API families conforming to POSIX carry the "_np" ("Not POSIX")
40 * suffix.
41 *
42 * Additions to API families conforming to both POSIX and ANSI C carry the "_np"
43 * suffix.
44 *
45 * Convenience wrappers for POSIX and BSD APIs carry the "os_" prefix.
46 *
47 * New APIs formalizing Darwin workflows carry the "os_" prefix.
48 */
49#ifndef __DARWIN_API_H
50#define __DARWIN_API_H
51
52#include <os/availability.h>
53#include <stdint.h>
54
55/*!
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:
60 *
61 * #if DARWIN_API_VERSION >= 20180424
62 * darwin_new_api();
63 * #endif
64 *
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.
69 *
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
72 * required.
73 */
74#define DARWIN_API_VERSION 20200526u
75
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))
95#else
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
104#endif
105
106/*!
107 * @typedef os_struct_magic_t
108 * A type representing the magic number of a transparent structure.
109 */
110typedef uint32_t os_struct_magic_t;
111
112/*!
113 * @typedef os_struct_version_t
114 * A type representing the version of a transparent structure.
115 */
116typedef uint32_t os_struct_version_t;
117
118#endif // __DARWIN_API_H