2 * Copyright (c) 2019 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@
24 #ifndef __OS_COLLECTIONS_MAP_H
25 #define __OS_COLLECTIONS_MAP_H
27 #include <os/collections_map.h>
29 OS_ASSUME_NONNULL_BEGIN
32 #ifndef os_map_str_payload_handler_t
33 typedef bool (^os_map_str_payload_handler_t
) (const char *, void *);
36 #ifndef os_map_32_payload_handler_t
37 typedef bool (^os_map_32_payload_handler_t
) (uint32_t, void *);
40 #ifndef os_map_64_payload_handler_t
41 typedef bool (^os_map_64_payload_handler_t
) (uint64_t, void *);
44 #ifndef os_map_128_payload_handler_t
45 typedef bool (^os_map_128_payload_handler_t
) (os_map_128_key_t
, void *);
50 os_map_str_entry(os_map_str_t
*m
, const char *key
);
52 OS_OVERLOADABLE OS_ALWAYS_INLINE
53 static inline const char * _Nullable
54 os_map_entry(os_map_str_t
*m
, const char *key
)
56 return os_map_str_entry(m
, key
);
62 #define IN_MAP(PREFIX, SUFFIX) PREFIX ## os_map_str ## SUFFIX
63 #define os_map_key_t const char *
64 #include "_collections_map.in.h"
68 #define IN_MAP(PREFIX, SUFFIX) PREFIX ## os_map_32 ## SUFFIX
69 #define os_map_key_t uint32_t
70 #include "_collections_map.in.h"
74 #define IN_MAP(PREFIX, SUFFIX) PREFIX ## os_map_64 ## SUFFIX
75 #define os_map_key_t uint64_t
76 #include "_collections_map.in.h"
80 #define IN_MAP(PREFIX, SUFFIX) PREFIX ## os_map_128 ## SUFFIX
81 #define os_map_key_t os_map_128_key_t
82 #include "_collections_map.in.h"
86 #endif /* __OS_COLLECTIONS_MAP_H */