rawmidi: do not abort when seeing the hint node

Add the hint node to the nodes that are allowed in rawmidi definitions,
and factor out the detection of such nodes into a common function.
This commit is contained in:
Clemens Ladisch 2006-10-27 10:54:08 +02:00
parent ddf9599542
commit 252fd43461
4 changed files with 20 additions and 6 deletions

View file

@ -987,3 +987,19 @@ ssize_t snd_rawmidi_read(snd_rawmidi_t *rawmidi, void *buffer, size_t size)
assert(buffer || size == 0);
return (rawmidi->ops->read)(rawmidi, buffer, size);
}
int snd_rawmidi_conf_generic_id(const char *id)
{
static const char *ids[] = {
"comment",
"type",
"hint",
};
unsigned int k;
for (k = 0; k < sizeof ids / sizeof *ids; ++k) {
if (strcmp(id, ids[k]) == 0)
return 1;
}
return 0;
}