aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2024-02-03 00:58:06 +0900
committerMasahiro Yamada <masahiroy@kernel.org>2024-02-19 18:20:40 +0900
commitd3d16228a520ce49884d3bb90b67c12726c63020 (patch)
treecce05ab391fc5dacc51f3106dd92c499ea45e54e /scripts
parent56e634b06fd554b819ac9c45fc77a41500861ced (diff)
downloadlinux-d3d16228a520ce49884d3bb90b67c12726c63020.tar.gz
kconfig: split preprocessor prototypes into preprocess.h
These are needed only for the parse stage. Move the prototypes into a separate header to make sure they are not used after that. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/kconfig/lexer.l2
-rw-r--r--scripts/kconfig/lkc_proto.h13
-rw-r--r--scripts/kconfig/parser.y1
-rw-r--r--scripts/kconfig/preprocess.c1
-rw-r--r--scripts/kconfig/preprocess.h19
5 files changed, 23 insertions, 13 deletions
diff --git a/scripts/kconfig/lexer.l b/scripts/kconfig/lexer.l
index 5f1bc33203073e..1bb372868ecf1d 100644
--- a/scripts/kconfig/lexer.l
+++ b/scripts/kconfig/lexer.l
@@ -14,6 +14,8 @@
#include <string.h>
#include "lkc.h"
+#include "preprocess.h"
+
#include "parser.tab.h"
#define YY_DECL static int yylex1(void)
diff --git a/scripts/kconfig/lkc_proto.h b/scripts/kconfig/lkc_proto.h
index 85491d74a0942d..94299e42402fa7 100644
--- a/scripts/kconfig/lkc_proto.h
+++ b/scripts/kconfig/lkc_proto.h
@@ -40,19 +40,6 @@ const char * sym_get_string_value(struct symbol *sym);
const char * prop_get_type_name(enum prop_type type);
-/* preprocess.c */
-enum variable_flavor {
- VAR_SIMPLE,
- VAR_RECURSIVE,
- VAR_APPEND,
-};
-void env_write_dep(struct gstr *gs);
-void variable_add(const char *name, const char *value,
- enum variable_flavor flavor);
-void variable_all_del(void);
-char *expand_dollar(const char **str);
-char *expand_one_token(const char **str);
-
/* expr.c */
void expr_print(struct expr *e, void (*fn)(void *, struct symbol *, const char *), void *data, int prevtoken);
diff --git a/scripts/kconfig/parser.y b/scripts/kconfig/parser.y
index cfb82ba09037da..ff68def09a2bfc 100644
--- a/scripts/kconfig/parser.y
+++ b/scripts/kconfig/parser.y
@@ -13,6 +13,7 @@
#include "lkc.h"
#include "internal.h"
+#include "preprocess.h"
#define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt)
diff --git a/scripts/kconfig/preprocess.c b/scripts/kconfig/preprocess.c
index b9853d4a891c8b..12665b981c3e50 100644
--- a/scripts/kconfig/preprocess.c
+++ b/scripts/kconfig/preprocess.c
@@ -11,6 +11,7 @@
#include "list.h"
#include "lkc.h"
+#include "preprocess.h"
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
diff --git a/scripts/kconfig/preprocess.h b/scripts/kconfig/preprocess.h
new file mode 100644
index 00000000000000..a7e4a550638c04
--- /dev/null
+++ b/scripts/kconfig/preprocess.h
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef PREPROCESS_H
+#define PREPROCESS_H
+
+enum variable_flavor {
+ VAR_SIMPLE,
+ VAR_RECURSIVE,
+ VAR_APPEND,
+};
+
+struct gstr;
+void env_write_dep(struct gstr *gs);
+void variable_add(const char *name, const char *value,
+ enum variable_flavor flavor);
+void variable_all_del(void);
+char *expand_dollar(const char **str);
+char *expand_one_token(const char **str);
+
+#endif /* PREPROCESS_H */