logind-user.h revision 0604381b9dbef4cc498b5a77311e1da99c1430b8
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#ifndef foologinduserhfoo
#define foologinduserhfoo
/***
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-session.h"
typedef enum UserState {
USER_OFFLINE, /* Not logged in at all */
USER_LINGERING, /* Lingering has been enabled by the admin for this user */
USER_ONLINE, /* User logged in */
USER_ACTIVE, /* User logged in and has a session in the fg */
USER_CLOSING, /* User logged out, but processes still remain and lingering is not enabled */
_USER_STATE_INVALID = -1
} UserState;
struct User {
char *name;
char *state_file;
char *runtime_path;
char *service;
char *cgroup_path;
bool in_gc_queue:1;
bool started:1;
};
void user_add_to_gc_queue(User *u);
int user_start(User *u);
char *user_bus_path(User *s);
extern const DBusObjectPathVTable bus_user_vtable;
const char* user_state_to_string(UserState s);
UserState user_state_from_string(const char *s);
#endif