chiark / gitweb /
tree-wide: drop 'This file is part of systemd' blurb
[elogind.git] / src / login / logind-user.h
index 4e0568fea92b7e98ee99868c2870a968afbbc3fe..659420583038f960b1068f051d4f0cf47657280e 100644 (file)
@@ -1,32 +1,15 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
+/* SPDX-License-Identifier: LGPL-2.1+ */
 #pragma once
 
 /***
-  This file is part of systemd.
-
   Copyright 2011 Lennart Poettering
-
-  systemd is free software; you can redistribute it and/or modify it
-  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/>.
 ***/
 
 typedef struct User User;
 
+//#include "conf-parser.h"
 #include "list.h"
-#include "util.h"
 #include "logind.h"
-#include "logind-session.h"
 
 typedef enum UserState {
         USER_OFFLINE,    /* Not logged in at all */
@@ -41,19 +24,18 @@ typedef enum UserState {
 
 struct User {
         Manager *manager;
-
         uid_t uid;
         gid_t gid;
         char *name;
-
         char *state_file;
         char *runtime_path;
-
-        char *service;
         char *slice;
+        char *service;
 
+#if 0 /// UNNEEDED by elogind
         char *service_job;
         char *slice_job;
+#endif // 0
 
         Session *display;
 
@@ -67,9 +49,12 @@ struct User {
         LIST_FIELDS(User, gc_queue);
 };
 
-User* user_new(Manager *m, uid_t uid, gid_t gid, const char *name);
-void user_free(User *u);
-bool user_check_gc(User *u, bool drop_not_started);
+int user_new(User **out, Manager *m, uid_t uid, gid_t gid, const char *name);
+User *user_free(User *u);
+
+DEFINE_TRIVIAL_CLEANUP_FUNC(User *, user_free);
+
+bool user_may_gc(User *u, bool drop_not_started);
 void user_add_to_gc_queue(User *u);
 int user_start(User *u);
 int user_stop(User *u, bool force);
@@ -92,3 +77,8 @@ int user_send_changed(User *u, const char *properties, ...) _sentinel_;
 
 const char* user_state_to_string(UserState s) _const_;
 UserState user_state_from_string(const char *s) _pure_;
+
+int bus_user_method_terminate(sd_bus_message *message, void *userdata, sd_bus_error *error);
+int bus_user_method_kill(sd_bus_message *message, void *userdata, sd_bus_error *error);
+
+CONFIG_PARSER_PROTOTYPE(config_parse_compat_user_tasks_max);