chiark / gitweb /
sd-bus: it's not a user error to query the error contained in a bus message
[elogind.git] / src / login / logind-button.h
index 83bf1fc70cb3503b18ab55ed5bb599b6c289c94b..95bb6a52402f166d05c5f46d51eccad57b35d1c1 100644 (file)
@@ -1,12 +1,11 @@
 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
 
-#ifndef foologindbuttonhfoo
-#define foologindbuttonhfoo
+#pragma once
 
 /***
   This file is part of systemd.
 
-  Copyright 2012 Lennart Poettering
+  Copyright 2014 Daniel Mack
 
   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
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-typedef struct Button Button;
+typedef struct BusEndpoint BusEndpoint;
+typedef struct BusEndpointPolicy BusEndpointPolicy;
 
-#include "list.h"
-#include "util.h"
-#include "logind.h"
-
-struct Button {
-        Manager *manager;
-
-        sd_event_source *event_source;
+#include "hashmap.h"
+#include "bus-policy.h"
 
+struct BusEndpointPolicy {
         char *name;
-        char *seat;
-        int fd;
+        BusPolicyAccess access;
+};
 
-        bool lid_close_queued;
+struct BusEndpoint {
+        Hashmap *policy_hash;
 };
 
-Button* button_new(Manager *m, const char *name);
-void button_free(Button*b);
-int button_open(Button *b);
-int button_recheck(Button *b);
-int button_set_seat(Button *b, const char *sn);
+// UNNEEDED int bus_endpoint_new(BusEndpoint **ep);
+void bus_endpoint_free(BusEndpoint *endpoint);
+
+// UNNEEDED int bus_endpoint_add_policy(BusEndpoint *ep, const char *name, BusPolicyAccess access);
 
-#endif
+int bus_kernel_set_endpoint_policy(int fd, uid_t uid, BusEndpoint *ep);