]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
import: Clean up headers
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 21 May 2025 14:32:52 +0000 (16:32 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 21 May 2025 16:09:52 +0000 (18:09 +0200)
Split out of #37344.

31 files changed:
src/import/curl-util.c
src/import/curl-util.h
src/import/export-raw.c
src/import/export-raw.h
src/import/export-tar.c
src/import/export-tar.h
src/import/export.c
src/import/import-common.c
src/import/import-common.h
src/import/import-compress.c
src/import/import-compress.h
src/import/import-fs.c
src/import/import-generator.c
src/import/import-raw.c
src/import/import-raw.h
src/import/import-tar.c
src/import/import-tar.h
src/import/import.c
src/import/importctl.c
src/import/importd.c
src/import/pull-common.c
src/import/pull-common.h
src/import/pull-job.c
src/import/pull-job.h
src/import/pull-raw.c
src/import/pull-raw.h
src/import/pull-tar.c
src/import/pull-tar.h
src/import/pull.c
src/import/qcow2-util.c
src/import/test-qcow2.c

index c8217bd4d251fcbb5e3aef4b5978c65860e9a035..82a1fc132ac303d9ba524fbacb1889d8497172f2 100644 (file)
@@ -1,14 +1,14 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
-#include <fcntl.h>
+#include "sd-event.h"
 
 #include "alloc-util.h"
 #include "curl-util.h"
 #include "fd-util.h"
-#include "locale-util.h"
+#include "hashmap.h"
 #include "log.h"
 #include "string-util.h"
+#include "time-util.h"
 #include "version.h"
 
 static void curl_glue_check_finished(CurlGlue *g) {
index cef0b26986dcc18c5f9b39529968fe67b98b9c91..abba49044b371f074112079a3791f2dc30ed5538 100644 (file)
@@ -2,16 +2,12 @@
 #pragma once
 
 #include <curl/curl.h>
-#include <sys/types.h>
 
-#include "sd-event.h"
-
-#include "hashmap.h"
-#include "time-util.h"
+#include "forward.h"
 
 typedef struct CurlGlue CurlGlue;
 
-struct CurlGlue {
+typedef struct CurlGlue {
         sd_event *event;
         CURLM *curl;
         sd_event_source *timer;
@@ -20,7 +16,7 @@ struct CurlGlue {
 
         void (*on_finished)(CurlGlue *g, CURL *curl, CURLcode code);
         void *userdata;
-};
+} CurlGlue;
 
 int curl_glue_new(CurlGlue **glue, sd_event *event);
 CurlGlue* curl_glue_unref(CurlGlue *glue);
index cdc7cf1782dfd9defb3c64cfc0cb78223cafa709..787d230d2ff95a7452fc08652efcc0def94e4fa4 100644 (file)
@@ -3,26 +3,26 @@
 #include <sys/sendfile.h>
 
 #include "sd-daemon.h"
+#include "sd-event.h"
 
 #include "alloc-util.h"
-#include "btrfs-util.h"
 #include "copy.h"
 #include "export-raw.h"
 #include "fd-util.h"
 #include "format-util.h"
 #include "fs-util.h"
-#include "import-common.h"
 #include "log.h"
-#include "missing_fcntl.h"
 #include "pretty-print.h"
 #include "ratelimit.h"
 #include "stat-util.h"
 #include "string-util.h"
+#include "terminal-util.h"
+#include "time-util.h"
 #include "tmpfile-util.h"
 
 #define COPY_BUFFER_SIZE (16*1024)
 
-struct RawExport {
+typedef struct RawExport {
         sd_event *event;
 
         RawExportFinished on_finished;
@@ -52,7 +52,7 @@ struct RawExport {
         bool eof;
         bool tried_reflink;
         bool tried_sendfile;
-};
+} RawExport;
 
 RawExport *raw_export_unref(RawExport *e) {
         if (!e)
index 7c952626476a0a67d5ec59e7ab1c90c5492c2811..9bac076b35bf38468523cb953c2acaaf881c72cf 100644 (file)
@@ -1,10 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-event.h"
-
+#include "forward.h"
 #include "import-compress.h"
-#include "memory-util.h"
 
 typedef struct RawExport RawExport;
 
index a2af379bf8ad5b35988f7f23514411a656c5c5a5..5b907769a070ce97c9adbb4ffbb7f1887ed2c39b 100644 (file)
@@ -1,22 +1,28 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <sys/stat.h>
+
 #include "sd-daemon.h"
+#include "sd-event.h"
 
 #include "alloc-util.h"
 #include "btrfs-util.h"
 #include "export-tar.h"
 #include "fd-util.h"
+#include "format-util.h"
 #include "import-common.h"
 #include "log.h"
 #include "pretty-print.h"
 #include "process-util.h"
 #include "ratelimit.h"
 #include "string-util.h"
+#include "terminal-util.h"
+#include "time-util.h"
 #include "tmpfile-util.h"
 
 #define COPY_BUFFER_SIZE (16*1024)
 
-struct TarExport {
+typedef struct TarExport {
         sd_event *event;
 
         TarExportFinished on_finished;
@@ -49,7 +55,7 @@ struct TarExport {
 
         bool eof;
         bool tried_splice;
-};
+} TarExport;
 
 TarExport *tar_export_unref(TarExport *e) {
         if (!e)
index 729b9ef73645a6f53f2a62b2abd56e8505cdef00..f261c0c8d24842e6f5916072c922e12b21452220 100644 (file)
@@ -1,10 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-event.h"
-
+#include "forward.h"
 #include "import-compress.h"
-#include "memory-util.h"
 
 typedef struct TarExport TarExport;
 
index 0ee2a1db71dde9ae1a4229b812c2ed1e60cfa202..6f035bf96ed91078ba5512f8e9febe74faf00569 100644 (file)
@@ -4,7 +4,6 @@
 #include <locale.h>
 
 #include "sd-event.h"
-#include "sd-id128.h"
 
 #include "alloc-util.h"
 #include "ansi-color.h"
 #include "export-raw.h"
 #include "export-tar.h"
 #include "fd-util.h"
-#include "fs-util.h"
-#include "hostname-util.h"
 #include "import-common.h"
-#include "import-util.h"
+#include "log.h"
 #include "main-func.h"
+#include "runtime-scope.h"
 #include "signal-util.h"
 #include "string-util.h"
-#include "terminal-util.h"
 #include "verbs.h"
 
 static ImportCompressType arg_compress = IMPORT_COMPRESS_UNKNOWN;
@@ -56,7 +53,7 @@ static void on_tar_finished(TarExport *export, int error, void *userdata) {
         if (error == 0)
                 log_info("Operation completed successfully.");
 
-        sd_event_exit(event, abs(error));
+        sd_event_exit(event, ABS(error));
 }
 
 static int export_tar(int argc, char *argv[], void *userdata) {
@@ -129,7 +126,7 @@ static void on_raw_finished(RawExport *export, int error, void *userdata) {
         if (error == 0)
                 log_info("Operation completed successfully.");
 
-        sd_event_exit(event, abs(error));
+        sd_event_exit(event, ABS(error));
 }
 
 static int export_raw(int argc, char *argv[], void *userdata) {
index be09c766cb4a86a355bbe7cf4605b77bf81d912c..bab81d596f923158967092a37902c52d6c6da61c 100644 (file)
@@ -1,25 +1,22 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <sched.h>
-#include <sys/prctl.h>
 #include <sys/stat.h>
 #include <unistd.h>
 
+#include "sd-event.h"
+
 #include "alloc-util.h"
-#include "btrfs-util.h"
 #include "capability-util.h"
-#include "chattr-util.h"
 #include "dirent-util.h"
 #include "fd-util.h"
 #include "fileio.h"
 #include "fs-util.h"
-#include "hostname-util.h"
 #include "import-common.h"
 #include "log.h"
 #include "os-util.h"
 #include "process-util.h"
 #include "selinux-util.h"
-#include "signal-util.h"
 #include "stat-util.h"
 #include "tmpfile-util.h"
 
index d7fb77a0700ce1b2958a98f2a50f344f9fdb67cf..bb7d5614f01c49532a9b23044722c911cd568eb7 100644 (file)
@@ -1,11 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <errno.h>
-#include <stdbool.h>
-#include <sys/types.h>
-
-#include "sd-event.h"
+#include "forward.h"
 
 typedef enum ImportFlags {
         /* Public Flags (i.e. accessible via D-Bus, must stay stable! */
index f6385c6b0368641e71605257be89bbb1db01e43c..012fd2c3eddec83e3bd441941fb43e35603823b8 100644 (file)
@@ -1,8 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include "assert-util.h"
+#include <stdlib.h>
+#include <string.h>
+
 #include "import-compress.h"
-#include "log.h"
 #include "string-table.h"
 
 void import_compress_free(ImportCompress *c) {
index 160d9e62a6eb6a93fb853554f2e40d001e254b56..ea14038a4ff2b17b1c11928e18cf76febac48a65 100644 (file)
@@ -1,20 +1,16 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <errno.h>
-
 #if HAVE_BZIP2
 #include <bzlib.h>
 #endif
 #include <lzma.h>
-#include <sys/types.h>
 #include <zlib.h>
 #if HAVE_ZSTD
 #include <zstd.h>
-#include <zstd_errors.h>
 #endif
 
-#include "macro.h"
+#include "forward.h"
 
 typedef enum ImportCompressType {
         IMPORT_COMPRESS_UNKNOWN,
index 2c9f5ba146ae8e391a92581a8a503a8eef0d59f8..6a364dc02f866b0d299fee02a681fc8004dd759a 100644 (file)
 #include "discover-image.h"
 #include "fd-util.h"
 #include "format-util.h"
-#include "fs-util.h"
-#include "hostname-util.h"
 #include "import-common.h"
 #include "import-util.h"
 #include "install-file.h"
+#include "log.h"
 #include "main-func.h"
 #include "mkdir-label.h"
 #include "parse-argument.h"
+#include "path-util.h"
 #include "ratelimit.h"
 #include "rm-rf.h"
+#include "runtime-scope.h"
 #include "signal-util.h"
 #include "string-util.h"
-#include "terminal-util.h"
+#include "time-util.h"
 #include "tmpfile-util.h"
 #include "verbs.h"
 
index a442a2025fbfb50c7c14d2ea0bfe1ed148ef6bb4..176ee7cb8a22cd7dabcd796271fae6e049e7719c 100644 (file)
@@ -6,6 +6,7 @@
 #include "creds-util.h"
 #include "discover-image.h"
 #include "efivars.h"
+#include "errno-util.h"
 #include "extract-word.h"
 #include "fd-util.h"
 #include "fileio.h"
 #include "initrd-util.h"
 #include "json-util.h"
 #include "parse-util.h"
+#include "path-util.h"
 #include "proc-cmdline.h"
-#include "special.h"
 #include "specifier.h"
+#include "string-util.h"
 #include "unit-name.h"
 #include "web-util.h"
 
index 3685904e03d71322fdb27c69d369700be4018a25..dc1a4b1c62372e71dab5e8169dbf8fb76c982d12 100644 (file)
@@ -1,15 +1,15 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <sys/stat.h>
+
 #include "sd-daemon.h"
 #include "sd-event.h"
 
 #include "alloc-util.h"
-#include "btrfs-util.h"
 #include "copy.h"
 #include "fd-util.h"
 #include "format-util.h"
 #include "fs-util.h"
-#include "hostname-util.h"
 #include "import-common.h"
 #include "import-compress.h"
 #include "import-raw.h"
 #include "install-file.h"
 #include "io-util.h"
 #include "log.h"
-#include "machine-pool.h"
-#include "missing_fs.h"
 #include "mkdir-label.h"
-#include "path-util.h"
 #include "pretty-print.h"
 #include "qcow2-util.h"
 #include "ratelimit.h"
-#include "rm-rf.h"
 #include "string-util.h"
+#include "terminal-util.h"
+#include "time-util.h"
 #include "tmpfile-util.h"
 
-struct RawImport {
+typedef struct RawImport {
         sd_event *event;
 
         char *image_root;
@@ -63,7 +61,7 @@ struct RawImport {
 
         uint64_t offset;
         uint64_t size_max;
-};
+} RawImport;
 
 RawImport* raw_import_unref(RawImport *i) {
         if (!i)
index 1feed79a5346509ee4466a1fa7313d27fb3456e7..9b711624090cec07b9d83a9f08439cbc781fa0a9 100644 (file)
@@ -1,10 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-event.h"
-
+#include "forward.h"
 #include "import-common.h"
-#include "memory-util.h"
 
 typedef struct RawImport RawImport;
 
index ac6925f30bddcb9e01015d730a0f40fe4d468894..b4b9b8dc99789f0e0c86a564e13568caecf1303b 100644 (file)
@@ -1,16 +1,15 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <sys/stat.h>
+
 #include "sd-daemon.h"
 #include "sd-event.h"
 
 #include "alloc-util.h"
 #include "btrfs-util.h"
-#include "copy.h"
 #include "errno-util.h"
 #include "fd-util.h"
-#include "fileio.h"
-#include "fs-util.h"
-#include "hostname-util.h"
+#include "format-util.h"
 #include "import-common.h"
 #include "import-compress.h"
 #include "import-tar.h"
 #include "install-file.h"
 #include "io-util.h"
 #include "log.h"
-#include "machine-pool.h"
-#include "missing_fs.h"
 #include "mkdir-label.h"
 #include "path-util.h"
 #include "pretty-print.h"
 #include "process-util.h"
-#include "qcow2-util.h"
 #include "ratelimit.h"
 #include "rm-rf.h"
 #include "string-util.h"
+#include "terminal-util.h"
+#include "time-util.h"
 #include "tmpfile-util.h"
 
-struct TarImport {
+typedef struct TarImport {
         sd_event *event;
 
         char *image_root;
@@ -63,7 +61,7 @@ struct TarImport {
 
         unsigned last_percent;
         RateLimit progress_ratelimit;
-};
+} TarImport;
 
 TarImport* tar_import_unref(TarImport *i) {
         if (!i)
index d90ba1199ad246c7b331fdde204653a93a6119e3..90d432b1e003ade29f633d456c7fb0f9ecda302e 100644 (file)
@@ -1,10 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-event.h"
-
+#include "forward.h"
 #include "import-common.h"
-#include "memory-util.h"
 
 typedef struct TarImport TarImport;
 
index 6568c5915605497ef5cef340cf807d8b1965c79c..72757d2ec705df565671233c6f6d6ed5f1178112 100644 (file)
@@ -4,7 +4,6 @@
 #include <locale.h>
 
 #include "sd-event.h"
-#include "sd-id128.h"
 
 #include "alloc-util.h"
 #include "ansi-color.h"
 #include "discover-image.h"
 #include "env-util.h"
 #include "fd-util.h"
-#include "fs-util.h"
-#include "hostname-util.h"
 #include "import-raw.h"
 #include "import-tar.h"
 #include "import-util.h"
 #include "io-util.h"
+#include "log.h"
 #include "main-func.h"
 #include "parse-argument.h"
 #include "parse-util.h"
+#include "path-util.h"
+#include "runtime-scope.h"
 #include "signal-util.h"
 #include "string-util.h"
-#include "terminal-util.h"
 #include "verbs.h"
 
 static const char *arg_image_root = NULL;
@@ -133,7 +132,7 @@ static void on_tar_finished(TarImport *import, int error, void *userdata) {
         if (error == 0)
                 log_info("Operation completed successfully.");
 
-        sd_event_exit(event, abs(error));
+        sd_event_exit(event, ABS(error));
 }
 
 static int import_tar(int argc, char *argv[], void *userdata) {
@@ -202,7 +201,7 @@ static void on_raw_finished(RawImport *import, int error, void *userdata) {
         if (error == 0)
                 log_info("Operation completed successfully.");
 
-        sd_event_exit(event, abs(error));
+        sd_event_exit(event, ABS(error));
 }
 
 static int import_raw(int argc, char *argv[], void *userdata) {
index 97a95d3612aec34f70b3e48bdba862971cd10957..9a8c6f08a1f8d58b0756bcd8423c0c4f143597c2 100644 (file)
@@ -1,8 +1,10 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <getopt.h>
+#include <locale.h>
 
 #include "sd-bus.h"
+#include "sd-event.h"
 
 #include "alloc-util.h"
 #include "build.h"
 #include "discover-image.h"
 #include "fd-util.h"
 #include "format-table.h"
-#include "hostname-util.h"
 #include "import-common.h"
 #include "import-util.h"
-#include "locale-util.h"
 #include "log.h"
-#include "macro.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 "signal-util.h"
-#include "sort-util.h"
+#include "runtime-scope.h"
 #include "string-table.h"
+#include "string-util.h"
+#include "strv.h"
 #include "verbs.h"
 #include "web-util.h"
 
index 45b5434ca0600f202dedc8585ecb0cf836d3a201..4936bd80312c961f6c741d2bfe91ed0f8ce29e41 100644 (file)
@@ -1,7 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <sys/prctl.h>
-#include <sys/wait.h>
+#include <stdlib.h>
 
 #include "sd-bus.h"
 #include "sd-varlink.h"
@@ -11,6 +10,7 @@
 #include "bus-common-errors.h"
 #include "bus-get-properties.h"
 #include "bus-log-control-api.h"
+#include "bus-object.h"
 #include "bus-polkit.h"
 #include "bus-util.h"
 #include "common-signal.h"
 #include "event-util.h"
 #include "fd-util.h"
 #include "float.h"
-#include "hostname-util.h"
+#include "hashmap.h"
 #include "import-common.h"
 #include "import-util.h"
 #include "json-util.h"
 #include "machine-pool.h"
 #include "main-func.h"
-#include "mkdir-label.h"
 #include "notify-recv.h"
 #include "os-util.h"
 #include "parse-util.h"
-#include "path-util.h"
 #include "percent-util.h"
+#include "pidref.h"
 #include "process-util.h"
+#include "runtime-scope.h"
 #include "service-util.h"
+#include "set.h"
 #include "signal-util.h"
-#include "socket-util.h"
 #include "stat-util.h"
 #include "string-table.h"
 #include "strv.h"
 #include "syslog-util.h"
-#include "user-util.h"
 #include "varlink-io.systemd.Import.h"
 #include "varlink-io.systemd.service.h"
 #include "varlink-util.h"
 #include "web-util.h"
 
-typedef struct Transfer Transfer;
 typedef struct Manager Manager;
 
 typedef enum TransferType {
@@ -62,7 +60,7 @@ typedef enum TransferType {
         _TRANSFER_TYPE_INVALID = -EINVAL,
 } TransferType;
 
-struct Transfer {
+typedef struct Transfer {
         Manager *manager;
 
         uint32_t id;
@@ -96,9 +94,9 @@ struct Transfer {
         int stdout_fd;
 
         Set *varlink_subscribed;
-};
+} Transfer;
 
-struct Manager {
+typedef struct Manager {
         sd_event *event;
         sd_bus *bus;
         sd_varlink_server *varlink_server;
@@ -114,7 +112,7 @@ struct Manager {
         bool use_btrfs_quota;
 
         RuntimeScope runtime_scope; /* for now: always RUNTIME_SCOPE_SYSTEM */
-};
+} Manager;
 
 #define TRANSFERS_MAX 64
 
index 76b3cf81ac08d25a2703976233397f82cbcc8b5d..67ed640a6f4aa4da58b3c8c59429b8b73f580546 100644 (file)
@@ -1,24 +1,20 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <sys/prctl.h>
+#include "sd-id128.h"
 
 #include "alloc-util.h"
-#include "btrfs-util.h"
-#include "capability-util.h"
-#include "copy.h"
 #include "dirent-util.h"
-#include "discover-image.h"
 #include "escape.h"
 #include "fd-util.h"
-#include "hostname-util.h"
 #include "io-util.h"
+#include "log.h"
 #include "memory-util.h"
+#include "os-util.h"
 #include "path-util.h"
 #include "process-util.h"
 #include "pull-common.h"
 #include "pull-job.h"
 #include "rm-rf.h"
-#include "signal-util.h"
 #include "siphash24.h"
 #include "string-util.h"
 #include "strv.h"
index 5a1bac19a1e180eeb7762f418d457b1d8fb6cff2..455b8395d2cd4b39b4acb395f74ec4bb36ffdc20 100644 (file)
@@ -1,12 +1,14 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <stdbool.h>
-
+#include "forward.h"
 #include "import-common.h"
 #include "import-util.h"
 #include "pull-job.h"
 
+typedef struct CurlGlue CurlGlue;
+typedef struct PullJob PullJob;
+
 int pull_find_old_etags(const char *url, const char *root, int dt, const char *prefix, const char *suffix, char ***etags);
 
 int pull_make_path(const char *url, const char *etag, const char *image_root, const char *prefix, const char *suffix, char **ret);
index d29fa4396652aaa8ed2c5683d97374e9f1972dba..36b4c9ee182a11c105c6f9b44d62cdc0f4a4663d 100644 (file)
@@ -8,16 +8,16 @@
 #include "fd-util.h"
 #include "format-util.h"
 #include "hexdecoct.h"
-#include "import-util.h"
 #include "io-util.h"
 #include "log.h"
-#include "machine-pool.h"
 #include "parse-util.h"
 #include "pull-common.h"
 #include "pull-job.h"
+#include "curl-util.h"
 #include "string-util.h"
 #include "strv.h"
 #include "sync-util.h"
+#include "time-util.h"
 #include "xattr-util.h"
 
 void pull_job_close_disk_fd(PullJob *j) {
index 6e471ffc1ff8eefd8fdf6ca84507ab551187b952..504185aaa9c55e5a55620dd108ae72a47e9d5e2a 100644 (file)
@@ -1,12 +1,14 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <curl/curl.h>
 #include <sys/stat.h>
 
-#include "curl-util.h"
+#include "forward.h"
 #include "import-compress.h"
 #include "openssl-util.h"
 
+typedef struct CurlGlue CurlGlue;
 typedef struct PullJob PullJob;
 
 typedef void (*PullJobFinished)(PullJob *job);
@@ -27,7 +29,7 @@ typedef enum PullJobState {
 
 #define PULL_JOB_IS_COMPLETE(j) (IN_SET((j)->state, PULL_JOB_DONE, PULL_JOB_FAILED))
 
-struct PullJob {
+typedef struct PullJob {
         PullJobState state;
         int error;
 
@@ -77,7 +79,7 @@ struct PullJob {
         char *checksum;
         bool sync;
         bool force_memory;
-};
+} PullJob;
 
 int pull_job_new(PullJob **job, const char *url, CurlGlue *glue, void *userdata);
 PullJob* pull_job_unref(PullJob *job);
index 400a9d6adf73dae0770c2c725952ba5a9cea8db4..6ba8f6cdc903c1efacc15e740930f1215fd39f3b 100644 (file)
@@ -1,34 +1,24 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <curl/curl.h>
-#include <sys/xattr.h>
-
 #include "sd-daemon.h"
+#include "sd-event.h"
 
 #include "alloc-util.h"
-#include "btrfs-util.h"
 #include "copy.h"
 #include "curl-util.h"
 #include "fd-util.h"
 #include "fs-util.h"
-#include "hostname-util.h"
 #include "import-common.h"
 #include "import-util.h"
 #include "install-file.h"
 #include "log.h"
-#include "macro.h"
-#include "missing_fs.h"
 #include "mkdir-label.h"
-#include "path-util.h"
 #include "pull-common.h"
 #include "pull-job.h"
 #include "pull-raw.h"
 #include "qcow2-util.h"
-#include "rm-rf.h"
 #include "string-util.h"
-#include "strv.h"
 #include "tmpfile-util.h"
-#include "utf8.h"
 #include "web-util.h"
 
 typedef enum RawProgress {
@@ -39,7 +29,7 @@ typedef enum RawProgress {
         RAW_COPYING,
 } RawProgress;
 
-struct RawPull {
+typedef struct RawPull {
         sd_event *event;
         CurlGlue *glue;
 
@@ -79,7 +69,7 @@ struct RawPull {
         char *verity_temp_path;
 
         char *checksum;
-};
+} RawPull;
 
 RawPull* raw_pull_unref(RawPull *i) {
         if (!i)
index e50ba326f65f2b132237b7dce5489c6c035e4d72..8ca65795903cd2ad74fd5996e22479e68eaf3188 100644 (file)
@@ -1,11 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-event.h"
-
+#include "forward.h"
+#include "import-common.h"
 #include "import-util.h"
-#include "macro.h"
-#include "pull-common.h"
 
 typedef struct RawPull RawPull;
 
index 10f3ea0497a18d8c6c306a91a8116a195994b499..b4b5c690a0fbac22f9d3741ce5cda90982327820 100644 (file)
@@ -1,23 +1,20 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <curl/curl.h>
-#include <sys/prctl.h>
+#include <dirent.h>
 
 #include "sd-daemon.h"
+#include "sd-event.h"
 
 #include "alloc-util.h"
 #include "btrfs-util.h"
 #include "copy.h"
 #include "curl-util.h"
 #include "errno-util.h"
-#include "fd-util.h"
 #include "fs-util.h"
-#include "hostname-util.h"
 #include "import-common.h"
 #include "import-util.h"
 #include "install-file.h"
 #include "log.h"
-#include "macro.h"
 #include "mkdir-label.h"
 #include "path-util.h"
 #include "process-util.h"
 #include "pull-tar.h"
 #include "rm-rf.h"
 #include "string-util.h"
-#include "strv.h"
 #include "tmpfile-util.h"
-#include "user-util.h"
-#include "utf8.h"
 #include "web-util.h"
 
 typedef enum TarProgress {
@@ -39,7 +33,7 @@ typedef enum TarProgress {
         TAR_COPYING,
 } TarProgress;
 
-struct TarPull {
+typedef struct TarPull {
         sd_event *event;
         CurlGlue *glue;
 
@@ -66,7 +60,7 @@ struct TarPull {
         char *settings_temp_path;
 
         char *checksum;
-};
+} TarPull;
 
 TarPull* tar_pull_unref(TarPull *i) {
         if (!i)
index 1a5b740463c62a9de3fbc0c22f8f1fa70f1c16fe..627cb0bcc8cd851c124f8ea5b6b24c422e06c507 100644 (file)
@@ -1,11 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-event.h"
-
+#include "forward.h"
+#include "import-common.h"
 #include "import-util.h"
-#include "macro.h"
-#include "pull-common.h"
 
 typedef struct TarPull TarPull;
 
index b2614fa8f56f7bf901fd846b9d62f8402765b235..41193e43971ac01bff525cfd92c2d725800b07a4 100644 (file)
@@ -2,9 +2,9 @@
 
 #include <getopt.h>
 #include <locale.h>
+#include <stdio.h>
 
 #include "sd-event.h"
-#include "sd-id128.h"
 
 #include "alloc-util.h"
 #include "ansi-color.h"
 #include "discover-image.h"
 #include "env-util.h"
 #include "hexdecoct.h"
-#include "hostname-util.h"
 #include "import-common.h"
 #include "import-util.h"
 #include "io-util.h"
+#include "log.h"
 #include "main-func.h"
 #include "parse-argument.h"
 #include "parse-util.h"
+#include "path-util.h"
 #include "pull-raw.h"
 #include "pull-tar.h"
+#include "runtime-scope.h"
 #include "signal-util.h"
 #include "string-util.h"
-#include "terminal-util.h"
 #include "verbs.h"
 #include "web-util.h"
 
@@ -109,7 +110,7 @@ static void on_tar_finished(TarPull *pull, int error, void *userdata) {
         if (error == 0)
                 log_info("Operation completed successfully.");
 
-        sd_event_exit(event, abs(error));
+        sd_event_exit(event, ABS(error));
 }
 
 static int pull_tar(int argc, char *argv[], void *userdata) {
@@ -179,7 +180,7 @@ static void on_raw_finished(RawPull *pull, int error, void *userdata) {
         if (error == 0)
                 log_info("Operation completed successfully.");
 
-        sd_event_exit(event, abs(error));
+        sd_event_exit(event, ABS(error));
 }
 
 static int pull_raw(int argc, char *argv[], void *userdata) {
index 6c186f6128f8ee1d85c44776ce1b0bf5a8688e39..77298bcbe29796292df9d8dbe4e104b20cb6d88f 100644 (file)
@@ -3,8 +3,7 @@
 #include <zlib.h>
 
 #include "alloc-util.h"
-#include "assert-util.h"
-#include "btrfs-util.h"
+#include "copy.h"
 #include "qcow2-util.h"
 #include "sparse-endian.h"
 
index 88932071bc4eeb7551fe0c186709271d90affbf9..26b0685c3177208156e0d3688923be3704abadc6 100644 (file)
@@ -1,8 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <fcntl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
 
 #include "fd-util.h"
 #include "log.h"