if (c == '}') {
/* Terminate variable name */
*(inp-1) = '\0';
- const char *envval = getenv_char(varname);
+ const char *envval = getenv_str(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_char(), which returns a pointer directly to
+ * may be the result from getenv_str(), 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).
*
/* TODO: enters endless loop on wrong parameters */
- if ((lp = getenv_char(PSTR(ENV_PINALIAS))) != NULL) {
+ if ((lp = getenv_str(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_char(PSTR(ENV_CPM3_SYSFILE));
+ fname = getenv_str(PSTR(ENV_CPM3_SYSFILE));
if (argc > 1) {
fname = argv[1];
}
for (i = 1; i < argc; ++i) {
char *arg;
- arg = getenv_char(argv[i]);
+ arg = getenv_str(argv[i]);
if (arg == NULL) {
printf_P(PSTR("## Error: \"%s\" is not set\n"), argv[i]);
return CMD_RET_FAILURE;
}
-char *getenv_char(const MEMX char *name)
+char *getenv_str(const MEMX char *name)
{
env_item_t *ep;
char *ret = NULL;
*/
bool getenv_yesno(const MEMX char *name)
{
- char *s = getenv_char(name);
+ char *s = getenv_str(name);
if (s == NULL)
return false;
debug("### main_loop entered: bootdelay=%d\n\n", bootdelay);
_delay_ms(20);
- s = getenv_char(PSTR(ENV_BOOTCMD));
+ s = getenv_str(PSTR(ENV_BOOTCMD));
stored_bootdelay = bootdelay;
return s;
}
int env_init(void);
-char *getenv_char(const MEMX char *name);
+char *getenv_str(const MEMX char *name);
unsigned long getenv_ulong(const MEMX char *name, int base, unsigned long default_val);
bool getenv_yesno(const MEMX char *name);
int setenv_ulong(const MEMX char *varname, unsigned long value);