From: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 05/40] env: Create a new file for environment functions
Date: Thu, 1 Aug 2019 20:25:35 +0200 [thread overview]
Message-ID: <d43fc898-c2e9-faab-9607-1f28587c78e8@gmail.com> (raw)
In-Reply-To: <20190801154715.225318-6-sjg@chromium.org>
Am 01.08.2019 um 17:46 schrieb Simon Glass:
> 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 <sjg@chromium.org>
> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
> ---
>
> Changes in v2: None
>
> common/command.c | 1 +
> include/common.h | 4 ----
> include/env.h | 28 ++++++++++++++++++++++++++++
> 3 files changed, 29 insertions(+), 4 deletions(-)
> create mode 100644 include/env.h
>
> 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 at 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
>
next prev parent reply other threads:[~2019-08-01 18:25 UTC|newest]
Thread overview: 95+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-01 15:46 [U-Boot] [PATCH v2 00/40] env: common: Remove environment definitions from common.h Simon Glass
2019-08-01 15:46 ` [U-Boot] [PATCH v2 01/40] common: Move gzip functions into a new gzip header Simon Glass
2019-08-01 18:23 ` Simon Goldschmidt
2019-08-13 16:52 ` Tom Rini
2019-08-01 15:46 ` [U-Boot] [PATCH v2 02/40] common: Drop the dpram_... functions Simon Glass
2019-08-01 18:24 ` Simon Goldschmidt
2019-08-13 16:52 ` Tom Rini
2019-08-01 15:46 ` [U-Boot] [PATCH v2 03/40] common: Move lcd_setmem() to lcd.h Simon Glass
2019-08-13 16:53 ` Tom Rini
2019-08-01 15:46 ` [U-Boot] [PATCH v2 04/40] common: Remove video_setmem() Simon Glass
2019-08-13 16:53 ` Tom Rini
2019-08-01 15:46 ` [U-Boot] [PATCH v2 05/40] env: Create a new file for environment functions Simon Glass
2019-08-01 18:25 ` Simon Goldschmidt [this message]
2019-08-13 16:53 ` Tom Rini
2019-08-01 15:46 ` [U-Boot] [PATCH v2 06/40] env: Move get_env_id() to env.h Simon Glass
2019-08-13 16:53 ` Tom Rini
2019-08-01 15:46 ` [U-Boot] [PATCH v2 07/40] env: Move env_get_f() " Simon Glass
2019-08-13 16:53 ` Tom Rini
2019-08-01 15:46 ` [U-Boot] [PATCH v2 08/40] env: Move env_init() " Simon Glass
2019-08-13 16:53 ` Tom Rini
2019-08-01 15:46 ` [U-Boot] [PATCH v2 09/40] env: Move env_relocate() " Simon Glass
2019-08-13 16:53 ` Tom Rini
2019-08-01 15:46 ` [U-Boot] [PATCH v2 10/40] env: Move envmatch() " Simon Glass
2019-08-13 16:53 ` Tom Rini
2019-08-01 15:46 ` [U-Boot] [PATCH v2 11/40] env: Move env_set_hex() " Simon Glass
2019-08-13 16:53 ` Tom Rini
2019-08-01 15:46 ` [U-Boot] [PATCH v2 12/40] env: Move env_set_ulong() " Simon Glass
2019-08-13 16:53 ` Tom Rini
2019-08-01 15:46 ` [U-Boot] [PATCH v2 13/40] env: Move env_get_ulong() " Simon Glass
2019-08-13 16:54 ` Tom Rini
2019-08-01 15:46 ` [U-Boot] [PATCH v2 14/40] env: Move env_get_yesno() " Simon Glass
2019-08-13 16:54 ` Tom Rini
2019-08-01 15:46 ` [U-Boot] [PATCH v2 15/40] env: Move env_get_hex() " Simon Glass
2019-08-13 16:54 ` Tom Rini
2019-08-01 15:46 ` [U-Boot] [PATCH v2 16/40] env: Move env_set() " Simon Glass
2019-08-13 16:54 ` Tom Rini
2019-08-01 15:46 ` [U-Boot] [PATCH v2 17/40] env: Move env_get() " Simon Glass
2019-08-13 16:54 ` Tom Rini
2019-08-01 15:46 ` [U-Boot] [PATCH v2 18/40] env: Move eth_env_get/set_enetaddr() " Simon Glass
2019-08-13 16:54 ` Tom Rini
2019-08-01 15:46 ` [U-Boot] [PATCH v2 19/40] env: net: Move eth_parse_enetaddr() to net.c/h Simon Glass
2019-08-02 16:47 ` Joe Hershberger
2019-08-13 16:54 ` Tom Rini
2019-09-12 16:59 ` Ondřej Jirman
2019-09-12 18:22 ` Simon Glass
2019-09-12 18:28 ` Ondřej Jirman
2019-09-12 19:28 ` Simon Glass
2019-09-12 23:39 ` Ondřej Jirman
2019-09-13 14:25 ` Simon Glass
2019-09-13 14:34 ` Ondřej Jirman
2019-09-13 15:21 ` Tom Rini
2019-09-13 21:40 ` Joe Hershberger
2019-08-01 15:46 ` [U-Boot] [PATCH v2 20/40] env: Move env_fix_drivers() to env.h Simon Glass
2019-08-02 16:46 ` Joe Hershberger
2019-08-13 16:54 ` Tom Rini
2019-08-01 15:46 ` [U-Boot] [PATCH v2 21/40] env: Move set_default_vars " Simon Glass
2019-08-13 16:54 ` Tom Rini
2019-08-01 15:46 ` [U-Boot] [PATCH v2 22/40] env: Move env_load/save functions " Simon Glass
2019-08-13 16:54 ` Tom Rini
2019-08-01 15:46 ` [U-Boot] [PATCH v2 23/40] env: Move env import/export " Simon Glass
2019-08-13 16:55 ` Tom Rini
2019-08-01 15:46 ` [U-Boot] [PATCH v2 24/40] env: Drop env_crc_update() Simon Glass
2019-08-13 16:55 ` Tom Rini
2019-08-01 15:47 ` [U-Boot] [PATCH v2 25/40] env: Move get/set_default_env() to env.h Simon Glass
2019-08-13 16:55 ` Tom Rini
2019-08-01 15:47 ` [U-Boot] [PATCH v2 26/40] env: Move env_get_char() " Simon Glass
2019-08-13 16:55 ` Tom Rini
2019-08-01 15:47 ` [U-Boot] [PATCH v2 27/40] env: Move env_reloc() " Simon Glass
2019-08-13 16:55 ` Tom Rini
2019-08-01 15:47 ` [U-Boot] [PATCH v2 28/40] env: Rename environment to embedded_environment Simon Glass
2019-08-01 18:26 ` Simon Goldschmidt
2019-08-13 16:55 ` Tom Rini
2019-08-01 15:47 ` [U-Boot] [PATCH v2 29/40] env: Move env_valid to env.h Simon Glass
2019-08-13 16:55 ` Tom Rini
2019-08-01 15:47 ` [U-Boot] [PATCH v2 30/40] env: Move callback definitions " Simon Glass
2019-08-13 16:55 ` Tom Rini
2019-08-01 15:47 ` [U-Boot] [PATCH v2 31/40] env: Drop the ENTRY typedef Simon Glass
2019-08-01 15:47 ` [U-Boot] [PATCH v2 32/40] env: Drop _ENTRY Simon Glass
2019-08-01 15:47 ` [U-Boot] [PATCH v2 33/40] env: Rename the redundancy flags Simon Glass
2019-08-13 16:55 ` Tom Rini
2019-08-01 15:47 ` [U-Boot] [PATCH v2 34/40] env: Drop the ACTION typedef Simon Glass
2019-08-02 16:55 ` Joe Hershberger
2019-08-13 16:55 ` Tom Rini
2019-08-01 15:47 ` [U-Boot] [PATCH v2 35/40] env: Drop the double underscores in search.h Simon Glass
2019-08-13 16:55 ` Tom Rini
2019-08-01 15:47 ` [U-Boot] [PATCH v2 36/40] env: Move TOTAL_MALLOC_LEN to environment.h Simon Glass
2019-08-01 18:28 ` Simon Goldschmidt
2019-08-13 16:55 ` Tom Rini
2019-08-01 15:47 ` [U-Boot] [PATCH v2 37/40] env: Drop environment.h header file where not needed Simon Glass
2019-08-13 16:56 ` Tom Rini
2019-08-01 15:47 ` [U-Boot] [PATCH v2 38/40] env: Rename environment.h to env_internal.h Simon Glass
2019-08-01 18:31 ` Simon Goldschmidt
2019-08-01 15:47 ` [U-Boot] [PATCH v2 39/40] Drop PCMCIA Simon Glass
2019-08-13 16:56 ` Tom Rini
2019-08-01 15:47 ` [U-Boot] [PATCH v2 40/40] common: Add a note about the effort to reduce common.h Simon Glass
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d43fc898-c2e9-faab-9607-1f28587c78e8@gmail.com \
--to=simon.k.r.goldschmidt@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox