]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/login/logind-action.h
Add SPDX license identifiers to source files under the LGPL
[thirdparty/systemd.git] / src / login / logind-action.h
CommitLineData
53e1b683 1/* SPDX-License-Identifier: LGPL-2.1+ */
05d3a176 2#pragma once
23406ce5
LP
3
4/***
5 This file is part of systemd.
6
7 Copyright 2012 Lennart Poettering
8
9 systemd is free software; you can redistribute it and/or modify it
10 under the terms of the GNU Lesser General Public License as published by
11 the Free Software Foundation; either version 2.1 of the License, or
12 (at your option) any later version.
13
14 systemd is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public License
20 along with systemd; If not, see <http://www.gnu.org/licenses/>.
21***/
22
23typedef enum HandleAction {
24 HANDLE_IGNORE,
25 HANDLE_POWEROFF,
26 HANDLE_REBOOT,
27 HANDLE_HALT,
28 HANDLE_KEXEC,
29 HANDLE_SUSPEND,
30 HANDLE_HIBERNATE,
31 HANDLE_HYBRID_SLEEP,
32 HANDLE_LOCK,
33 _HANDLE_ACTION_MAX,
34 _HANDLE_ACTION_INVALID = -1
35} HandleAction;
36
07630cea 37#include "logind-inhibit.h"
71d35b6b 38#include "logind.h"
23406ce5
LP
39
40int manager_handle_action(
41 Manager *m,
42 InhibitWhat inhibit_key,
43 HandleAction handle,
44 bool ignore_inhibited,
45 bool is_edge);
46
44a6b1b6
ZJS
47const char* handle_action_to_string(HandleAction h) _const_;
48HandleAction handle_action_from_string(const char *s) _pure_;
23406ce5 49
71a61510 50int config_parse_handle_action(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);