os-util: move declaration of string table lookup for image class
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 8 Apr 2023 12:27:48 +0000 (21:27 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 10 Apr 2023 20:20:15 +0000 (05:20 +0900)
src/basic/os-util.c
src/basic/os-util.h
src/shared/discover-image.c

index 8cb8d9302be26d999435c823c038b49974e0163e..686d5e138256049bd42e1454274c744229f8754e 100644 (file)
 #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;
index 2f641ba9cd1f18046db318776aa4c17f78815b0c..6121674361556956b912805e00062869acb6ae93 100644 (file)
@@ -5,6 +5,7 @@
 #include <stdio.h>
 
 #include "time-util.h"
+
 typedef enum ImageClass {
         IMAGE_MACHINE,
         IMAGE_PORTABLE,
index 0343d2e20b256a09213a8d1f5a3c672789ead9a8..d0b3245a271724e3b6b4b023566b6c109fee0f43 100644 (file)
@@ -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);