home: Remove circular header dependencies

This commit is contained in:
Daan De Meyer
2025-04-23 10:33:37 +02:00
parent 4ea4abb651
commit 52ee9ba13d
4 changed files with 8 additions and 9 deletions
+1
View 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"
+1
View 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"
+4 -5
View 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);
+2 -4
View 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);