logind-session.h revision ae5e06bda24ebbb2ac00741738ad3a872fc577a5
/*-*- 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"
#include "login-shared.h"
typedef enum SessionState {
SESSION_OPENING, /* Session scope is being created */
SESSION_ONLINE, /* Logged in */
SESSION_ACTIVE, /* Logged in and in the fg */
SESSION_CLOSING, /* Logged out, but scope is still there */
} SessionState;
typedef enum SessionClass {
} SessionClass;
typedef enum SessionType {
} SessionType;
enum KillWho {
_KILL_WHO_INVALID = -1
};
struct Session {
char *id;
char *state_file;
char *tty;
char *display;
bool remote;
char *remote_user;
char *remote_host;
char *service;
char *scope;
char *scope_job;
int vtnr;
int fifo_fd;
char *fifo_path;
bool idle_hint;
bool in_gc_queue:1;
bool started:1;
bool closing:1;
char *controller;
};
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_finalize(Session *s);
int session_save(Session *s);
int session_load(Session *s);
char *session_bus_path(Session *s);
extern const DBusObjectPathVTable bus_session_vtable;
void session_drop_controller(Session *s);