summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/command.c1
-rw-r--r--include/common.h4
-rw-r--r--include/env.h28
3 files changed, 29 insertions, 4 deletions
diff --git a/common/command.c b/common/command.c
index db25bf54e0..4b887a267f 100644
--- a/common/command.c
+++ b/common/command.c
@@ -11,6 +11,7 @@
#include <common.h>
#include <command.h>
#include <console.h>
+#include <env.h>
#include <linux/ctype.h>
/*
diff --git a/include/common.h b/include/common.h
index 4d0dd3f1b7..6b890470c1 100644
--- a/include/common.h
+++ b/include/common.h
@@ -247,10 +247,6 @@ static inline int env_set_addr(const char *varname, const void *addr)
return env_set_hex(varname, (ulong)addr);
}
-#ifdef CONFIG_AUTO_COMPLETE
-int env_complete(char *var, int maxv, char *cmdv[], int maxsz, char *buf,
- bool dollar_comp);
-#endif
int get_env_id (void);
void pci_init_board(void);
diff --git a/include/env.h b/include/env.h
new file mode 100644
index 0000000000..157ee9b724
--- /dev/null
+++ b/include/env.h
@@ -0,0 +1,28 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Common environment functions
+ *
+ * (C) Copyright 2000-2009
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ */
+
+#ifndef __ENV_H
+#define __ENV_H
+
+#include <stdbool.h>
+
+/**
+ * env_complete() - return an auto-complete for environment variables
+ *
+ * @var: partial name to auto-complete
+ * @maxv: Maximum number of matches to return
+ * @cmdv: Returns a list of possible matches
+ * @maxsz: Size of buffer to use for matches
+ * @buf: Buffer to use for matches
+ * @dollar_comp: non-zero to wrap each match in ${...}
+ * @return number of matches found (in @cmdv)
+ */
+int env_complete(char *var, int maxv, char *cmdv[], int maxsz, char *buf,
+ bool dollar_comp);
+
+#endif