1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Common environment functions
5 * (C) Copyright 2000-2009
6 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
15 * env_get_id() - Gets a sequence number for the environment
17 * This value increments every time the environment changes, so can be used an
18 * an indication of this
20 * @return environment ID
25 * env_init() - Set up the pre-relocation environment
27 * This locates the environment or uses the default if nothing is available.
28 * This must be called before env_get() will work.
30 * @return 0 if OK, -ENODEV if no environment drivers are enabled
35 * env_get_f() - Look up the value of an environment variable (early)
37 * This function is called from env_get() if the environment has not been
38 * loaded yet (GD_FLG_ENV_READY flag is 0). Some environment locations will
39 * support reading the value (slowly) and some will not.
41 * @varname: Variable to look up
42 * @return value of variable, or NULL if not found
44 int env_get_f(const char *name, char *buf, unsigned int len);
47 * env_complete() - return an auto-complete for environment variables
49 * @var: partial name to auto-complete
50 * @maxv: Maximum number of matches to return
51 * @cmdv: Returns a list of possible matches
52 * @maxsz: Size of buffer to use for matches
53 * @buf: Buffer to use for matches
54 * @dollar_comp: non-zero to wrap each match in ${...}
55 * @return number of matches found (in @cmdv)
57 int env_complete(char *var, int maxv, char *cmdv[], int maxsz, char *buf,