summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorratchov <ratchov@openbsd.org>2015-12-20 11:29:29 +0000
committerratchov <ratchov@openbsd.org>2015-12-20 11:29:29 +0000
commitbde5d16205d7fce9aa9d9c4a24abc5f43058c82b (patch)
treedc6078f73552b21d54ec6e782f831d1877054c98 /lib
parentDo not delay video(4) attachment if the device does not need to load (diff)
downloadwireguard-openbsd-bde5d16205d7fce9aa9d9c4a24abc5f43058c82b.tar.xz
wireguard-openbsd-bde5d16205d7fce9aa9d9c4a24abc5f43058c82b.zip
Expose internal functions necessary to open audio devices and midi
ports using existing file descriptors.
Diffstat (limited to 'lib')
-rw-r--r--lib/libsndio/mio_rmidi.c12
-rw-r--r--lib/libsndio/shlib_version2
-rw-r--r--lib/libsndio/sio_sun.c12
3 files changed, 19 insertions, 7 deletions
diff --git a/lib/libsndio/mio_rmidi.c b/lib/libsndio/mio_rmidi.c
index a00ed7f9f63..7034873b37c 100644
--- a/lib/libsndio/mio_rmidi.c
+++ b/lib/libsndio/mio_rmidi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mio_rmidi.c,v 1.22 2015/11/30 02:41:45 ratchov Exp $ */
+/* $OpenBSD: mio_rmidi.c,v 1.23 2015/12/20 11:29:29 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -56,7 +56,7 @@ static struct mio_ops mio_rmidi_ops = {
mio_rmidi_revents
};
-static int
+int
mio_rmidi_getfd(const char *str, unsigned int mode, int nbio)
{
const char *p;
@@ -64,6 +64,9 @@ mio_rmidi_getfd(const char *str, unsigned int mode, int nbio)
unsigned int devnum;
int fd, flags;
+#ifdef DEBUG
+ _sndio_debug_init();
+#endif
p = _sndio_parsetype(str, "rmidi");
if (p == NULL) {
DPRINTF("mio_rmidi_getfd: %s: \"rsnd\" expected\n", str);
@@ -96,11 +99,14 @@ mio_rmidi_getfd(const char *str, unsigned int mode, int nbio)
return fd;
}
-static struct mio_hdl *
+struct mio_hdl *
mio_rmidi_fdopen(int fd, unsigned int mode, int nbio)
{
struct mio_rmidi_hdl *hdl;
+#ifdef DEBUG
+ _sndio_debug_init();
+#endif
hdl = malloc(sizeof(struct mio_rmidi_hdl));
if (hdl == NULL)
return NULL;
diff --git a/lib/libsndio/shlib_version b/lib/libsndio/shlib_version
index 9c1551636c5..1394f4e4035 100644
--- a/lib/libsndio/shlib_version
+++ b/lib/libsndio/shlib_version
@@ -1,2 +1,2 @@
major=6
-minor=0
+minor=1
diff --git a/lib/libsndio/sio_sun.c b/lib/libsndio/sio_sun.c
index fd1be901fe3..51928f868a0 100644
--- a/lib/libsndio/sio_sun.c
+++ b/lib/libsndio/sio_sun.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sio_sun.c,v 1.23 2015/11/22 12:10:26 ratchov Exp $ */
+/* $OpenBSD: sio_sun.c,v 1.24 2015/12/20 11:29:29 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -328,7 +328,7 @@ sio_sun_getcap(struct sio_hdl *sh, struct sio_cap *cap)
#undef NRATES
}
-static int
+int
sio_sun_getfd(const char *str, unsigned int mode, int nbio)
{
const char *p;
@@ -336,6 +336,9 @@ sio_sun_getfd(const char *str, unsigned int mode, int nbio)
unsigned int devnum;
int fd, flags;
+#ifdef DEBUG
+ _sndio_debug_init();
+#endif
p = _sndio_parsetype(str, "rsnd");
if (p == NULL) {
DPRINTF("sio_sun_getfd: %s: \"rsnd\" expected\n", str);
@@ -368,13 +371,16 @@ sio_sun_getfd(const char *str, unsigned int mode, int nbio)
return fd;
}
-static struct sio_hdl *
+struct sio_hdl *
sio_sun_fdopen(int fd, unsigned int mode, int nbio)
{
struct audio_info aui;
struct sio_sun_hdl *hdl;
struct sio_par par;
+#ifdef DEBUG
+ _sndio_debug_init();
+#endif
hdl = malloc(sizeof(struct sio_sun_hdl));
if (hdl == NULL)
return NULL;