chiark / gitweb /
device: allow easy identification of network interfaces without their full sysfs...
[elogind.git] / swap.h
1 /*-*- Mode: C; c-basic-offset: 8 -*-*/
2
3 #ifndef fooswaphfoo
4 #define fooswaphfoo
5
6 /***
7   This file is part of systemd.
8
9   Copyright 2010 Lennart Poettering
10   Copyright 2010 Maarten Lankhorst
11
12   systemd is free software; you can redistribute it and/or modify it
13   under the terms of the GNU General Public License as published by
14   the Free Software Foundation; either version 2 of the License, or
15   (at your option) any later version.
16
17   systemd is distributed in the hope that it will be useful, but
18   WITHOUT ANY WARRANTY; without even the implied warranty of
19   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20   General Public License for more details.
21
22   You should have received a copy of the GNU General Public License
23   along with systemd; If not, see <http://www.gnu.org/licenses/>.
24 ***/
25
26 typedef struct Swap Swap;
27
28 #include "unit.h"
29
30 typedef enum SwapState {
31         SWAP_DEAD,
32         SWAP_ACTIVE,
33         SWAP_MAINTAINANCE,
34         _SWAP_STATE_MAX,
35         _SWAP_STATE_INVALID = -1
36 } SwapState;
37
38 struct Swap {
39         Meta meta;
40
41         char *what;
42
43         int priority;
44
45         bool no_auto;
46
47         bool from_proc_swaps_only:1;
48         bool found_in_proc_swaps:1;
49
50         MountState state, deserialized_state;
51 };
52
53 extern const UnitVTable swap_vtable;
54
55 const char* swap_state_to_string(SwapState i);
56 SwapState swap_state_from_string(const char *s);
57
58 extern int swap_add_one(Manager *m, const char *what, bool no_auto, int prio, bool from_proc_swap);
59
60 #endif