1 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
3 #ifndef foologindinhibithfoo
4 #define foologindinhibithfoo
7 This file is part of systemd.
9 Copyright 2012 Lennart Poettering
11 systemd is free software; you can redistribute it and/or modify it
12 under the terms of the GNU Lesser General Public License as published by
13 the Free Software Foundation; either version 2.1 of the License, or
14 (at your option) any later version.
16 systemd is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 Lesser General Public License for more details.
21 You should have received a copy of the GNU Lesser General Public License
22 along with systemd; If not, see <http://www.gnu.org/licenses/>.
25 typedef struct Inhibitor Inhibitor;
30 typedef enum InhibitWhat {
34 INHIBIT_HANDLE_POWER_KEY = 8,
35 INHIBIT_HANDLE_SUSPEND_KEY = 16,
36 INHIBIT_HANDLE_HIBERNATE_KEY = 32,
37 INHIBIT_HANDLE_LID_SWITCH = 64,
38 _INHIBIT_WHAT_MAX = 128,
39 _INHIBIT_WHAT_INVALID = -1
42 typedef enum InhibitMode {
46 _INHIBIT_MODE_INVALID = -1
50 #include "logind-seat.h"
74 Inhibitor* inhibitor_new(Manager *m, const char *id);
75 void inhibitor_free(Inhibitor *i);
77 int inhibitor_save(Inhibitor *i);
78 int inhibitor_load(Inhibitor *i);
80 int inhibitor_start(Inhibitor *i);
81 int inhibitor_stop(Inhibitor *i);
83 int inhibitor_create_fifo(Inhibitor *i);
84 void inhibitor_remove_fifo(Inhibitor *i);
86 InhibitWhat manager_inhibit_what(Manager *m, InhibitMode mm);
87 bool manager_is_inhibited(Manager *m, InhibitWhat w, InhibitMode mm, dual_timestamp *since, bool ignore_inactive, bool ignore_uid, uid_t uid);
89 const char *inhibit_what_to_string(InhibitWhat k);
90 InhibitWhat inhibit_what_from_string(const char *s);
92 const char *inhibit_mode_to_string(InhibitMode k);
93 InhibitMode inhibit_mode_from_string(const char *s);