[alsa-devel] snd_seq_parse_address matching prefix

Henning Thielemann alsa at henning-thielemann.de
Tue Mar 13 23:46:52 CET 2012


snd_seq_parse_address(seq, addr, "foo") does not look for a client named 
"foo" but for a client with prefix "foo". I always found this to be a 
feature, not a bug, although it is not documented. Is this behavior 
intended? If yes, how to cope with the case where one client's name is the
prefix of another one? E.g. let the clients be

"foobar"
"foo"

(in this order)
then parsing "foo" will return the client address of "foobar", not that of 
"foo". Even more there is no prefix that will select "foo", but not 
"foobar".
  Sorting the clients with respect to increasing name lengths and then 
searching for matching prefixes in the sorted list would solve that 
problem.

Currently it's only a theoretical problem but if that behavior is intended 
it should at least be documented. Using snd_seq_query_next_client everyone 
can write his own parse_address. We should only know about the theoretical 
problem.


More information about the Alsa-devel mailing list