chiark / gitweb /
add more special units
[elogind.git] / manager.h
index a17a6c2f6d8f645abae07e805d8675020072af86..a00a9b9cc28730c6535aed1ac8921b05f03febce 100644 (file)
--- a/manager.h
+++ b/manager.h
@@ -8,7 +8,21 @@
 #include <stdio.h>
 
 typedef struct Manager Manager;
-typedef enum ManagerEventType ManagerEventType;
+typedef enum WatchType WatchType;
+typedef struct Watch Watch;
+
+enum WatchType {
+        WATCH_INVALID,
+        WATCH_SIGNAL_FD,
+        WATCH_FD,
+        WATCH_TIMER
+};
+
+struct Watch {
+        int fd;
+        WatchType type;
+        union Unit *unit;
+};
 
 #include "unit.h"
 #include "job.h"
@@ -16,11 +30,14 @@ typedef enum ManagerEventType ManagerEventType;
 #include "list.h"
 #include "set.h"
 
-enum ManagerEventType {
-        MANAGER_SIGNAL,
-        MANAGER_FD,
-        MANAGER_TIMER
-};
+typedef enum SpecialUnit {
+        SPECIAL_SYSLOG_SERVICE,
+        SPECIAL_DBUS_SERVICE,
+        SPECIAL_LOGGER_SOCKET,
+        SPECIAL_CTRL_ALT_DEL_TARGET,
+        SPECIAL_KBREQUEST_TARGET,
+        _SPECIAL_UNIT_MAX
+} SpecialUnit;
 
 struct Manager {
         uint32_t current_job_id;
@@ -49,7 +66,10 @@ struct Manager {
         Hashmap *watch_pids;  /* pid => Unit object n:1 */
 
         int epoll_fd;
-        int signal_fd;
+
+        Watch signal_watch;
+
+        Unit *special_units[_SPECIAL_UNIT_MAX]; /* some special units */
 };
 
 Manager* manager_new(void);