예제 #1
0
int
nvram_get_int(const char *name)
{
	char *value = nvram_get_(name);
	if (value)
		return atoi(value);
	else
		return 0;
}
예제 #2
0
char *
nvram_safe_get(const char *name)
{
	static const char nvram_empty[4] = {0};

	char *value = nvram_get_(name);
	if (value)
		return value;
	else
		return (char *)nvram_empty;
}
예제 #3
0
char *
nvram_get(const char *name)
{
	char *value;
	value=nvram_get_(name);
	if (value==-1)
		return 0;
	else if (value>0)
	{
//		if (name && value && (strstr(name, "wan") && strstr(name, "ifname")))
//			fprintf(stderr, "### get %s = %s\n", name, value);

		return value;
	}
	else if (value==0)
	{
		strcpy(BUFFER, value);

//		if (name && BUFFER && (strstr(name, "wan")  && strstr(name, "ifname")))
//			fprintf(stderr, "### get %s = %s\n", name, BUFFER);

		return BUFFER;
	}
}
예제 #4
0
char *
nvram_get(const char *name)
{
	return nvram_get_(name);
}