getenv() is declared in some avr-libc versions.
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)
* 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).
*
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;
/* 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) {
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];
}
}
-char *getenv(const MEMX char *name)
+char *getenv_char(const MEMX char *name)
{
env_item_t *ep;
char *ret = NULL;
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;
}
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);
}
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);