os-util: move declaration of string table lookup for image class

This commit is contained in:
Yu Watanabe
2023-04-11 05:20:15 +09:00
parent 1dec1c6163
commit c2cd950817
3 changed files with 11 additions and 9 deletions
+10
View File
@@ -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;
+1
View File
@@ -5,6 +5,7 @@
#include <stdio.h>
#include "time-util.h"
typedef enum ImageClass {
IMAGE_MACHINE,
IMAGE_PORTABLE,
-9
View 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);