]>
Commit | Line | Data |
---|---|---|
6c12b52e LP |
1 | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ |
2 | ||
3 | #pragma once | |
4 | ||
5 | /*** | |
6 | This file is part of systemd. | |
7 | ||
8 | Copyright 2013 Lennart Poettering | |
9 | ||
10 | systemd is free software; you can redistribute it and/or modify it | |
11 | under the terms of the GNU Lesser General Public License as published by | |
12 | the Free Software Foundation; either version 2.1 of the License, or | |
13 | (at your option) any later version. | |
14 | ||
15 | systemd is distributed in the hope that it will be useful, but | |
16 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
18 | Lesser General Public License for more details. | |
19 | ||
20 | You should have received a copy of the GNU Lesser General Public License | |
21 | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
22 | ***/ | |
23 | ||
24 | typedef struct Scope Scope; | |
25 | ||
6c12b52e LP |
26 | #include "kill.h" |
27 | ||
6c12b52e LP |
28 | typedef enum ScopeResult { |
29 | SCOPE_SUCCESS, | |
30 | SCOPE_FAILURE_RESOURCES, | |
31 | SCOPE_FAILURE_TIMEOUT, | |
32 | _SCOPE_RESULT_MAX, | |
33 | _SCOPE_RESULT_INVALID = -1 | |
34 | } ScopeResult; | |
35 | ||
36 | struct Scope { | |
37 | Unit meta; | |
38 | ||
39 | CGroupContext cgroup_context; | |
40 | KillContext kill_context; | |
41 | ||
42 | ScopeState state, deserialized_state; | |
43 | ScopeResult result; | |
44 | ||
45 | usec_t timeout_stop_usec; | |
46 | ||
2d4a39e7 LP |
47 | char *controller; |
48 | ||
718db961 | 49 | sd_event_source *timer_event_source; |
6c12b52e LP |
50 | }; |
51 | ||
52 | extern const UnitVTable scope_vtable; | |
53 | ||
a911bb9a LP |
54 | int scope_abandon(Scope *s); |
55 | ||
6c12b52e LP |
56 | const char* scope_result_to_string(ScopeResult i) _const_; |
57 | ScopeResult scope_result_from_string(const char *s) _pure_; |