summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorStefano Babic <sbabic@denx.de>2017-04-05 18:08:02 +0200
committerTom Rini <trini@konsulko.com>2017-04-12 13:28:29 -0400
commit00c234f38fccaa24b052691913cb3a7e8bc2b3a1 (patch)
treefff3e6147591d0077d0786440a16fac811811d9f /tools
parent9d80b49a671c9922931adcd823aab0ed319a42d1 (diff)
env: add a version number to check API
Changes in the environment library are difficult to tracked by programs using the library. Add simply an API version number that must be increased each time when the API is changed. This can be detected and a program can work with different versions of the library. Signed-off-by: Stefano Babic <sbabic@denx.de>
Diffstat (limited to 'tools')
-rw-r--r--tools/env/fw_env.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/env/fw_env.h b/tools/env/fw_env.h
index 3e5539d7f3..cf346b3bab 100644
--- a/tools/env/fw_env.h
+++ b/tools/env/fw_env.h
@@ -8,6 +8,13 @@
#include <stdint.h>
#include <uboot_aes.h>
+/*
+ * Programs using the library must check which API is available,
+ * that varies depending on the U-Boot version.
+ * This can be changed in future
+ */
+#define FW_ENV_API_VERSION 1
+
struct env_opts {
#ifdef CONFIG_FILE
char *config_file;
@@ -140,4 +147,12 @@ int fw_env_write(char *name, char *value);
*/
int fw_env_close(struct env_opts *opts);
+/**
+ * fw_env_version - return the current version of the library
+ *
+ * Return:
+ * version string of the library
+ */
+char *fw_env_version(void);
+
unsigned long crc32(unsigned long, const unsigned char *, unsigned);