logind-action.h revision 23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering#ifndef foologindactionhfoo
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering#define foologindactionhfoo
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering/***
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering This file is part of systemd.
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering Copyright 2012 Lennart Poettering
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering systemd is free software; you can redistribute it and/or modify it
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering under the terms of the GNU Lesser General Public License as published by
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering the Free Software Foundation; either version 2.1 of the License, or
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering (at your option) any later version.
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering systemd is distributed in the hope that it will be useful, but
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering Lesser General Public License for more details.
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering You should have received a copy of the GNU Lesser General Public License
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering***/
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poetteringtypedef enum HandleAction {
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering HANDLE_IGNORE,
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering HANDLE_POWEROFF,
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering HANDLE_REBOOT,
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering HANDLE_HALT,
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering HANDLE_KEXEC,
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering HANDLE_SUSPEND,
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering HANDLE_HIBERNATE,
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering HANDLE_HYBRID_SLEEP,
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering HANDLE_LOCK,
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering _HANDLE_ACTION_MAX,
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering _HANDLE_ACTION_INVALID = -1
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering} HandleAction;
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering#include "logind.h"
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering#include "logind-inhibit.h"
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poetteringint manager_handle_action(
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering Manager *m,
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering InhibitWhat inhibit_key,
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering HandleAction handle,
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering bool ignore_inhibited,
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering bool is_edge);
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poetteringconst char* handle_action_to_string(HandleAction h);
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart PoetteringHandleAction handle_action_from_string(const char *s);
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poetteringint config_parse_handle_action(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering
23406ce58aa7142e8df3c5c9e5ac34a01e90e3e0Lennart Poettering#endif