]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/logind-user.h
loginctl: implement missing kill verb
[thirdparty/systemd.git] / src / logind-user.h
CommitLineData
90821c93
LP
1/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
2
3#ifndef foologinduserhfoo
4#define foologinduserhfoo
5
6/***
7 This file is part of systemd.
8
9 Copyright 2011 Lennart Poettering
10
11 systemd is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2 of the License, or
14 (at your option) any later version.
15
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 General Public License for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with systemd; If not, see <http://www.gnu.org/licenses/>.
23***/
24
25typedef struct User User;
26
27#include "list.h"
28#include "util.h"
29#include "logind.h"
30#include "logind-session.h"
31
32typedef enum UserState {
33 USER_OFFLINE,
34 USER_LINGERING,
35 USER_ONLINE,
36 USER_ACTIVE,
37 _USER_STATE_MAX,
38 _USER_STATE_INVALID = -1
39} UserState;
40
41struct User {
42 Manager *manager;
43
44 uid_t uid;
45 gid_t gid;
46 char *name;
47
48 char *state_file;
49 char *runtime_path;
50 char *service;
51 char *cgroup_path;
52
53 Session *display;
54
55 dual_timestamp timestamp;
56
14c3baca 57 bool in_gc_queue:1;
9418f147 58 bool started:1;
14c3baca 59
90821c93 60 LIST_HEAD(Session, sessions);
14c3baca 61 LIST_FIELDS(User, gc_queue);
90821c93
LP
62};
63
64User* user_new(Manager *m, uid_t uid, gid_t gid, const char *name);
65void user_free(User *u);
4a4b033f 66int user_check_gc(User *u, bool drop_not_started);
14c3baca 67void user_add_to_gc_queue(User *u);
90821c93
LP
68int user_start(User *u);
69int user_stop(User *u);
90821c93 70UserState user_get_state(User *u);
a185c5aa 71int user_get_idle_hint(User *u, dual_timestamp *t);
90821c93
LP
72int user_save(User *u);
73int user_load(User *u);
de07ab16 74int user_kill(User *u, int signo);
90821c93 75
3f49d45a
LP
76char *user_bus_path(User *s);
77
78extern const DBusObjectPathVTable bus_user_vtable;
79
da119395 80int user_send_signal(User *u, bool new_user);
9418f147 81int user_send_changed(User *u, const char *properties);
da119395 82
90821c93
LP
83const char* user_state_to_string(UserState s);
84UserState user_state_from_string(const char *s);
85
86#endif