]>
Commit | Line | Data |
---|---|---|
19fa75a9 A |
1 | /* |
2 | * Copyright (c) 2020 Apple Inc. All rights reserved. | |
3 | * | |
4 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
5 | * you may not use this file except in compliance with the License. | |
6 | * You may obtain a copy of the License at | |
7 | * | |
8 | * http://www.apache.org/licenses/LICENSE-2.0 | |
9 | * | |
10 | * Unless required by applicable law or agreed to in writing, software | |
11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | * See the License for the specific language governing permissions and | |
14 | * limitations under the License. | |
15 | */ | |
16 | ||
17 | #ifndef SETUP_ASSISTANT_HELPER_H | |
18 | #define SETUP_ASSISTANT_HELPER_H | |
19 | ||
20 | #include <stdbool.h> | |
21 | #include <os/base.h> | |
22 | ||
23 | __BEGIN_DECLS | |
24 | ||
25 | OS_ASSUME_NONNULL_BEGIN | |
26 | ||
27 | OS_CLOSED_ENUM(buddy_state, int, | |
28 | buddy_state_indeterminate = 0, | |
29 | buddy_state_in_process = 1, | |
30 | buddy_state_done = 2 | |
31 | ); | |
32 | ||
33 | static inline const char * | |
34 | buddy_state_to_string(buddy_state_t state) | |
35 | { | |
36 | switch (state) { | |
37 | case buddy_state_indeterminate: return "indeterminate"; | |
38 | case buddy_state_in_process: return "in_process"; | |
39 | case buddy_state_done: return "done"; | |
40 | default: return "<INVALID STATE>"; | |
41 | } | |
42 | } | |
43 | ||
44 | buddy_state_t | |
45 | assistant_helper_get_buddy_state(void); | |
46 | ||
47 | typedef void | |
48 | (^buddy_done_handler_t)(void); | |
49 | ||
50 | void | |
51 | assistant_helper_notify_when_buddy_done(buddy_done_handler_t handler); | |
52 | ||
53 | OS_ASSUME_NONNULL_END | |
54 | ||
55 | __END_DECLS | |
56 | ||
57 | #endif // __ASetupAssistantHelperDotH__ |