Extended parameterization. Marked with @ all fields with special use

This commit is contained in:
Abramo Bagnara 2001-06-15 14:00:19 +00:00
parent cf325c68e3
commit 54daf2f16d
16 changed files with 315 additions and 349 deletions

View file

@ -765,14 +765,14 @@ int _snd_pcm_shm_open(snd_pcm_t **pcmp, const char *name,
SNDERR("server is not defined");
return -EINVAL;
}
err = snd_config_search_alias(snd_config, "server", server, &sconfig);
err = snd_config_search_definition(snd_config, "server", server, &sconfig);
if (err < 0) {
SNDERR("Unknown server %s", server);
return -EINVAL;
}
if (snd_config_get_type(sconfig) != SND_CONFIG_TYPE_COMPOUND) {
SNDERR("Invalid type for server %s definition", server);
return -EINVAL;
goto _err;
}
snd_config_for_each(i, next, sconfig) {
snd_config_t *n = snd_config_iterator_entry(i);
@ -783,7 +783,7 @@ int _snd_pcm_shm_open(snd_pcm_t **pcmp, const char *name,
err = snd_config_get_string(n, &host);
if (err < 0) {
SNDERR("Invalid type for %s", id);
return -EINVAL;
goto _err;
}
continue;
}
@ -791,7 +791,7 @@ int _snd_pcm_shm_open(snd_pcm_t **pcmp, const char *name,
err = snd_config_get_string(n, &sockname);
if (err < 0) {
SNDERR("Invalid type for %s", id);
return -EINVAL;
goto _err;
}
continue;
}
@ -799,32 +799,36 @@ int _snd_pcm_shm_open(snd_pcm_t **pcmp, const char *name,
err = snd_config_get_integer(n, &port);
if (err < 0) {
SNDERR("Invalid type for %s", id);
return -EINVAL;
goto _err;
}
continue;
}
SNDERR("Unknown field %s", id);
_err:
snd_config_delete(sconfig);
return -EINVAL;
}
if (!host) {
SNDERR("host is not defined");
return -EINVAL;
goto _err;
}
if (!sockname) {
SNDERR("socket is not defined");
return -EINVAL;
goto _err;
}
h = gethostbyname(host);
if (!h) {
SNDERR("Cannot resolve %s", host);
return -EINVAL;
goto _err;
}
local = is_local(h);
if (!local) {
SNDERR("%s is not the local host", host);
return -EINVAL;
}
return snd_pcm_shm_open(pcmp, name, sockname, pcm_name, stream, mode);
err = snd_pcm_shm_open(pcmp, name, sockname, pcm_name, stream, mode);
snd_config_delete(sconfig);
return err;
}