From af95f2061aee57ce76e1d62a6962724cc5a849a8 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 1 Aug 2019 09:46:40 -0600 Subject: env: Create a new file for environment functions At present we have environment.h but this file includes all the environment-related header files as well as internals such as default_environment. It seems desirable to have a new header to hold the commonly used environment functions, so that most files can avoid including all of this unnecessary stuff. Create a new env.h header and move one function over to it. Signed-off-by: Simon Glass Acked-by: Joe Hershberger Reviewed-by: Simon Goldschmidt --- include/env.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 include/env.h (limited to 'include/env.h') diff --git a/include/env.h b/include/env.h new file mode 100644 index 0000000..157ee9b --- /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 + +/** + * 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 -- cgit v1.1