]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
various: unexport a few internal structs
authorMike Yuan <me@yhndnzj.com>
Tue, 2 Jan 2024 12:27:02 +0000 (20:27 +0800)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 2 Jan 2024 23:40:33 +0000 (08:40 +0900)
We don't expose destructors for these internal structs already.
Let's make the struct itself implementation detail too.

src/hibernate-resume/hibernate-resume-config.c
src/hibernate-resume/hibernate-resume-config.h
src/shared/edit-util.c
src/shared/edit-util.h

index 201e14bc83bbd495cf53bdc758b96e6961df1ba5..a751a0ac4cdad9dc07963c494c40e2321f68bfda 100644 (file)
 #include "proc-cmdline.h"
 #include "efivars.h"
 
+typedef struct KernelHibernateLocation {
+        char *device;
+        uint64_t offset;
+        bool offset_set;
+} KernelHibernateLocation;
+
 static KernelHibernateLocation* kernel_hibernate_location_free(KernelHibernateLocation *k) {
         if (!k)
                 return NULL;
@@ -22,6 +28,19 @@ static KernelHibernateLocation* kernel_hibernate_location_free(KernelHibernateLo
 
 DEFINE_TRIVIAL_CLEANUP_FUNC(KernelHibernateLocation*, kernel_hibernate_location_free);
 
+typedef struct EFIHibernateLocation {
+        char *device;
+
+        sd_id128_t uuid;
+        uint64_t offset;
+
+        char *kernel_version;
+        char *id;
+        char *image_id;
+        char *version_id;
+        char *image_version;
+} EFIHibernateLocation;
+
 static EFIHibernateLocation* efi_hibernate_location_free(EFIHibernateLocation *e) {
         if (!e)
                 return NULL;
index be759ec5d6bff5360df71ec958d6eccb54e583cc..c0aa9e00ad1348f53b51351124849ddb6995be46 100644 (file)
@@ -5,24 +5,8 @@
 
 #include "sd-id128.h"
 
-typedef struct KernelHibernateLocation {
-        char *device;
-        uint64_t offset;
-        bool offset_set;
-} KernelHibernateLocation;
-
-typedef struct EFIHibernateLocation {
-        char *device;
-
-        sd_id128_t uuid;
-        uint64_t offset;
-
-        char *kernel_version;
-        char *id;
-        char *image_id;
-        char *version_id;
-        char *image_version;
-} EFIHibernateLocation;
+typedef struct KernelHibernateLocation KernelHibernateLocation;
+typedef struct EFIHibernateLocation EFIHibernateLocation;
 
 typedef struct HibernateInfo {
         const char *device;
index fb9bdbc1601ab42daf601207f7a328ca9325440d..cfb2828f4e3b4c7caba8c3218d492cac8b23841e 100644 (file)
 #include "strv.h"
 #include "tmpfile-util-label.h"
 
+typedef struct EditFile {
+        EditFileContext *context;
+        char *path;
+        char *original_path;
+        char **comment_paths;
+        char *temp;
+        unsigned line;
+} EditFile;
+
 void edit_file_context_done(EditFileContext *context) {
         int r;
 
index 29ff81f4e7440affd61732d43fac9c01fe9d2def..9d9c890f2a97ef590d26788c0b1b6814c59e5371 100644 (file)
@@ -7,18 +7,8 @@
 #define DROPIN_MARKER_END "### Edits below this comment will be discarded"
 
 typedef struct EditFile EditFile;
-typedef struct EditFileContext EditFileContext;
-
-struct EditFile {
-        EditFileContext *context;
-        char *path;
-        char *original_path;
-        char **comment_paths;
-        char *temp;
-        unsigned line;
-};
-
-struct EditFileContext {
+
+typedef struct EditFileContext {
         EditFile *files;
         size_t n_files;
         const char *marker_start;
@@ -26,7 +16,7 @@ struct EditFileContext {
         bool remove_parent;
         bool overwrite_with_origin; /* Always overwrite target with original file. */
         bool stdin;                 /* Read contents from stdin instead of launching an editor. */
-};
+} EditFileContext;
 
 void edit_file_context_done(EditFileContext *context);