env: Move get_env_id() to env.h
[platform/kernel/u-boot.git] / include / env.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Common environment functions
4  *
5  * (C) Copyright 2000-2009
6  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
7  */
8
9 #ifndef __ENV_H
10 #define __ENV_H
11
12 #include <stdbool.h>
13
14 /**
15  * env_get_id() - Gets a sequence number for the environment
16  *
17  * This value increments every time the environment changes, so can be used an
18  * an indication of this
19  *
20  * @return environment ID
21  */
22 int env_get_id(void);
23
24 /**
25  * env_complete() - return an auto-complete for environment variables
26  *
27  * @var: partial name to auto-complete
28  * @maxv: Maximum number of matches to return
29  * @cmdv: Returns a list of possible matches
30  * @maxsz: Size of buffer to use for matches
31  * @buf: Buffer to use for matches
32  * @dollar_comp: non-zero to wrap each match in ${...}
33  * @return number of matches found (in @cmdv)
34  */
35 int env_complete(char *var, int maxv, char *cmdv[], int maxsz, char *buf,
36                  bool dollar_comp);
37
38 #endif