diff options
author | 2011-11-15 08:05:22 +0000 | |
---|---|---|
committer | 2011-11-15 08:05:22 +0000 | |
commit | b395609868171dda79778399742da4042c7d40db (patch) | |
tree | f4f72c7c677213b01364f957b5ac3d13fa3811dd /lib/libsndio/debug.c | |
parent | Don't do non-512 writes to vnd. ok matthew (diff) | |
download | wireguard-openbsd-b395609868171dda79778399742da4042c7d40db.tar.xz wireguard-openbsd-b395609868171dda79778399742da4042c7d40db.zip |
Add a "device number" component in sndio(7) device names, allowing a
single aucat instance to handle all audio and MIDI services. Since
this partially breaks compatibility, this is a opportunitiy to fix few
other design mistakes (eg ':' being used by inet6, type name vs api
name confusion, etc..). This leads to the following names:
type[@hostname][,unit]/devnum[.option]
The device number is the minor device number for direct hardware
access (ie the 'N' in /dev/audioN). For aucat, this is the occurence
number of the -f (or -M) option.
There's a compatibility hook to keep old names working if only one
aucat server is running.
Diffstat (limited to 'lib/libsndio/debug.c')
-rw-r--r-- | lib/libsndio/debug.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/libsndio/debug.c b/lib/libsndio/debug.c index 05431cc6b3e..b592506494d 100644 --- a/lib/libsndio/debug.c +++ b/lib/libsndio/debug.c @@ -1,4 +1,4 @@ -/* $OpenBSD: debug.c,v 1.1 2011/04/16 10:52:22 ratchov Exp $ */ +/* $OpenBSD: debug.c,v 1.2 2011/11/15 08:05:22 ratchov Exp $ */ /* * Copyright (c) 2011 Alexandre Ratchov <alex@caoua.org> * @@ -39,3 +39,17 @@ sndio_debug_init(void) } } #endif + +const char * +sndio_parsetype(const char *str, char *type) +{ + while (*type) { + if (*type != *str) + return NULL; + type++; + str++; + } + if (*str >= 'a' && *str <= 'z') + return NULL; + return str; +} |