Split out of #37344.
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "alloc-util.h"
+#include "hashmap.h"
#include "memory-util.h"
#include "sysupdate-cache.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "hashmap.h"
+#include "sysupdate-forward.h"
typedef struct WebCacheItem {
char *url;
#include "conf-parser.h"
#include "hash-funcs.h"
#include "path-util.h"
+#include "string-util.h"
#include "sysupdate.h"
#include "sysupdate-feature.h"
#include "web-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include "hash-funcs.h"
-#include "memory-util.h"
+#include "sysupdate-forward.h"
typedef struct Feature {
unsigned n_ref;
--- /dev/null
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#pragma once
+
+#include "forward.h" /* IWYU pragma: export */
+
+typedef struct Context Context;
+typedef struct PartitionInfo PartitionInfo;
+typedef struct Resource Resource;
+typedef struct Instance Instance;
+typedef struct InstanceMetadata InstanceMetadata;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <fcntl.h>
-#include <sys/stat.h>
-
#include "alloc-util.h"
#include "log.h"
#include "sysupdate-instance.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <inttypes.h>
-#include <stdbool.h>
-#include <sys/types.h>
-
#include "sd-id128.h"
-#include "fs-util.h"
+#include "sysupdate-forward.h"
#include "sysupdate-partition.h"
-#include "time-util.h"
-
-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
#include <sys/file.h>
#include "alloc-util.h"
-#include "extract-word.h"
+#include "fdisk-util.h"
#include "gpt.h"
-#include "id128-util.h"
#include "log.h"
-#include "parse-util.h"
-#include "stdio-util.h"
#include "string-util.h"
#include "sysupdate-partition.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <errno.h>
-#include <inttypes.h>
-#include <sys/types.h>
-
#include "sd-id128.h"
-#include "fdisk-util.h"
-#include "macro.h"
-
-typedef struct PartitionInfo PartitionInfo;
+#include "sysupdate-forward.h"
typedef enum PartitionChange {
PARTITION_FLAGS = 1 << 0,
_PARTITION_CHANGE_INVALID = -EINVAL,
} PartitionChange;
-struct PartitionInfo {
+typedef struct PartitionInfo {
size_t partno;
uint64_t start, size;
uint64_t flags;
bool no_auto;
bool read_only;
bool growfs;
-};
+} PartitionInfo;
#define PARTITION_INFO_NULL \
{ \
#include "list.h"
#include "log.h"
#include "parse-util.h"
-#include "path-util.h"
-#include "stdio-util.h"
#include "string-util.h"
#include "strv.h"
#include "sysupdate-instance.h"
#include "sysupdate-pattern.h"
+#include "time-util.h"
typedef enum PatternElementType {
PATTERN_LITERAL,
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <stdbool.h>
-
-#include "time-util.h"
-
-typedef struct InstanceMetadata InstanceMetadata;
+#include "sysupdate-forward.h"
enum {
PATTERN_MATCH_NO,
#include "device-util.h"
#include "devnum-util.h"
#include "dirent-util.h"
-#include "env-util.h"
+#include "errno-util.h"
#include "fd-util.h"
+#include "fdisk-util.h"
#include "fileio.h"
#include "find-esp.h"
#include "glyph-util.h"
#include "gpt.h"
#include "hexdecoct.h"
#include "import-util.h"
-#include "macro.h"
#include "missing_magic.h"
#include "process-util.h"
#include "sort-util.h"
+#include "stat-util.h"
#include "string-table.h"
#include "strv.h"
-#include "sysupdate.h"
#include "sysupdate-cache.h"
#include "sysupdate-instance.h"
#include "sysupdate-pattern.h"
#include "sysupdate-resource.h"
+#include "time-util.h"
#include "utf8.h"
void resource_destroy(Resource *rr) {
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <inttypes.h>
-#include <stdbool.h>
-#include <sys/types.h>
-
#include "gpt.h"
-#include "hashmap.h"
-#include "macro.h"
-
-typedef struct Resource Resource;
-typedef struct Instance Instance;
+#include "sysupdate-forward.h"
typedef enum ResourceType {
RESOURCE_URL_FILE,
_PATH_RELATIVE_TO_INVALID = -EINVAL,
} PathRelativeTo;
-struct Resource {
+typedef struct Resource {
ResourceType type;
/* Where to look for instances, and what to match precisely */
/* If this is a partition resource (RESOURCE_PARTITION), then how many partition slots are currently unassigned, that we can use */
size_t n_empty;
-};
+} Resource;
void resource_destroy(Resource *rr);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include <stdlib.h>
+#include <sys/stat.h>
+
#include "sd-id128.h"
#include "alloc-util.h"
-#include "blockdev-util.h"
#include "build-path.h"
#include "chase.h"
#include "conf-parser.h"
#include "dirent-util.h"
+#include "errno-util.h"
#include "event-util.h"
#include "extract-word.h"
#include "fd-util.h"
+#include "fs-util.h"
#include "glyph-util.h"
#include "gpt.h"
+#include "hashmap.h"
#include "hexdecoct.h"
#include "install-file.h"
#include "mkdir.h"
#include "parse-helpers.h"
#include "parse-util.h"
#include "percent-util.h"
+#include "pidref.h"
#include "process-util.h"
-#include "random-util.h"
#include "rm-rf.h"
#include "signal-util.h"
-#include "socket-util.h"
#include "specifier.h"
-#include "stat-util.h"
#include "stdio-util.h"
#include "strv.h"
#include "sync-util.h"
#include "sysupdate-pattern.h"
#include "sysupdate-resource.h"
#include "sysupdate-transfer.h"
+#include "time-util.h"
#include "tmpfile-util.h"
#include "web-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <inttypes.h>
-#include <stdbool.h>
-#include <sys/types.h>
-
#include "sd-id128.h"
+#include "sysupdate-forward.h"
#include "sysupdate-partition.h"
#include "sysupdate-resource.h"
-typedef struct Context Context;
-
typedef struct Transfer {
char *id;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "ansi-color.h"
-#include "assert-util.h"
#include "glyph-util.h"
#include "sysupdate-update-set-flags.h"
-#include "terminal-util.h"
const char* update_set_flags_to_color(UpdateSetFlags flags) {
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
+#include "forward.h"
+
typedef enum UpdateSetFlags {
UPDATE_NEWEST = 1 << 0,
UPDATE_AVAILABLE = 1 << 1,
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include "alloc-util.h"
-#include "ansi-color.h"
+#include <stdlib.h>
+
#include "string-util.h"
#include "sysupdate-update-set.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <inttypes.h>
-#include <stdbool.h>
-#include <sys/types.h>
-
+#include "sysupdate-forward.h"
#include "sysupdate-update-set-flags.h"
-typedef struct Instance Instance;
-typedef struct UpdateSet UpdateSet;
-
-struct UpdateSet {
+typedef struct UpdateSet {
UpdateSetFlags flags;
char *version;
Instance **instances;
size_t n_instances;
-};
+} UpdateSet;
UpdateSet* update_set_free(UpdateSet *us);
int update_set_cmp(UpdateSet *const*a, UpdateSet *const*b);
#include "glyph-util.h"
#include "hexdecoct.h"
#include "image-policy.h"
-#include "json-util.h"
+#include "loop-util.h"
#include "main-func.h"
#include "mount-util.h"
#include "os-util.h"
#include "sysupdate-transfer.h"
#include "sysupdate-update-set.h"
#include "sysupdate-util.h"
-#include "terminal-util.h"
#include "utf8.h"
#include "verbs.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <inttypes.h>
-#include <stdbool.h>
-
#include "specifier.h"
-
-/* Forward declare this type so that Transfers can point at it */
-typedef struct Context Context;
+#include "sysupdate-forward.h"
extern bool arg_sync;
extern uint64_t arg_instances_max;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include <stdlib.h>
+#include <sys/stat.h>
+
#include "sd-bus.h"
#include "sd-json.h"
#include "bus-get-properties.h"
#include "bus-label.h"
#include "bus-log-control-api.h"
+#include "bus-object.h"
#include "bus-polkit.h"
#include "bus-util.h"
#include "common-signal.h"
+#include "constants.h"
#include "discover-image.h"
#include "dropin.h"
#include "env-util.h"
#include "event-util.h"
#include "fd-util.h"
#include "fileio.h"
+#include "format-util.h"
#include "hashmap.h"
#include "log.h"
#include "main-func.h"
#include "memfd-util.h"
-#include "mkdir-label.h"
#include "notify-recv.h"
#include "os-util.h"
#include "parse-util.h"
+#include "path-util.h"
+#include "pidref.h"
#include "process-util.h"
+#include "runtime-scope.h"
#include "service-util.h"
#include "signal-util.h"
-#include "socket-util.h"
#include "string-table.h"
+#include "strv.h"
#include "sysupdate-util.h"
#include "utf8.h"
#include <locale.h>
#include "sd-bus.h"
+#include "sd-event.h"
#include "sd-json.h"
#include "alloc-util.h"
#include "bus-locator.h"
#include "bus-map-properties.h"
#include "bus-util.h"
-#include "conf-files.h"
-#include "conf-parser.h"
-#include "errno-list.h"
-#include "fd-util.h"
-#include "fileio.h"
+#include "errno-util.h"
#include "format-table.h"
-#include "fs-util.h"
+#include "hashmap.h"
#include "json-util.h"
#include "main-func.h"
-#include "os-util.h"
#include "pager.h"
-#include "path-util.h"
#include "polkit-agent.h"
#include "pretty-print.h"
+#include "runtime-scope.h"
+#include "string-util.h"
#include "strv.h"
#include "sysupdate-update-set-flags.h"
#include "sysupdate-util.h"