logind.h revision cc3773810855956bad92337cee8fa193584ab62e
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#pragma once
/***
This file is part of systemd.
Copyright 2011 Lennart Poettering
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <stdbool.h>
#include <inttypes.h>
#include <libudev.h>
#include "sd-event.h"
#include "sd-bus.h"
#include "util.h"
#include "list.h"
#include "hashmap.h"
#include "set.h"
#include "logind-device.h"
#include "logind-seat.h"
#include "logind-session.h"
#include "logind-user.h"
#include "logind-inhibit.h"
#include "logind-button.h"
#include "logind-action.h"
struct Manager {
struct udev_monitor *udev_seat_monitor, *udev_device_monitor, *udev_vcsa_monitor, *udev_button_monitor;
int console_active_fd;
unsigned n_autovts;
unsigned reserve_vt;
int reserve_vt_fd;
char **kill_only_users, **kill_exclude_users;
bool kill_user_processes;
unsigned long session_counter;
unsigned long inhibit_counter;
/* If an action is currently being executed or is delayed,
* this is != 0 and encodes what is being done */
contains the unit name we are supposed to start after the
delay is over */
const char *action_unit;
* the job of it */
char *action_job;
};
Manager *manager_new(void);
void manager_free(Manager *m);
int manager_enumerate_devices(Manager *m);
int manager_enumerate_buttons(Manager *m);
int manager_enumerate_seats(Manager *m);
int manager_enumerate_sessions(Manager *m);
int manager_enumerate_users(Manager *m);
int manager_enumerate_inhibitors(Manager *m);
int manager_startup(Manager *m);
int manager_run(Manager *m);
extern const sd_bus_vtable manager_vtable[];
int bus_manager_shutdown_or_sleep_now_or_later(Manager *m, const char *unit_name, InhibitWhat w, sd_bus_error *error);
int manager_start_scope(Manager *manager, const char *scope, pid_t pid, const char *slice, const char *description, const char *after, const char *kill_mode, sd_bus_error *error, char **job);
int manager_kill_unit(Manager *manager, const char *unit, KillWho who, int signo, sd_bus_error *error);
/* gperf lookup function */