Ejemplo n.º 1
0
static char *gpps_raw(void *handle, const char *name, const char *def)
{
    char *ret = read_setting_s(handle, name);
    if (!ret)
	ret = platform_default_s(name);
    if (!ret)
	ret = def ? dupstr(def) : NULL;   /* permit NULL as final fallback */
    return ret;
}
Ejemplo n.º 2
0
static void gpps(void *handle, const char *name, const char *def, char *val,
		int len) {
	if (!read_setting_s(handle, name, val, len)) {
		char *pdef;

		pdef = platform_default_s(name);
		if (pdef) {
			strncpy(val, pdef, len);
			sfree(pdef);
		} else {
			strncpy(val, def, len);
		}

		val[len - 1] = '\0';
	}
}