tools/env: no global variable sharing between application and library
Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
diff --git a/tools/env/fw_env.h b/tools/env/fw_env.h
index d4daeea..dac964d 100644
--- a/tools/env/fw_env.h
+++ b/tools/env/fw_env.h
@@ -57,33 +57,22 @@
"bootm"
#endif
-struct common_args {
+struct env_opts {
#ifdef CONFIG_FILE
char *config_file;
#endif
- uint8_t aes_key[AES_KEY_LENGTH];
int aes_flag; /* Is AES encryption used? */
-};
-extern struct common_args common_args;
-
-struct printenv_args {
- int value_only;
-};
-extern struct printenv_args printenv_args;
-
-struct setenv_args {
- char *script_file;
+ uint8_t aes_key[AES_KEY_LENGTH];
};
-extern struct setenv_args setenv_args;
int parse_aes_key(char *key, uint8_t *bin_key);
-int fw_printenv(int argc, char *argv[], int value_only);
+int fw_printenv(int argc, char *argv[], int value_only, struct env_opts *opts);
char *fw_getenv(char *name);
-int fw_setenv(int argc, char *argv[]);
-int fw_parse_script(char *fname);
-int fw_env_open(void);
+int fw_setenv(int argc, char *argv[], struct env_opts *opts);
+int fw_parse_script(char *fname, struct env_opts *opts);
+int fw_env_open(struct env_opts *opts);
int fw_env_write(char *name, char *value);
-int fw_env_close(void);
+int fw_env_close(struct env_opts *opts);
unsigned long crc32(unsigned long, const unsigned char *, unsigned);