mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
Encapsulated conf API
This commit is contained in:
parent
8f0cb26fdf
commit
3e091c8822
26 changed files with 473 additions and 404 deletions
|
|
@ -970,34 +970,35 @@ int main(int argc, char **argv)
|
|||
return 1;
|
||||
}
|
||||
snd_config_foreach(i, conf) {
|
||||
snd_config_t *n = snd_config_entry(i);
|
||||
if (strcmp(n->id, "comment") == 0)
|
||||
snd_config_t *n = snd_config_iterator_entry(i);
|
||||
const char *id = snd_config_get_id(n);
|
||||
if (strcmp(id, "comment") == 0)
|
||||
continue;
|
||||
if (strcmp(n->id, "host") == 0) {
|
||||
err = snd_config_string_get(n, &host);
|
||||
if (strcmp(id, "host") == 0) {
|
||||
err = snd_config_get_string(n, &host);
|
||||
if (err < 0) {
|
||||
ERROR("Invalid type for %s", n->id);
|
||||
ERROR("Invalid type for %s", id);
|
||||
return 1;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (strcmp(n->id, "socket") == 0) {
|
||||
err = snd_config_string_get(n, &socket);
|
||||
if (strcmp(id, "socket") == 0) {
|
||||
err = snd_config_get_string(n, &socket);
|
||||
if (err < 0) {
|
||||
ERROR("Invalid type for %s", n->id);
|
||||
ERROR("Invalid type for %s", id);
|
||||
return 1;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (strcmp(n->id, "port") == 0) {
|
||||
err = snd_config_integer_get(n, &port);
|
||||
if (strcmp(id, "port") == 0) {
|
||||
err = snd_config_get_integer(n, &port);
|
||||
if (err < 0) {
|
||||
ERROR("Invalid type for %s", n->id);
|
||||
ERROR("Invalid type for %s", id);
|
||||
return 1;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
ERROR("Unknown field %s", n->id);
|
||||
ERROR("Unknown field %s", id);
|
||||
return 1;
|
||||
}
|
||||
if (!host) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue