sysupdate: Remove circular header includes

This commit is contained in:
Daan De Meyer
2025-04-23 10:33:37 +02:00
parent 68527d3051
commit cf108818b3
9 changed files with 19 additions and 21 deletions
+1 -2
View File
@@ -1,8 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "hash-funcs.h"
#include "macro.h"
#include "sysupdate-transfer.h"
#include "memory-util.h"
typedef struct Feature {
unsigned n_ref;
+5 -6
View File
@@ -10,13 +10,12 @@
#include "fs-util.h"
#include "time-util.h"
typedef struct InstanceMetadata InstanceMetadata;
typedef struct Instance Instance;
#include "sysupdate-resource.h"
#include "sysupdate-partition.h"
struct InstanceMetadata {
typedef struct Resource Resource;
typedef struct Instance Instance;
typedef struct InstanceMetadata {
/* Various bits of metadata for each instance, that is either derived from the filename/GPT label or
* from metadata of the file/partition itself */
char *version;
@@ -33,7 +32,7 @@ struct InstanceMetadata {
int growfs;
uint8_t sha256sum[32]; /* SHA256 sum of the download (i.e. compressed) file */
bool sha256sum_set;
};
} InstanceMetadata;
#define INSTANCE_METADATA_NULL \
{ \
+1
View File
@@ -8,6 +8,7 @@
#include "path-util.h"
#include "stdio-util.h"
#include "string-util.h"
#include "sysupdate-instance.h"
#include "sysupdate-pattern.h"
typedef enum PatternElementType {
+2 -1
View File
@@ -3,9 +3,10 @@
#include <stdbool.h>
#include "sysupdate-instance.h"
#include "time-util.h"
typedef struct InstanceMetadata InstanceMetadata;
enum {
PATTERN_MATCH_NO,
PATTERN_MATCH_YES,
+1 -3
View File
@@ -9,10 +9,8 @@
#include "hashmap.h"
#include "macro.h"
/* Forward declare this type so that the headers below can use it */
typedef struct Resource Resource;
#include "sysupdate-instance.h"
typedef struct Instance Instance;
typedef enum ResourceType {
RESOURCE_URL_FILE,
+1
View File
@@ -31,6 +31,7 @@
#include "sync-util.h"
#include "sysupdate.h"
#include "sysupdate-feature.h"
#include "sysupdate-instance.h"
#include "sysupdate-pattern.h"
#include "sysupdate-resource.h"
#include "sysupdate-transfer.h"
+4 -6
View File
@@ -7,14 +7,12 @@
#include "sd-id128.h"
/* Forward declare this type so that the headers below can use it */
typedef struct Transfer Transfer;
#include "sysupdate-partition.h"
#include "sysupdate-resource.h"
#include "sysupdate.h"
struct Transfer {
typedef struct Context Context;
typedef struct Transfer {
char *id;
char *min_version;
@@ -55,7 +53,7 @@ struct Transfer {
PartitionChange partition_change;
Context *context;
};
} Transfer;
typedef int (*TransferProgress)(const Transfer *t, const Instance *inst, unsigned percentage);
+3 -3
View File
@@ -5,11 +5,11 @@
#include <stdbool.h>
#include <sys/types.h>
typedef struct UpdateSet UpdateSet;
#include "sysupdate-instance.h"
#include "sysupdate-update-set-flags.h"
typedef struct Instance Instance;
typedef struct UpdateSet UpdateSet;
struct UpdateSet {
UpdateSetFlags flags;
char *version;
+1
View File
@@ -31,6 +31,7 @@
#include "strv.h"
#include "sysupdate.h"
#include "sysupdate-feature.h"
#include "sysupdate-instance.h"
#include "sysupdate-transfer.h"
#include "sysupdate-update-set.h"
#include "sysupdate-util.h"