summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2009-01-10 20:34:45 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2009-01-10 20:34:45 +0000
commit7ffead89ca8c8b826b136f409cabcb9ac8a26b64 (patch)
tree2d39de7500efd4322a6906e50d314de685d5374c
parent0086f129e1b2ead995c9995208a0bda055565019 (diff)
make all private functions static
-rw-r--r--lib/libsndio/aucat.c62
-rw-r--r--lib/libsndio/sndio.c4
-rw-r--r--lib/libsndio/sun.c58
3 files changed, 62 insertions, 62 deletions
diff --git a/lib/libsndio/aucat.c b/lib/libsndio/aucat.c
index 59a345954c0..e04c3cfe2ac 100644
--- a/lib/libsndio/aucat.c
+++ b/lib/libsndio/aucat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aucat.c,v 1.10 2008/12/27 12:10:42 ratchov Exp $ */
+/* $OpenBSD: aucat.c,v 1.11 2009/01/10 20:34:44 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -43,20 +43,20 @@ struct aucat_hdl {
unsigned curvol, reqvol; /* current and requested volume */
};
-void aucat_close(struct sio_hdl *);
-int aucat_start(struct sio_hdl *);
-int aucat_stop(struct sio_hdl *);
-int aucat_setpar(struct sio_hdl *, struct sio_par *);
-int aucat_getpar(struct sio_hdl *, struct sio_par *);
-int aucat_getcap(struct sio_hdl *, struct sio_cap *);
-size_t aucat_read(struct sio_hdl *, void *, size_t);
-size_t aucat_write(struct sio_hdl *, void *, size_t);
-int aucat_pollfd(struct sio_hdl *, struct pollfd *, int);
-int aucat_revents(struct sio_hdl *, struct pollfd *);
-int aucat_setvol(struct sio_hdl *, unsigned);
-void aucat_getvol(struct sio_hdl *);
-
-struct sio_ops aucat_ops = {
+static void aucat_close(struct sio_hdl *);
+static int aucat_start(struct sio_hdl *);
+static int aucat_stop(struct sio_hdl *);
+static int aucat_setpar(struct sio_hdl *, struct sio_par *);
+static int aucat_getpar(struct sio_hdl *, struct sio_par *);
+static int aucat_getcap(struct sio_hdl *, struct sio_cap *);
+static size_t aucat_read(struct sio_hdl *, void *, size_t);
+static size_t aucat_write(struct sio_hdl *, void *, size_t);
+static int aucat_pollfd(struct sio_hdl *, struct pollfd *, int);
+static int aucat_revents(struct sio_hdl *, struct pollfd *);
+static int aucat_setvol(struct sio_hdl *, unsigned);
+static void aucat_getvol(struct sio_hdl *);
+
+static struct sio_ops aucat_ops = {
aucat_close,
aucat_setpar,
aucat_getpar,
@@ -121,7 +121,7 @@ sio_open_aucat(char *path, unsigned mode, int nbio)
/*
* read a message, return 0 if blocked
*/
-int
+static int
aucat_rmsg(struct aucat_hdl *hdl)
{
ssize_t n;
@@ -152,7 +152,7 @@ aucat_rmsg(struct aucat_hdl *hdl)
/*
* write a message, return 0 if blocked
*/
-int
+static int
aucat_wmsg(struct aucat_hdl *hdl)
{
ssize_t n;
@@ -178,7 +178,7 @@ aucat_wmsg(struct aucat_hdl *hdl)
/*
* execute the next message, return 0 if blocked
*/
-int
+static int
aucat_runmsg(struct aucat_hdl *hdl)
{
if (!aucat_rmsg(hdl))
@@ -213,7 +213,7 @@ aucat_runmsg(struct aucat_hdl *hdl)
return 1;
}
-void
+static void
aucat_close(struct sio_hdl *sh)
{
struct aucat_hdl *hdl = (struct aucat_hdl *)sh;
@@ -223,7 +223,7 @@ aucat_close(struct sio_hdl *sh)
free(hdl);
}
-int
+static int
aucat_start(struct sio_hdl *sh)
{
struct aucat_hdl *hdl = (struct aucat_hdl *)sh;
@@ -253,7 +253,7 @@ aucat_start(struct sio_hdl *sh)
return 1;
}
-int
+static int
aucat_stop(struct sio_hdl *sh)
{
#define ZERO_MAX 0x400
@@ -313,7 +313,7 @@ aucat_stop(struct sio_hdl *sh)
return 1;
}
-int
+static int
aucat_setpar(struct sio_hdl *sh, struct sio_par *par)
{
struct aucat_hdl *hdl = (struct aucat_hdl *)sh;
@@ -339,7 +339,7 @@ aucat_setpar(struct sio_hdl *sh, struct sio_par *par)
return 1;
}
-int
+static int
aucat_getpar(struct sio_hdl *sh, struct sio_par *par)
{
struct aucat_hdl *hdl = (struct aucat_hdl *)sh;
@@ -374,7 +374,7 @@ aucat_getpar(struct sio_hdl *sh, struct sio_par *par)
return 1;
}
-int
+static int
aucat_getcap(struct sio_hdl *sh, struct sio_cap *cap)
{
struct aucat_hdl *hdl = (struct aucat_hdl *)sh;
@@ -408,7 +408,7 @@ aucat_getcap(struct sio_hdl *sh, struct sio_cap *cap)
return 1;
}
-size_t
+static size_t
aucat_read(struct sio_hdl *sh, void *buf, size_t len)
{
struct aucat_hdl *hdl = (struct aucat_hdl *)sh;
@@ -449,7 +449,7 @@ aucat_read(struct sio_hdl *sh, void *buf, size_t len)
return n;
}
-int
+static int
aucat_buildmsg(struct aucat_hdl *hdl, size_t len)
{
unsigned sz;
@@ -475,7 +475,7 @@ aucat_buildmsg(struct aucat_hdl *hdl, size_t len)
return 0;
}
-size_t
+static size_t
aucat_write(struct sio_hdl *sh, void *buf, size_t len)
{
struct aucat_hdl *hdl = (struct aucat_hdl *)sh;
@@ -529,7 +529,7 @@ aucat_write(struct sio_hdl *sh, void *buf, size_t len)
return n;
}
-int
+static int
aucat_pollfd(struct sio_hdl *sh, struct pollfd *pfd, int events)
{
struct aucat_hdl *hdl = (struct aucat_hdl *)sh;
@@ -544,7 +544,7 @@ aucat_pollfd(struct sio_hdl *sh, struct pollfd *pfd, int events)
return 1;
}
-int
+static int
aucat_revents(struct sio_hdl *sh, struct pollfd *pfd)
{
struct aucat_hdl *hdl = (struct aucat_hdl *)sh;
@@ -567,7 +567,7 @@ aucat_revents(struct sio_hdl *sh, struct pollfd *pfd)
return revents & (hdl->events | POLLHUP);
}
-int
+static int
aucat_setvol(struct sio_hdl *sh, unsigned vol)
{
struct aucat_hdl *hdl = (struct aucat_hdl *)sh;
@@ -576,7 +576,7 @@ aucat_setvol(struct sio_hdl *sh, unsigned vol)
return 1;
}
-void
+static void
aucat_getvol(struct sio_hdl *sh)
{
struct aucat_hdl *hdl = (struct aucat_hdl *)sh;
diff --git a/lib/libsndio/sndio.c b/lib/libsndio/sndio.c
index 979ed0e24bd..30003dc6312 100644
--- a/lib/libsndio/sndio.c
+++ b/lib/libsndio/sndio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sndio.c,v 1.12 2008/12/27 11:35:50 ratchov Exp $ */
+/* $OpenBSD: sndio.c,v 1.13 2009/01/10 20:34:44 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -311,7 +311,7 @@ sio_getcap(struct sio_hdl *hdl, struct sio_cap *cap)
return hdl->ops->getcap(hdl, cap);
}
-int
+static int
sio_psleep(struct sio_hdl *hdl, int event)
{
struct pollfd pfd;
diff --git a/lib/libsndio/sun.c b/lib/libsndio/sun.c
index 938d132ad60..b36c4abfe1b 100644
--- a/lib/libsndio/sun.c
+++ b/lib/libsndio/sun.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sun.c,v 1.11 2008/12/21 16:15:24 ratchov Exp $ */
+/* $OpenBSD: sun.c,v 1.12 2009/01/10 20:34:44 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -53,20 +53,20 @@ struct sun_hdl {
int mix_fd, mix_index; /* /dev/mixerN stuff */
};
-void sun_close(struct sio_hdl *);
-int sun_start(struct sio_hdl *);
-int sun_stop(struct sio_hdl *);
-int sun_setpar(struct sio_hdl *, struct sio_par *);
-int sun_getpar(struct sio_hdl *, struct sio_par *);
-int sun_getcap(struct sio_hdl *, struct sio_cap *);
-size_t sun_read(struct sio_hdl *, void *, size_t);
-size_t sun_write(struct sio_hdl *, void *, size_t);
-int sun_pollfd(struct sio_hdl *, struct pollfd *, int);
-int sun_revents(struct sio_hdl *, struct pollfd *);
-int sun_setvol(struct sio_hdl *, unsigned);
-void sun_getvol(struct sio_hdl *);
-
-struct sio_ops sun_ops = {
+static void sun_close(struct sio_hdl *);
+static int sun_start(struct sio_hdl *);
+static int sun_stop(struct sio_hdl *);
+static int sun_setpar(struct sio_hdl *, struct sio_par *);
+static int sun_getpar(struct sio_hdl *, struct sio_par *);
+static int sun_getcap(struct sio_hdl *, struct sio_cap *);
+static size_t sun_read(struct sio_hdl *, void *, size_t);
+static size_t sun_write(struct sio_hdl *, void *, size_t);
+static int sun_pollfd(struct sio_hdl *, struct pollfd *, int);
+static int sun_revents(struct sio_hdl *, struct pollfd *);
+static int sun_setvol(struct sio_hdl *, unsigned);
+static void sun_getvol(struct sio_hdl *);
+
+static struct sio_ops sun_ops = {
sun_close,
sun_setpar,
sun_getpar,
@@ -84,7 +84,7 @@ struct sio_ops sun_ops = {
/*
* convert sun encoding to sio_par encoding
*/
-void
+static void
sun_infotoenc(struct sun_hdl *hdl, struct audio_prinfo *ai, struct sio_par *par)
{
par->msb = 1;
@@ -124,7 +124,7 @@ sun_infotoenc(struct sun_hdl *hdl, struct audio_prinfo *ai, struct sio_par *par)
/*
* convert sio_par encoding to sun encoding
*/
-void
+static void
sun_enctoinfo(struct sun_hdl *hdl, struct audio_prinfo *ai, struct sio_par *par)
{
if (par->le && par->sig) {
@@ -143,7 +143,7 @@ sun_enctoinfo(struct sun_hdl *hdl, struct audio_prinfo *ai, struct sio_par *par)
* try to set the device to the given parameters and check that the
* device can use them; return 1 on success, 0 on failure or error
*/
-int
+static int
sun_tryinfo(struct sun_hdl *hdl, struct sio_enc *enc,
unsigned pchan, unsigned rchan, unsigned rate)
{
@@ -206,7 +206,7 @@ sun_tryinfo(struct sun_hdl *hdl, struct sio_enc *enc,
/*
* guess device capabilities
*/
-int
+static int
sun_getcap(struct sio_hdl *sh, struct sio_cap *cap)
{
#define NCHANS (sizeof(chans) / sizeof(chans[0]))
@@ -325,7 +325,7 @@ sun_getcap(struct sio_hdl *sh, struct sio_cap *cap)
#undef NRATES
}
-void
+static void
sun_getvol(struct sio_hdl *sh)
{
struct sun_hdl *hdl = (struct sun_hdl *)sh;
@@ -405,7 +405,7 @@ sio_open_sun(char *path, unsigned mode, int nbio)
return NULL;
}
-void
+static void
sun_close(struct sio_hdl *sh)
{
struct sun_hdl *hdl = (struct sun_hdl *)sh;
@@ -416,7 +416,7 @@ sun_close(struct sio_hdl *sh)
free(hdl);
}
-int
+static int
sun_start(struct sio_hdl *sh)
{
struct sio_par par;
@@ -470,7 +470,7 @@ sun_start(struct sio_hdl *sh)
return 1;
}
-int
+static int
sun_stop(struct sio_hdl *sh)
{
struct sun_hdl *hdl = (struct sun_hdl *)sh;
@@ -505,7 +505,7 @@ sun_stop(struct sio_hdl *sh)
return 1;
}
-int
+static int
sun_setpar(struct sio_hdl *sh, struct sio_par *par)
{
#define NRETRIES 8
@@ -624,7 +624,7 @@ sun_setpar(struct sio_hdl *sh, struct sio_par *par)
#undef NRETRIES
}
-int
+static int
sun_getpar(struct sio_hdl *sh, struct sio_par *par)
{
struct sun_hdl *hdl = (struct sun_hdl *)sh;
@@ -655,7 +655,7 @@ sun_getpar(struct sio_hdl *sh, struct sio_par *par)
return 1;
}
-size_t
+static size_t
sun_read(struct sio_hdl *sh, void *buf, size_t len)
{
#define DROP_NMAX 0x1000
@@ -706,7 +706,7 @@ sun_read(struct sio_hdl *sh, void *buf, size_t len)
return n;
}
-size_t
+static size_t
sun_autostart(struct sun_hdl *hdl)
{
struct audio_info aui;
@@ -738,7 +738,7 @@ sun_autostart(struct sun_hdl *hdl)
return 1;
}
-size_t
+static size_t
sun_write(struct sio_hdl *sh, void *buf, size_t len)
{
#define ZERO_NMAX 0x1000
@@ -787,7 +787,7 @@ sun_write(struct sio_hdl *sh, void *buf, size_t len)
return n;
}
-int
+static int
sun_pollfd(struct sio_hdl *sh, struct pollfd *pfd, int events)
{
struct sun_hdl *hdl = (struct sun_hdl *)sh;