]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
home: Remove circular header dependencies
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 18 Apr 2025 19:37:13 +0000 (21:37 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 23 Apr 2025 08:33:37 +0000 (10:33 +0200)
src/home/homed-home-bus.c
src/home/homed-home.c
src/home/homed-home.h
src/home/homed-manager.h

index 2214496dc09b071fde2eb7d25681fc15f44c144a..903644ffd2612c859452d1497fb7d686d734ee8f 100644 (file)
@@ -10,6 +10,7 @@
 #include "homed-bus.h"
 #include "homed-home-bus.h"
 #include "homed-home.h"
+#include "homed-manager.h"
 #include "log.h"
 #include "strv.h"
 #include "user-record-util.h"
index 0b61b08abf8161f5e016300959db0c5756e6aaa1..6f0bcc65c392d9f50fa5b925ef3f5342e88524e2 100644 (file)
@@ -21,6 +21,7 @@
 #include "home-util.h"
 #include "homed-home.h"
 #include "homed-home-bus.h"
+#include "homed-manager.h"
 #include "json-util.h"
 #include "log.h"
 #include "memfd-util.h"
index dfd64461fc8f9cfd8ff4a7f35f6a705f51300d1e..7d29e554a333b6bcd14066bb576c509f1feea861 100644 (file)
@@ -1,10 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-typedef struct Home Home;
-
 #include "hashmap.h"
-#include "homed-manager.h"
 #include "homed-operation.h"
 #include "list.h"
 #include "ordered-set.h"
@@ -12,6 +9,8 @@ typedef struct Home Home;
 #include "stat-util.h"
 #include "user-record.h"
 
+typedef struct Manager Manager;
+
 typedef enum HomeState {
         HOME_UNFIXATED,               /* home exists, but local record does not */
         HOME_ABSENT,                  /* local record exists, but home does not */
@@ -108,7 +107,7 @@ static inline bool HOME_STATE_MAY_RETRY_DEACTIVATE(HomeState state) {
                       HOME_AUTHENTICATING_FOR_ACQUIRE);
 }
 
-struct Home {
+typedef struct Home {
         Manager *manager;
 
         /* The fields this record can be looked up by. This is kinda redundant, as the same information is
@@ -180,7 +179,7 @@ struct Home {
 
         /* Whether a rebalance operation is pending */
         bool rebalance_pending;
-};
+} Home;
 
 int home_new(Manager *m, UserRecord *hr, const char *sysfs, Home **ret);
 Home *home_free(Home *h);
index 2b4bd38adb38c98b85b64befdebc4367fc0b22b5..f8490a563999c98ca7bac9a6b9b8082d82951c9f 100644 (file)
@@ -8,8 +8,6 @@
 #include "sd-event.h"
 #include "sd-varlink.h"
 
-typedef struct Manager Manager;
-
 #include "hashmap.h"
 #include "homed-home.h"
 
@@ -25,7 +23,7 @@ typedef enum RebalanceState {
         _REBALANCE_STATE_INVALID = -1,
 } RebalanceState;
 
-struct Manager {
+typedef struct Manager {
         sd_event *event;
         sd_bus *bus;
 
@@ -68,7 +66,7 @@ struct Manager {
          * running a rebalancing operation for. 'rebalance_queued_method_calls' are the method calls that
          * have been queued since then and that we'll operate on once we complete the current run. */
         Set *rebalance_pending_method_calls, *rebalance_queued_method_calls;
-};
+} Manager;
 
 int manager_new(Manager **ret);
 Manager* manager_free(Manager *m);