]> cloudbase.mooo.com Git - z180-stamp.git/commitdiff
Rename getenv() to getenv_char()
authorLeo C <erbl259-lmu@yahoo.de>
Mon, 21 Mar 2016 22:33:05 +0000 (23:33 +0100)
committerLeo C <erbl259-lmu@yahoo.de>
Mon, 21 Mar 2016 22:33:05 +0000 (23:33 +0100)
getenv() is declared in some avr-libc versions.

avr/cli.c
avr/cmd_gpio.c
avr/cmd_loadcpm3.c
avr/env.c
avr/main.c
avr/z180-serv.c
include/env.h

index e66554ac0ed58240966d70d8ba9c1c5e09660733..8763ed1dff7a775c59af2522ed29d0e2ed5ec4a2 100644 (file)
--- a/avr/cli.c
+++ b/avr/cli.c
@@ -177,7 +177,7 @@ char *process_macros(char *input, char *output)
                                if (c == '}') {
                                        /* Terminate variable name */
                                        *(inp-1) = '\0';
-                                       const char *envval = getenv(varname);
+                                       const char *envval = getenv_char(varname);
                                        *(inp-1) = '}';
                                        /* Copy into the line if it exists */
                                        if (envval != NULL)
@@ -210,7 +210,7 @@ char *process_macros(char *input, char *output)
  * WARNING:
  *
  * We must create a temporary copy of the command since the command we get
- * may be the result from getenv(), which returns a pointer directly to
+ * may be the result from getenv_char(), which returns a pointer directly to
  * the environment data, which may change magicly when the command we run
  * creates or modifies environment variables (like "bootp" does).
  *
@@ -398,7 +398,7 @@ command_ret_t do_run(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        for (i = 1; i < argc; ++i) {
                char *arg;
 
-               arg = getenv(argv[i]);
+               arg = getenv_char(argv[i]);
                if (arg == NULL) {
                        printf_P(PSTR("## Error: \"%s\" is not set\n"), argv[i]);
                        return CMD_RET_FAILURE;
index 5589381b4b1364857c0eac7e13718739d42cd377..6b7b3f7b069c9a6b5ef8d4391d84992d6f8ed728 100644 (file)
@@ -37,7 +37,7 @@ static void pinnames_get(void)
 
 /* TODO: enters endless loop on wrong parameters */
 
-       if ((lp = getenv(PSTR(ENV_PINALIAS))) != NULL) {
+       if ((lp = getenv_char(PSTR(ENV_PINALIAS))) != NULL) {
                pin_names[namestr] = strdup(lp);
                ptr = strtok_P(pin_names[namestr], delim1);
                while (ptr != NULL) {
index 324a40dc7a2d92857d4b07593506a83e2795a574..a2436f23b0490d5f3f839329f0747c9a13ec0eb2 100644 (file)
@@ -86,7 +86,7 @@ command_ret_t do_loadcpm3(cmd_tbl_t *cmdtp, int flag, int argc, char * const arg
        if (argc > 2)
                common_base = strtoul(argv[2], NULL, 16);
 
-       fname = getenv(PSTR(ENV_CPM3_SYSFILE));
+       fname = getenv_char(PSTR(ENV_CPM3_SYSFILE));
        if (argc > 1) {
                fname = argv[1];
        }
index 9ea355fa974001c9c9b2e4264c9b2356902c7769..c4837d52cf29190fba06e9476904a4a4f598ae56 100644 (file)
--- a/avr/env.c
+++ b/avr/env.c
@@ -316,7 +316,7 @@ int env_init(void)
 }
 
 
-char *getenv(const MEMX char *name)
+char *getenv_char(const MEMX char *name)
 {
        env_item_t *ep;
        char *ret = NULL;
index b8ce26d91886409465bcaec4a87fb2dd02441d2a..113b4f24310f2cea292503f9e274d7b6fbdba42a 100644 (file)
@@ -224,7 +224,7 @@ const char *bootdelay_process(void)
        debug("### main_loop entered: bootdelay=%d\n\n", bootdelay);
        _delay_ms(20);
 
-       s = getenv(PSTR(ENV_BOOTCMD));
+       s = getenv_char(PSTR(ENV_BOOTCMD));
        stored_bootdelay = bootdelay;
        return s;
 }
index a815537ea0d9fdc0b8b92cfe7d8bcf749a05f395..58843fd46dc1560bf8c4bbe867681f34f21b9d42 100644 (file)
@@ -317,7 +317,7 @@ void do_msg_cpm_login(uint8_t subf, int len, uint8_t * msg)
 
        strcpy_P((char *)disk_buffer, PSTR("dsk0"));
        disk_buffer[3] = msg[0] + '0';
-       if (((np = getenv((char*)disk_buffer)) == NULL) ||
+       if (((np = getenv_char((char*)disk_buffer)) == NULL) ||
                        ((drv_table[drv].img_name = strdup(np)) == NULL)) {
                return msg_cpm_result(subf, 0x03, res);
        }
index da38c541f8b340b15d2691265443e48542710888..c7e49cabf7672f49636d7f89de243c398262ace0 100644 (file)
@@ -9,7 +9,7 @@
 
 int env_init(void);
 
-char *getenv(const MEMX char *name);
+char *getenv_char(const MEMX char *name);
 unsigned long getenv_ulong(const MEMX char *name, int base, unsigned long default_val);
 int setenv_ulong(const MEMX char *varname, unsigned long value);
 int setenv_hex(const MEMX char *varname, unsigned long value);