diff mbox series

[10/22] tools/utils: move XLU_ConfigSetting to libxl_cfg.c

Message ID e25a056307c43161cdd93bb9aaf6c5073971034f.1690990427.git.ehem+xen@m5p.com (mailing list archive)
State New, archived
Headers show
Series Cleanup and splitting of xl.cfg parsing | expand

Commit Message

Elliott Mitchell July 18, 2023, 11:31 p.m. UTC
XLU_ConfigSetting is only used inside libxl_cfg.c, so no need for it in
the internal header.  Keep the type definition in libxlu_internal.h as
the incomplete definition is needed for xlu__cfg_set_free().

There is no longer any need for XLU_ConfigSetting to be transparent.

Fixes: b104c3762d, 1a09c5113a ("libxlu: rework internal representation of setting")
Signed-off-by: Elliott Mitchell <ehem+xen@m5p.com>
---
@1a09c5113a deeper probing should have been done and figured out
everything needed to move to libxlu_cfg_i.h.  Making use of %code would
have been better, but moving would have been sufficient.

Note: If the decision is made to keep libxlu_cfg.c intact, then the type
definition should be in libxlu_cfg_y.y/libxlu_cfg_y.h.
---
 tools/libs/util/libxlu_cfg.c      | 8 ++++++++
 tools/libs/util/libxlu_internal.h | 8 +-------
 2 files changed, 9 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/tools/libs/util/libxlu_cfg.c b/tools/libs/util/libxlu_cfg.c
index 20534343f4..2ad58d4240 100644
--- a/tools/libs/util/libxlu_cfg.c
+++ b/tools/libs/util/libxlu_cfg.c
@@ -23,6 +23,14 @@ 
 #include "libxlu_cfg_y.h"
 #include "libxlu_cfg_l.h"
 
+struct XLU_ConfigSetting {
+    struct XLU_ConfigSetting *next;
+    char *name;
+    XLU_ConfigValue *value;
+    enum XLU_Operation op;
+    int lineno;
+};
+
 XLU_Config *xlu_cfg_init(FILE *report, const char *report_source) {
     XLU_Config *cfg;
 
diff --git a/tools/libs/util/libxlu_internal.h b/tools/libs/util/libxlu_internal.h
index 246ad0bde7..bf1827ea73 100644
--- a/tools/libs/util/libxlu_internal.h
+++ b/tools/libs/util/libxlu_internal.h
@@ -49,13 +49,7 @@  struct XLU_ConfigValue {
     XLU__CFG_YYLTYPE loc;
 };
 
-typedef struct XLU_ConfigSetting { /* transparent */
-    struct XLU_ConfigSetting *next;
-    char *name;
-    XLU_ConfigValue *value;
-    enum XLU_Operation op;
-    int lineno;
-} XLU_ConfigSetting;
+typedef struct XLU_ConfigSetting XLU_ConfigSetting;
 
 struct XLU_Config {
     XLU_ConfigSetting *settings;