diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-04-08 14:27:48 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-04-10 22:20:15 +0200 |
commit | c2cd950817b50121f1d06bc83d7f459a1c283a72 (patch) | |
tree | 880a149e160190b8d40349257d918139e8f712f7 /src | |
parent | Merge pull request #27182 from mrc0mmand/test-tweaks (diff) | |
download | systemd-c2cd950817b50121f1d06bc83d7f459a1c283a72.tar.xz systemd-c2cd950817b50121f1d06bc83d7f459a1c283a72.zip |
os-util: move declaration of string table lookup for image class
Diffstat (limited to '')
-rw-r--r-- | src/basic/os-util.c | 10 | ||||
-rw-r--r-- | src/basic/os-util.h | 1 | ||||
-rw-r--r-- | src/shared/discover-image.c | 9 |
3 files changed, 11 insertions, 9 deletions
diff --git a/src/basic/os-util.c b/src/basic/os-util.c index 8cb8d9302b..686d5e1382 100644 --- a/src/basic/os-util.c +++ b/src/basic/os-util.c @@ -14,11 +14,21 @@ #include "parse-util.h" #include "path-util.h" #include "stat-util.h" +#include "string-table.h" #include "string-util.h" #include "strv.h" #include "utf8.h" #include "xattr-util.h" +static const char* const image_class_table[_IMAGE_CLASS_MAX] = { + [IMAGE_MACHINE] = "machine", + [IMAGE_PORTABLE] = "portable", + [IMAGE_SYSEXT] = "extension", + [IMAGE_CONFEXT] = "confext", +}; + +DEFINE_STRING_TABLE_LOOKUP(image_class, ImageClass); + /* Helper struct for naming simplicity and reusability */ static const struct { const char *release_file_directory; diff --git a/src/basic/os-util.h b/src/basic/os-util.h index 2f641ba9cd..6121674361 100644 --- a/src/basic/os-util.h +++ b/src/basic/os-util.h @@ -5,6 +5,7 @@ #include <stdio.h> #include "time-util.h" + typedef enum ImageClass { IMAGE_MACHINE, IMAGE_PORTABLE, diff --git a/src/shared/discover-image.c b/src/shared/discover-image.c index 0343d2e20b..d0b3245a27 100644 --- a/src/shared/discover-image.c +++ b/src/shared/discover-image.c @@ -1326,12 +1326,3 @@ static const char* const image_type_table[_IMAGE_TYPE_MAX] = { }; DEFINE_STRING_TABLE_LOOKUP(image_type, ImageType); - -static const char* const image_class_table[_IMAGE_CLASS_MAX] = { - [IMAGE_MACHINE] = "machine", - [IMAGE_PORTABLE] = "portable", - [IMAGE_SYSEXT] = "extension", - [IMAGE_CONFEXT] = "confext" -}; - -DEFINE_STRING_TABLE_LOOKUP(image_class, ImageClass); |