logind-session.h revision 7ba643863116cd0b5abf048e53321f93e5743f69
/*-*- 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 "list.h"
#include "util.h"
#include "logind.h"
#include "logind-seat.h"
#include "logind-user.h"
typedef enum SessionState {
SESSION_ONLINE, /* Logged in */
SESSION_ACTIVE, /* Logged in and in the fg */
SESSION_CLOSING, /* Logged out, but processes still remain */
} SessionState;
typedef enum SessionType {
} SessionType;
typedef enum SessionClass {
} SessionClass;
typedef enum KillWho {
_KILL_WHO_INVALID = -1
} KillWho;
struct Session {
char *id;
char *state_file;
char *tty;
char *display;
bool remote;
char *remote_user;
char *remote_host;
char *service;
int vtnr;
int fifo_fd;
char *fifo_path;
char *cgroup_path;
char **controllers, **reset_controllers;
bool idle_hint;
bool kill_processes;
bool in_gc_queue:1;
bool started:1;
};
void session_free(Session *s);
void session_add_to_gc_queue(Session *s);
int session_activate(Session *s);
bool session_is_active(Session *s);
void session_set_idle_hint(Session *s, bool b);
int session_create_fifo(Session *s);
void session_remove_fifo(Session *s);
int session_start(Session *s);
int session_stop(Session *s);
int session_save(Session *s);
int session_load(Session *s);
char *session_bus_path(Session *s);
extern const DBusObjectPathVTable bus_session_vtable;
const char* session_state_to_string(SessionState t);
SessionState session_state_from_string(const char *s);
const char* session_type_to_string(SessionType t);
SessionType session_type_from_string(const char *s);
const char* session_class_to_string(SessionClass t);
SessionClass session_class_from_string(const char *s);
const char *kill_who_to_string(KillWho k);
KillWho kill_who_from_string(const char *s);