aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-08-03 12:22:09 -0600
committerTom Rini <trini@konsulko.com>2017-08-16 08:22:18 -0400
commit382bee57f19b4454e2015bc19a010bc2d0ab9337 (patch)
tree8c13efda2a6539cdbf1ac76fc458ffef1e9c966d /include
parent01510091de905c46620757b9027b2e55c4b3b313 (diff)
downloadu-boot-382bee57f19b4454e2015bc19a010bc2d0ab9337.zip
u-boot-382bee57f19b4454e2015bc19a010bc2d0ab9337.tar.gz
u-boot-382bee57f19b4454e2015bc19a010bc2d0ab9337.tar.bz2
env: Rename setenv() to env_set()
We are now using an env_ prefix for environment functions. Rename setenv() for consistency. Also add function comments in common.h. Suggested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/_exports.h2
-rw-r--r--include/common.h14
-rw-r--r--include/configs/tam3517-common.h2
-rw-r--r--include/dataflash.h2
-rw-r--r--include/exports.h2
-rw-r--r--include/search.h2
6 files changed, 18 insertions, 6 deletions
diff --git a/include/_exports.h b/include/_exports.h
index 6ff4364..9deed77 100644
--- a/include/_exports.h
+++ b/include/_exports.h
@@ -32,7 +32,7 @@
EXPORT_FUNC(do_reset, int, do_reset, cmd_tbl_t *,
int , int , char * const [])
EXPORT_FUNC(getenv, char *, getenv, const char*)
- EXPORT_FUNC(setenv, int, setenv, const char *, const char *)
+ EXPORT_FUNC(env_set, int, env_set, const char *, const char *)
EXPORT_FUNC(simple_strtoul, unsigned long, simple_strtoul,
const char *, char **, unsigned int)
EXPORT_FUNC(strict_strtoul, int, strict_strtoul,
diff --git a/include/common.h b/include/common.h
index 030c179..0b543f3 100644
--- a/include/common.h
+++ b/include/common.h
@@ -336,7 +336,19 @@ ulong getenv_hex(const char *varname, ulong default_val);
* Return -1 if variable does not exist (default to true)
*/
int getenv_yesno(const char *var);
-int setenv (const char *, const char *);
+
+/**
+ * env_set() - set an environment variable
+ *
+ * This sets or deletes the value of an environment variable. For setting the
+ * value the variable is created if it does not already exist.
+ *
+ * @varname: Variable to adjust
+ * @value: Value to set for the variable, or NULL or "" to delete the variable
+ * @return 0 if OK, 1 on error
+ */
+int env_set(const char *varname, const char *value);
+
int setenv_ulong(const char *varname, ulong value);
int setenv_hex(const char *varname, ulong value);
/**
diff --git a/include/configs/tam3517-common.h b/include/configs/tam3517-common.h
index 54223c4..4336251 100644
--- a/include/configs/tam3517-common.h
+++ b/include/configs/tam3517-common.h
@@ -334,7 +334,7 @@ do { \
else \
strcpy(ethname, "ethaddr"); \
printf("Setting %s from EEPROM with %s\n", ethname, buf);\
- setenv(ethname, buf); \
+ env_set(ethname, buf); \
} \
} while (0)
diff --git a/include/dataflash.h b/include/dataflash.h
index 84a56c3..c9f2220 100644
--- a/include/dataflash.h
+++ b/include/dataflash.h
@@ -197,7 +197,7 @@ extern int AT91F_DataflashInit(void);
extern void dataflash_print_info (void);
extern void dataflash_perror (int err);
-extern void AT91F_DataflashSetEnv (void);
+extern void AT91F_Dataflashenv_set(void);
extern struct dataflash_addr cs[CONFIG_SYS_MAX_DATAFLASH_BANKS];
extern dataflash_protect_t area_list[NB_DATAFLASH_AREA];
diff --git a/include/exports.h b/include/exports.h
index 1d81bc4..6522d78 100644
--- a/include/exports.h
+++ b/include/exports.h
@@ -28,7 +28,7 @@ int vprintf(const char *, va_list);
unsigned long simple_strtoul(const char *cp, char **endp, unsigned int base);
int strict_strtoul(const char *cp, unsigned int base, unsigned long *res);
char *getenv (const char *name);
-int setenv (const char *varname, const char *varvalue);
+int env_set(const char *varname, const char *value);
long simple_strtol(const char *cp, char **endp, unsigned int base);
int strcmp(const char *cs, const char *ct);
unsigned long ustrtoul(const char *cp, char **endp, unsigned int base);
diff --git a/include/search.h b/include/search.h
index 402dfd8..df5d61c 100644
--- a/include/search.h
+++ b/include/search.h
@@ -118,7 +118,7 @@ extern int hwalk_r(struct hsearch_data *__htab, int (*callback)(ENTRY *));
#define H_MATCH_SUBSTR (1 << 7) /* search for substring matches */
#define H_MATCH_REGEX (1 << 8) /* search for regular expression matches */
#define H_MATCH_METHOD (H_MATCH_IDENT | H_MATCH_SUBSTR | H_MATCH_REGEX)
-#define H_PROGRAMMATIC (1 << 9) /* indicate that an import is from setenv() */
+#define H_PROGRAMMATIC (1 << 9) /* indicate that an import is from env_set() */
#define H_ORIGIN_FLAGS (H_INTERACTIVE | H_PROGRAMMATIC)
#endif /* _SEARCH_H_ */