summaryrefslogtreecommitdiff
path: root/usr.bin/aucat
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2010-04-24 06:18:24 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2010-04-24 06:18:24 +0000
commit51451a503aa2b481281695bc3f4757faa38fbec7 (patch)
treee2d2c45112f204b6027547d5ffd6862acdfe7854 /usr.bin/aucat
parent61ee259a61c1a8c3a4c1190dac382d8dc2e10cea (diff)
rename ibuflist/obuflist -> ins/outs to cut long lines
from Thomas Pfaff, thanks
Diffstat (limited to 'usr.bin/aucat')
-rw-r--r--usr.bin/aucat/aproc.c116
-rw-r--r--usr.bin/aucat/aproc.h6
-rw-r--r--usr.bin/aucat/aucat.c6
-rw-r--r--usr.bin/aucat/dev.c40
-rw-r--r--usr.bin/aucat/midi.c16
-rw-r--r--usr.bin/aucat/sock.c26
-rw-r--r--usr.bin/aucat/wav.c18
7 files changed, 114 insertions, 114 deletions
diff --git a/usr.bin/aucat/aproc.c b/usr.bin/aucat/aproc.c
index a39d62a426c..74b9be95dc3 100644
--- a/usr.bin/aucat/aproc.c
+++ b/usr.bin/aucat/aproc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aproc.c,v 1.53 2010/04/21 06:13:07 ratchov Exp $ */
+/* $OpenBSD: aproc.c,v 1.54 2010/04/24 06:18:23 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -159,8 +159,8 @@ aproc_new(struct aproc_ops *ops, char *name)
p = malloc(sizeof(struct aproc));
if (p == NULL)
err(1, name);
- LIST_INIT(&p->ibuflist);
- LIST_INIT(&p->obuflist);
+ LIST_INIT(&p->ins);
+ LIST_INIT(&p->outs);
p->name = name;
p->ops = ops;
p->refs = 0;
@@ -189,12 +189,12 @@ aproc_del(struct aproc *p)
#endif
p->ops->done(p);
}
- while (!LIST_EMPTY(&p->ibuflist)) {
- i = LIST_FIRST(&p->ibuflist);
+ while (!LIST_EMPTY(&p->ins)) {
+ i = LIST_FIRST(&p->ins);
abuf_hup(i);
}
- while (!LIST_EMPTY(&p->obuflist)) {
- i = LIST_FIRST(&p->obuflist);
+ while (!LIST_EMPTY(&p->outs)) {
+ i = LIST_FIRST(&p->outs);
abuf_eof(i);
}
p->flags |= APROC_ZOMB;
@@ -221,7 +221,7 @@ aproc_del(struct aproc *p)
void
aproc_setin(struct aproc *p, struct abuf *ibuf)
{
- LIST_INSERT_HEAD(&p->ibuflist, ibuf, ient);
+ LIST_INSERT_HEAD(&p->ins, ibuf, ient);
ibuf->rproc = p;
if (p->ops->newin)
p->ops->newin(p, ibuf);
@@ -230,7 +230,7 @@ aproc_setin(struct aproc *p, struct abuf *ibuf)
void
aproc_setout(struct aproc *p, struct abuf *obuf)
{
- LIST_INSERT_HEAD(&p->obuflist, obuf, oent);
+ LIST_INSERT_HEAD(&p->outs, obuf, oent);
obuf->wproc = p;
if (p->ops->newout)
p->ops->newout(p, obuf);
@@ -241,7 +241,7 @@ aproc_ipos(struct aproc *p, struct abuf *ibuf, int delta)
{
struct abuf *obuf;
- LIST_FOREACH(obuf, &p->obuflist, oent) {
+ LIST_FOREACH(obuf, &p->outs, oent) {
abuf_ipos(obuf, delta);
}
}
@@ -251,7 +251,7 @@ aproc_opos(struct aproc *p, struct abuf *obuf, int delta)
{
struct abuf *ibuf;
- LIST_FOREACH(ibuf, &p->ibuflist, ient) {
+ LIST_FOREACH(ibuf, &p->ins, ient) {
abuf_opos(ibuf, delta);
}
}
@@ -261,11 +261,11 @@ aproc_inuse(struct aproc *p)
{
struct abuf *i;
- LIST_FOREACH(i, &p->ibuflist, ient) {
+ LIST_FOREACH(i, &p->ins, ient) {
if (i->inuse)
return 1;
}
- LIST_FOREACH(i, &p->obuflist, oent) {
+ LIST_FOREACH(i, &p->outs, oent) {
if (i->inuse)
return 1;
}
@@ -279,7 +279,7 @@ aproc_depend(struct aproc *p, struct aproc *dep)
if (p == dep)
return 1;
- LIST_FOREACH(i, &p->ibuflist, ient) {
+ LIST_FOREACH(i, &p->ins, ient) {
if (i->wproc && aproc_depend(i->wproc, dep))
return 1;
}
@@ -289,7 +289,7 @@ aproc_depend(struct aproc *p, struct aproc *dep)
int
rfile_do(struct aproc *p, unsigned todo, unsigned *done)
{
- struct abuf *obuf = LIST_FIRST(&p->obuflist);
+ struct abuf *obuf = LIST_FIRST(&p->outs);
struct file *f = p->u.io.file;
unsigned char *data;
unsigned n, count, off;
@@ -314,7 +314,7 @@ rfile_do(struct aproc *p, unsigned todo, unsigned *done)
int
rfile_in(struct aproc *p, struct abuf *ibuf_dummy)
{
- struct abuf *obuf = LIST_FIRST(&p->obuflist);
+ struct abuf *obuf = LIST_FIRST(&p->outs);
struct file *f = p->u.io.file;
if (!ABUF_WOK(obuf) || !(f->state & FILE_ROK))
@@ -358,7 +358,7 @@ rfile_done(struct aproc *p)
* all buffers must be detached before deleting f->wproc,
* because otherwise it could trigger this code again
*/
- obuf = LIST_FIRST(&p->obuflist);
+ obuf = LIST_FIRST(&p->outs);
if (obuf)
abuf_eof(obuf);
if (f->wproc) {
@@ -431,7 +431,7 @@ wfile_done(struct aproc *p)
* all buffers must be detached before deleting f->rproc,
* because otherwise it could trigger this code again
*/
- ibuf = LIST_FIRST(&p->ibuflist);
+ ibuf = LIST_FIRST(&p->ins);
if (ibuf)
abuf_hup(ibuf);
if (f->rproc) {
@@ -451,7 +451,7 @@ wfile_done(struct aproc *p)
int
wfile_do(struct aproc *p, unsigned todo, unsigned *done)
{
- struct abuf *ibuf = LIST_FIRST(&p->ibuflist);
+ struct abuf *ibuf = LIST_FIRST(&p->ins);
struct file *f = p->u.io.file;
unsigned char *data;
unsigned n, count, off;
@@ -489,7 +489,7 @@ wfile_in(struct aproc *p, struct abuf *ibuf)
int
wfile_out(struct aproc *p, struct abuf *obuf_dummy)
{
- struct abuf *ibuf = LIST_FIRST(&p->ibuflist);
+ struct abuf *ibuf = LIST_FIRST(&p->ins);
struct file *f = p->u.io.file;
if (!abuf_fill(ibuf))
@@ -694,7 +694,7 @@ mix_badd(struct abuf *ibuf, struct abuf *obuf)
int
mix_xrun(struct aproc *p, struct abuf *i)
{
- struct abuf *obuf = LIST_FIRST(&p->obuflist);
+ struct abuf *obuf = LIST_FIRST(&p->outs);
unsigned fdrop, remain;
if (i->r.mix.done > 0)
@@ -749,7 +749,7 @@ mix_xrun(struct aproc *p, struct abuf *i)
int
mix_in(struct aproc *p, struct abuf *ibuf)
{
- struct abuf *i, *inext, *obuf = LIST_FIRST(&p->obuflist);
+ struct abuf *i, *inext, *obuf = LIST_FIRST(&p->outs);
unsigned odone;
unsigned maxwrite;
unsigned scount;
@@ -773,7 +773,7 @@ mix_in(struct aproc *p, struct abuf *ibuf)
mix_bzero(obuf);
scount = 0;
odone = obuf->w.mix.todo;
- for (i = LIST_FIRST(&p->ibuflist); i != NULL; i = inext) {
+ for (i = LIST_FIRST(&p->ins); i != NULL; i = inext) {
inext = LIST_NEXT(i, ient);
if (i->r.mix.drop >= 0 && !abuf_fill(i))
continue; /* eof */
@@ -782,7 +782,7 @@ mix_in(struct aproc *p, struct abuf *ibuf)
if (odone > i->r.mix.done)
odone = i->r.mix.done;
}
- if (LIST_EMPTY(&p->ibuflist) || scount == 0)
+ if (LIST_EMPTY(&p->ins) || scount == 0)
return 0;
#ifdef DEBUG
if (debug_level >= 4) {
@@ -802,7 +802,7 @@ mix_in(struct aproc *p, struct abuf *ibuf)
odone = maxwrite;
p->u.mix.lat += odone;
p->u.mix.abspos += odone;
- LIST_FOREACH(i, &p->ibuflist, ient) {
+ LIST_FOREACH(i, &p->ins, ient) {
i->r.mix.done -= odone;
}
abuf_wcommit(obuf, odone);
@@ -855,7 +855,7 @@ mix_out(struct aproc *p, struct abuf *obuf)
mix_bzero(obuf);
scount = 0;
odone = obuf->len;
- for (i = LIST_FIRST(&p->ibuflist); i != NULL; i = inext) {
+ for (i = LIST_FIRST(&p->ins); i != NULL; i = inext) {
inext = LIST_NEXT(i, ient);
if (i->r.mix.drop >= 0 && !abuf_fill(i))
continue; /* eof */
@@ -870,7 +870,7 @@ mix_out(struct aproc *p, struct abuf *obuf)
if (odone > i->r.mix.done)
odone = i->r.mix.done;
}
- if (LIST_EMPTY(&p->ibuflist)) {
+ if (LIST_EMPTY(&p->ins)) {
if (p->flags & APROC_QUIT) {
aproc_del(p);
return 0;
@@ -885,7 +885,7 @@ mix_out(struct aproc *p, struct abuf *obuf)
odone = maxwrite;
p->u.mix.lat += odone;
p->u.mix.abspos += odone;
- LIST_FOREACH(i, &p->ibuflist, ient) {
+ LIST_FOREACH(i, &p->ins, ient) {
i->r.mix.done -= odone;
}
abuf_wcommit(obuf, odone);
@@ -901,7 +901,7 @@ mix_out(struct aproc *p, struct abuf *obuf)
void
mix_eof(struct aproc *p, struct abuf *ibuf)
{
- struct abuf *i, *inext, *obuf = LIST_FIRST(&p->obuflist);
+ struct abuf *i, *inext, *obuf = LIST_FIRST(&p->outs);
unsigned odone;
mix_setmaster(p);
@@ -917,7 +917,7 @@ mix_eof(struct aproc *p, struct abuf *ibuf)
* Find a blocked input.
*/
odone = obuf->len;
- for (i = LIST_FIRST(&p->ibuflist); i != NULL; i = inext) {
+ for (i = LIST_FIRST(&p->ins); i != NULL; i = inext) {
inext = LIST_NEXT(i, ient);
if (!abuf_fill(i))
continue;
@@ -931,7 +931,7 @@ mix_eof(struct aproc *p, struct abuf *ibuf)
/*
* No blocked inputs. Check if output is blocked.
*/
- if (LIST_EMPTY(&p->ibuflist) || odone == obuf->w.mix.todo)
+ if (LIST_EMPTY(&p->ins) || odone == obuf->w.mix.todo)
abuf_run(obuf);
}
}
@@ -1034,7 +1034,7 @@ mix_setmaster(struct aproc *p)
* share their volume
*/
n = 0;
- LIST_FOREACH(i, &p->ibuflist, ient) {
+ LIST_FOREACH(i, &p->ins, ient) {
j = LIST_NEXT(i, ient);
for (;;) {
if (j == NULL) {
@@ -1046,7 +1046,7 @@ mix_setmaster(struct aproc *p)
j = LIST_NEXT(j, ient);
}
}
- LIST_FOREACH(i, &p->ibuflist, ient) {
+ LIST_FOREACH(i, &p->ins, ient) {
weight = ADATA_UNIT / n;
if (weight > i->r.mix.maxweight)
weight = i->r.mix.maxweight;
@@ -1067,7 +1067,7 @@ mix_setmaster(struct aproc *p)
void
mix_clear(struct aproc *p)
{
- struct abuf *obuf = LIST_FIRST(&p->obuflist);
+ struct abuf *obuf = LIST_FIRST(&p->outs);
p->u.mix.lat = 0;
p->u.mix.abspos = 0;
@@ -1077,7 +1077,7 @@ mix_clear(struct aproc *p)
void
mix_prime(struct aproc *p)
{
- struct abuf *obuf = LIST_FIRST(&p->obuflist);
+ struct abuf *obuf = LIST_FIRST(&p->outs);
unsigned todo, count;
for (;;) {
@@ -1216,7 +1216,7 @@ sub_bcopy(struct abuf *ibuf, struct abuf *obuf)
int
sub_xrun(struct aproc *p, struct abuf *i)
{
- struct abuf *ibuf = LIST_FIRST(&p->ibuflist);
+ struct abuf *ibuf = LIST_FIRST(&p->ins);
unsigned fdrop, remain;
if (i->w.sub.done > 0)
@@ -1278,7 +1278,7 @@ sub_in(struct aproc *p, struct abuf *ibuf)
if (!ABUF_ROK(ibuf))
return 0;
idone = ibuf->len;
- for (i = LIST_FIRST(&p->obuflist); i != NULL; i = inext) {
+ for (i = LIST_FIRST(&p->outs); i != NULL; i = inext) {
inext = LIST_NEXT(i, oent);
sub_silence(i, 0);
if (!SUB_WOK(i)) {
@@ -1293,7 +1293,7 @@ sub_in(struct aproc *p, struct abuf *ibuf)
if (!abuf_flush(i))
continue;
}
- if (LIST_EMPTY(&p->obuflist)) {
+ if (LIST_EMPTY(&p->outs)) {
if (p->flags & APROC_QUIT) {
aproc_del(p);
return 0;
@@ -1305,7 +1305,7 @@ sub_in(struct aproc *p, struct abuf *ibuf)
}
if (idone == 0)
return 0;
- LIST_FOREACH(i, &p->obuflist, oent) {
+ LIST_FOREACH(i, &p->outs, oent) {
i->w.sub.done -= idone;
}
abuf_rdiscard(ibuf, idone);
@@ -1318,7 +1318,7 @@ sub_in(struct aproc *p, struct abuf *ibuf)
int
sub_out(struct aproc *p, struct abuf *obuf)
{
- struct abuf *ibuf = LIST_FIRST(&p->ibuflist);
+ struct abuf *ibuf = LIST_FIRST(&p->ins);
struct abuf *i, *inext;
unsigned idone;
@@ -1327,7 +1327,7 @@ sub_out(struct aproc *p, struct abuf *obuf)
if (!abuf_fill(ibuf))
return 0; /* eof */
idone = ibuf->len;
- for (i = LIST_FIRST(&p->obuflist); i != NULL; i = inext) {
+ for (i = LIST_FIRST(&p->outs); i != NULL; i = inext) {
inext = LIST_NEXT(i, oent);
sub_silence(i, 0);
sub_bcopy(ibuf, i);
@@ -1336,9 +1336,9 @@ sub_out(struct aproc *p, struct abuf *obuf)
if (!abuf_flush(i))
continue;
}
- if (LIST_EMPTY(&p->obuflist) || idone == 0)
+ if (LIST_EMPTY(&p->outs) || idone == 0)
return 0;
- LIST_FOREACH(i, &p->obuflist, oent) {
+ LIST_FOREACH(i, &p->outs, oent) {
i->w.sub.done -= idone;
}
abuf_rdiscard(ibuf, idone);
@@ -1357,7 +1357,7 @@ sub_eof(struct aproc *p, struct abuf *ibuf)
void
sub_hup(struct aproc *p, struct abuf *obuf)
{
- struct abuf *i, *inext, *ibuf = LIST_FIRST(&p->ibuflist);
+ struct abuf *i, *inext, *ibuf = LIST_FIRST(&p->ins);
unsigned idone;
if (!aproc_inuse(p)) {
@@ -1371,7 +1371,7 @@ sub_hup(struct aproc *p, struct abuf *obuf)
* Find a blocked output.
*/
idone = ibuf->len;
- for (i = LIST_FIRST(&p->obuflist); i != NULL; i = inext) {
+ for (i = LIST_FIRST(&p->outs); i != NULL; i = inext) {
inext = LIST_NEXT(i, oent);
if (!abuf_flush(i))
continue;
@@ -1385,7 +1385,7 @@ sub_hup(struct aproc *p, struct abuf *obuf)
/*
* No blocked outputs. Check if input is blocked.
*/
- if (LIST_EMPTY(&p->obuflist) || idone == ibuf->used)
+ if (LIST_EMPTY(&p->outs) || idone == ibuf->used)
abuf_run(ibuf);
}
}
@@ -1562,7 +1562,7 @@ resamp_bcopy(struct aproc *p, struct abuf *ibuf, struct abuf *obuf)
int
resamp_in(struct aproc *p, struct abuf *ibuf)
{
- struct abuf *obuf = LIST_FIRST(&p->obuflist);
+ struct abuf *obuf = LIST_FIRST(&p->outs);
if (!ABUF_WOK(obuf) || !ABUF_ROK(ibuf))
return 0;
@@ -1575,7 +1575,7 @@ resamp_in(struct aproc *p, struct abuf *ibuf)
int
resamp_out(struct aproc *p, struct abuf *obuf)
{
- struct abuf *ibuf = LIST_FIRST(&p->ibuflist);
+ struct abuf *ibuf = LIST_FIRST(&p->ins);
if (!abuf_fill(ibuf))
return 0;
@@ -1600,7 +1600,7 @@ resamp_hup(struct aproc *p, struct abuf *obuf)
void
resamp_ipos(struct aproc *p, struct abuf *ibuf, int delta)
{
- struct abuf *obuf = LIST_FIRST(&p->obuflist);
+ struct abuf *obuf = LIST_FIRST(&p->outs);
long long ipos;
ipos = (long long)delta * p->u.resamp.oblksz + p->u.resamp.idelta;
@@ -1611,7 +1611,7 @@ resamp_ipos(struct aproc *p, struct abuf *ibuf, int delta)
void
resamp_opos(struct aproc *p, struct abuf *obuf, int delta)
{
- struct abuf *ibuf = LIST_FIRST(&p->ibuflist);
+ struct abuf *ibuf = LIST_FIRST(&p->ins);
long long opos;
opos = (long long)delta * p->u.resamp.iblksz + p->u.resamp.odelta;
@@ -1737,7 +1737,7 @@ enc_bcopy(struct aproc *p, struct abuf *ibuf, struct abuf *obuf)
int
enc_in(struct aproc *p, struct abuf *ibuf)
{
- struct abuf *obuf = LIST_FIRST(&p->obuflist);
+ struct abuf *obuf = LIST_FIRST(&p->outs);
if (!ABUF_WOK(obuf) || !ABUF_ROK(ibuf))
return 0;
@@ -1750,7 +1750,7 @@ enc_in(struct aproc *p, struct abuf *ibuf)
int
enc_out(struct aproc *p, struct abuf *obuf)
{
- struct abuf *ibuf = LIST_FIRST(&p->ibuflist);
+ struct abuf *ibuf = LIST_FIRST(&p->ins);
if (!abuf_fill(ibuf))
return 0;
@@ -1895,7 +1895,7 @@ dec_bcopy(struct aproc *p, struct abuf *ibuf, struct abuf *obuf)
int
dec_in(struct aproc *p, struct abuf *ibuf)
{
- struct abuf *obuf = LIST_FIRST(&p->obuflist);
+ struct abuf *obuf = LIST_FIRST(&p->outs);
if (!ABUF_WOK(obuf) || !ABUF_ROK(ibuf))
return 0;
@@ -1908,7 +1908,7 @@ dec_in(struct aproc *p, struct abuf *ibuf)
int
dec_out(struct aproc *p, struct abuf *obuf)
{
- struct abuf *ibuf = LIST_FIRST(&p->ibuflist);
+ struct abuf *ibuf = LIST_FIRST(&p->ins);
if (!abuf_fill(ibuf))
return 0;
@@ -2058,7 +2058,7 @@ join_bcopy(struct aproc *p, struct abuf *ibuf, struct abuf *obuf)
int
join_in(struct aproc *p, struct abuf *ibuf)
{
- struct abuf *obuf = LIST_FIRST(&p->obuflist);
+ struct abuf *obuf = LIST_FIRST(&p->outs);
if (!ABUF_WOK(obuf) || !ABUF_ROK(ibuf))
return 0;
@@ -2071,7 +2071,7 @@ join_in(struct aproc *p, struct abuf *ibuf)
int
join_out(struct aproc *p, struct abuf *obuf)
{
- struct abuf *ibuf = LIST_FIRST(&p->ibuflist);
+ struct abuf *ibuf = LIST_FIRST(&p->ins);
if (!abuf_fill(ibuf))
return 0;
@@ -2127,7 +2127,7 @@ join_new(char *name)
void
mon_flush(struct aproc *p)
{
- struct abuf *obuf = LIST_FIRST(&p->obuflist);
+ struct abuf *obuf = LIST_FIRST(&p->outs);
unsigned count;
#ifdef DEBUG
@@ -2159,7 +2159,7 @@ mon_flush(struct aproc *p)
void
mon_snoop(struct aproc *p, struct abuf *ibuf, unsigned pos, unsigned todo)
{
- struct abuf *obuf = LIST_FIRST(&p->obuflist);
+ struct abuf *obuf = LIST_FIRST(&p->outs);
unsigned scount, icount, ocount;
short *idata, *odata;
diff --git a/usr.bin/aucat/aproc.h b/usr.bin/aucat/aproc.h
index 2ee7532ac73..343743b55d5 100644
--- a/usr.bin/aucat/aproc.h
+++ b/usr.bin/aucat/aproc.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: aproc.h,v 1.34 2010/04/21 06:13:07 ratchov Exp $ */
+/* $OpenBSD: aproc.h,v 1.35 2010/04/24 06:18:23 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -120,8 +120,8 @@ struct aproc_ops {
struct aproc {
char *name; /* for debug purposes */
struct aproc_ops *ops; /* call-backs */
- LIST_HEAD(, abuf) ibuflist; /* list of inputs */
- LIST_HEAD(, abuf) obuflist; /* list of outputs */
+ LIST_HEAD(, abuf) ins; /* list of inputs */
+ LIST_HEAD(, abuf) outs; /* list of outputs */
unsigned refs; /* extern references */
#define APROC_ZOMB 1 /* destroyed but not freed */
#define APROC_QUIT 2 /* try to terminate if unused */
diff --git a/usr.bin/aucat/aucat.c b/usr.bin/aucat/aucat.c
index 89504bf5601..98c193ab82e 100644
--- a/usr.bin/aucat/aucat.c
+++ b/usr.bin/aucat/aucat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aucat.c,v 1.86 2010/04/22 17:43:30 ratchov Exp $ */
+/* $OpenBSD: aucat.c,v 1.87 2010/04/24 06:18:23 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -707,8 +707,8 @@ aucat_main(int argc, char **argv)
if (quit_flag) {
break;
}
- if ((APROC_OK(dev_mix) && LIST_EMPTY(&dev_mix->obuflist)) ||
- (APROC_OK(dev_sub) && LIST_EMPTY(&dev_sub->ibuflist))) {
+ if ((APROC_OK(dev_mix) && LIST_EMPTY(&dev_mix->outs)) ||
+ (APROC_OK(dev_sub) && LIST_EMPTY(&dev_sub->ins))) {
fprintf(stderr, "device disappeared, terminating\n");
break;
}
diff --git a/usr.bin/aucat/dev.c b/usr.bin/aucat/dev.c
index b37ee21cb86..c155720e5ca 100644
--- a/usr.bin/aucat/dev.c
+++ b/usr.bin/aucat/dev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dev.c,v 1.48 2010/04/21 06:13:07 ratchov Exp $ */
+/* $OpenBSD: dev.c,v 1.49 2010/04/24 06:18:23 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -365,7 +365,7 @@ dev_done(void)
}
if (dev_midi) {
dev_midi->flags |= APROC_QUIT;
- if (LIST_EMPTY(&dev_midi->ibuflist))
+ if (LIST_EMPTY(&dev_midi->ins))
aproc_del(dev_midi);
restart_midi:
LIST_FOREACH(f, &file_list, entry) {
@@ -496,7 +496,7 @@ dev_getep(unsigned mode, struct abuf **sibuf, struct abuf **sobuf)
}
if (ibuf->rproc == dev_mix)
break;
- ibuf = LIST_FIRST(&ibuf->rproc->obuflist);
+ ibuf = LIST_FIRST(&ibuf->rproc->outs);
}
*sibuf = ibuf;
}
@@ -516,7 +516,7 @@ dev_getep(unsigned mode, struct abuf **sibuf, struct abuf **sobuf)
}
if (obuf->wproc == dev_sub)
break;
- obuf = LIST_FIRST(&obuf->wproc->ibuflist);
+ obuf = LIST_FIRST(&obuf->wproc->ins);
}
*sobuf = obuf;
}
@@ -536,7 +536,7 @@ dev_getep(unsigned mode, struct abuf **sibuf, struct abuf **sobuf)
}
if (obuf->wproc == dev_submon)
break;
- obuf = LIST_FIRST(&obuf->wproc->ibuflist);
+ obuf = LIST_FIRST(&obuf->wproc->ins);
}
*sobuf = obuf;
}
@@ -612,13 +612,13 @@ dev_getpos(void)
int delta;
if (APROC_OK(dev_mix)) {
- pbuf = LIST_FIRST(&dev_mix->obuflist);
+ pbuf = LIST_FIRST(&dev_mix->outs);
if (!pbuf)
return 0;
plat = -dev_mix->u.mix.lat;
}
if (APROC_OK(dev_sub)) {
- rbuf = LIST_FIRST(&dev_sub->ibuflist);
+ rbuf = LIST_FIRST(&dev_sub->ins);
if (!rbuf)
return 0;
rlat = -dev_sub->u.sub.lat;
@@ -670,7 +670,7 @@ dev_attach(char *name, unsigned mode,
if (mode & MODE_PLAY) {
ipar = *sipar;
- pbuf = LIST_FIRST(&dev_mix->obuflist);
+ pbuf = LIST_FIRST(&dev_mix->outs);
nblk = (dev_bufsz / dev_round + 3) / 4;
round = dev_roundof(ipar.rate);
nch = ipar.cmax - ipar.cmin + 1;
@@ -714,7 +714,7 @@ dev_attach(char *name, unsigned mode,
}
if (mode & MODE_REC) {
opar = *sopar;
- rbuf = LIST_FIRST(&dev_sub->ibuflist);
+ rbuf = LIST_FIRST(&dev_sub->ins);
round = dev_roundof(opar.rate);
nblk = (dev_bufsz / dev_round + 3) / 4;
nch = opar.cmax - opar.cmin + 1;
@@ -756,7 +756,7 @@ dev_attach(char *name, unsigned mode,
}
if (mode & MODE_MON) {
opar = *sopar;
- rbuf = LIST_FIRST(&dev_submon->ibuflist);
+ rbuf = LIST_FIRST(&dev_submon->ins);
round = dev_roundof(opar.rate);
nblk = (dev_bufsz / dev_round + 3) / 4;
nch = opar.cmax - opar.cmin + 1;
@@ -844,44 +844,44 @@ dev_clear(void)
if (APROC_OK(dev_mix)) {
#ifdef DEBUG
- if (!LIST_EMPTY(&dev_mix->ibuflist)) {
+ if (!LIST_EMPTY(&dev_mix->ins)) {
dbg_puts("play end not idle, can't clear device\n");
dbg_panic();
}
#endif
- buf = LIST_FIRST(&dev_mix->obuflist);
+ buf = LIST_FIRST(&dev_mix->outs);
while (buf) {
abuf_clear(buf);
- buf = LIST_FIRST(&buf->rproc->obuflist);
+ buf = LIST_FIRST(&buf->rproc->outs);
}
mix_clear(dev_mix);
}
if (APROC_OK(dev_sub)) {
#ifdef DEBUG
- if (!LIST_EMPTY(&dev_sub->obuflist)) {
+ if (!LIST_EMPTY(&dev_sub->outs)) {
dbg_puts("record end not idle, can't clear device\n");
dbg_panic();
}
#endif
- buf = LIST_FIRST(&dev_sub->ibuflist);
+ buf = LIST_FIRST(&dev_sub->ins);
while (buf) {
abuf_clear(buf);
- buf = LIST_FIRST(&buf->wproc->ibuflist);
+ buf = LIST_FIRST(&buf->wproc->ins);
}
sub_clear(dev_sub);
}
if (APROC_OK(dev_submon)) {
#ifdef DEBUG
dbg_puts("clearing monitor\n");
- if (!LIST_EMPTY(&dev_submon->obuflist)) {
+ if (!LIST_EMPTY(&dev_submon->outs)) {
dbg_puts("monitoring end not idle, can't clear device\n");
dbg_panic();
}
#endif
- buf = LIST_FIRST(&dev_submon->ibuflist);
+ buf = LIST_FIRST(&dev_submon->ins);
while (buf) {
abuf_clear(buf);
- buf = LIST_FIRST(&buf->wproc->ibuflist);
+ buf = LIST_FIRST(&buf->wproc->ins);
}
sub_clear(dev_submon);
mon_clear(dev_mon);
@@ -897,7 +897,7 @@ dev_prime(void)
{
if (APROC_OK(dev_mix)) {
#ifdef DEBUG
- if (!LIST_EMPTY(&dev_mix->ibuflist)) {
+ if (!LIST_EMPTY(&dev_mix->ins)) {
dbg_puts("play end not idle, can't prime device\n");
dbg_panic();
}
diff --git a/usr.bin/aucat/midi.c b/usr.bin/aucat/midi.c
index 191be1b17be..ccd99e92ede 100644
--- a/usr.bin/aucat/midi.c
+++ b/usr.bin/aucat/midi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: midi.c,v 1.19 2010/04/06 20:07:01 ratchov Exp $ */
+/* $OpenBSD: midi.c,v 1.20 2010/04/24 06:18:23 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -249,7 +249,7 @@ thru_in(struct aproc *p, struct abuf *ibuf)
if (todo > ibuf->tickets)
todo = ibuf->tickets;
ibuf->tickets -= todo;
- for (i = LIST_FIRST(&p->obuflist); i != NULL; i = inext) {
+ for (i = LIST_FIRST(&p->outs); i != NULL; i = inext) {
inext = LIST_NEXT(i, oent);
if (ibuf->duplex == i)
continue;
@@ -271,7 +271,7 @@ thru_eof(struct aproc *p, struct abuf *ibuf)
{
if (!(p->flags & APROC_QUIT))
return;
- if (LIST_EMPTY(&p->ibuflist))
+ if (LIST_EMPTY(&p->ins))
aproc_del(p);
}
@@ -323,7 +323,7 @@ thru_cb(void *addr)
timo_add(&p->u.thru.timo, MIDITHRU_TIMO);
- for (i = LIST_FIRST(&p->ibuflist); i != NULL; i = inext) {
+ for (i = LIST_FIRST(&p->ins); i != NULL; i = inext) {
inext = LIST_NEXT(i, ient);
tickets = i->tickets;
i->tickets = MIDITHRU_XFER;
@@ -391,7 +391,7 @@ ctl_sendmsg(struct aproc *p, struct abuf *ibuf, unsigned char *msg, unsigned len
unsigned char *odata, *idata;
struct abuf *i, *inext;
- for (i = LIST_FIRST(&p->obuflist); i != NULL; i = inext) {
+ for (i = LIST_FIRST(&p->outs); i != NULL; i = inext) {
inext = LIST_NEXT(i, oent);
if (i->duplex && i->duplex == ibuf)
continue;
@@ -751,7 +751,7 @@ ctl_slotdel(struct aproc *p, int index)
if (s->ops)
return;
}
- if (!LIST_EMPTY(&p->obuflist) || !LIST_EMPTY(&p->ibuflist))
+ if (!LIST_EMPTY(&p->outs) || !LIST_EMPTY(&p->ins))
aproc_del(p);
}
@@ -1123,7 +1123,7 @@ ctl_eof(struct aproc *p, struct abuf *ibuf)
if (s->ops)
return;
}
- if (!LIST_EMPTY(&p->obuflist) || !LIST_EMPTY(&p->ibuflist))
+ if (!LIST_EMPTY(&p->outs) || !LIST_EMPTY(&p->ins))
aproc_del(p);
}
@@ -1139,7 +1139,7 @@ ctl_hup(struct aproc *p, struct abuf *obuf)
if (s->ops)
return;
}
- if (!LIST_EMPTY(&p->obuflist) || !LIST_EMPTY(&p->ibuflist))
+ if (!LIST_EMPTY(&p->outs) || !LIST_EMPTY(&p->ins))
aproc_del(p);
}
diff --git a/usr.bin/aucat/sock.c b/usr.bin/aucat/sock.c
index 18f2f8f366f..751bf6cb4f0 100644
--- a/usr.bin/aucat/sock.c
+++ b/usr.bin/aucat/sock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sock.c,v 1.44 2010/04/22 17:43:30 ratchov Exp $ */
+/* $OpenBSD: sock.c,v 1.45 2010/04/24 06:18:23 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -123,7 +123,7 @@ rsock_in(struct aproc *p, struct abuf *ibuf_dummy)
if (!sock_read(f))
return 0;
- obuf = LIST_FIRST(&p->obuflist);
+ obuf = LIST_FIRST(&p->outs);
if (obuf && f->pstate >= SOCK_RUN) {
if (!abuf_flush(obuf))
return 0;
@@ -240,7 +240,7 @@ wsock_in(struct aproc *p, struct abuf *ibuf)
int
wsock_out(struct aproc *p, struct abuf *obuf_dummy)
{
- struct abuf *ibuf = LIST_FIRST(&p->ibuflist);
+ struct abuf *ibuf = LIST_FIRST(&p->ins);
struct sock *f = (struct sock *)p->u.io.file;
if (ibuf) {
@@ -384,8 +384,8 @@ sock_freebuf(struct sock *f)
dbg_puts(": freeing buffers\n");
}
#endif
- wbuf = LIST_FIRST(&f->pipe.file.wproc->ibuflist);
- rbuf = LIST_FIRST(&f->pipe.file.rproc->obuflist);
+ wbuf = LIST_FIRST(&f->pipe.file.wproc->ins);
+ rbuf = LIST_FIRST(&f->pipe.file.rproc->outs);
if (rbuf || wbuf)
ctl_slotstop(dev_midi, f->slot);
if (rbuf)
@@ -450,7 +450,7 @@ sock_setvol(void *arg, unsigned vol)
struct abuf *rbuf;
f->vol = vol;
- rbuf = LIST_FIRST(&f->pipe.file.rproc->obuflist);
+ rbuf = LIST_FIRST(&f->pipe.file.rproc->outs);
if (!rbuf) {
#ifdef DEBUG
if (debug_level >= 3) {
@@ -521,8 +521,8 @@ sock_attach(struct sock *f, int force)
{
struct abuf *rbuf, *wbuf;
- rbuf = LIST_FIRST(&f->pipe.file.rproc->obuflist);
- wbuf = LIST_FIRST(&f->pipe.file.wproc->ibuflist);
+ rbuf = LIST_FIRST(&f->pipe.file.rproc->outs);
+ wbuf = LIST_FIRST(&f->pipe.file.wproc->ins);
/*
* If in SOCK_START state, dont attach until
@@ -686,7 +686,7 @@ sock_rdata(struct sock *f)
}
#endif
p = f->pipe.file.rproc;
- obuf = LIST_FIRST(&p->obuflist);
+ obuf = LIST_FIRST(&p->outs);
if (obuf == NULL)
return 0;
if (!ABUF_WOK(obuf) || !(f->pipe.file.state & FILE_ROK))
@@ -727,7 +727,7 @@ sock_wdata(struct sock *f)
if (!(f->pipe.file.state & FILE_WOK))
return 0;
p = f->pipe.file.wproc;
- ibuf = LIST_FIRST(&p->ibuflist);
+ ibuf = LIST_FIRST(&p->ins);
#ifdef DEBUG
if (f->pstate != SOCK_MIDI && ibuf == NULL) {
sock_dbg(f);
@@ -1130,7 +1130,7 @@ sock_execmsg(struct sock *f)
aproc_del(f->pipe.file.rproc);
return 0;
}
- obuf = LIST_FIRST(&f->pipe.file.rproc->obuflist);
+ obuf = LIST_FIRST(&f->pipe.file.rproc->outs);
if (f->pstate == SOCK_START && !ABUF_WOK(obuf)) {
#ifdef DEBUG
if (debug_level >= 1) {
@@ -1511,7 +1511,7 @@ sock_buildmsg(struct sock *f)
* If data available, build a DATA message.
*/
p = f->pipe.file.wproc;
- ibuf = LIST_FIRST(&p->ibuflist);
+ ibuf = LIST_FIRST(&p->ins);
if (ibuf && ABUF_ROK(ibuf)) {
#ifdef DEBUG
if (ibuf->used > f->wmax && debug_level >= 3) {
@@ -1673,7 +1673,7 @@ sock_write(struct sock *f)
*/
f->wstate = SOCK_WDATA;
f->wtodo = f->wmsg.u.data.size /
- LIST_FIRST(&f->pipe.file.wproc->ibuflist)->bpf;
+ LIST_FIRST(&f->pipe.file.wproc->ins)->bpf;
/* PASSTHROUGH */
case SOCK_WDATA:
if (!sock_wdata(f))
diff --git a/usr.bin/aucat/wav.c b/usr.bin/aucat/wav.c
index 2583b3bb6c5..afe5cee7ecb 100644
--- a/usr.bin/aucat/wav.c
+++ b/usr.bin/aucat/wav.c
@@ -307,9 +307,9 @@ wav_attach(struct wav *f, int force)
struct abuf *rbuf = NULL, *wbuf = NULL;
if (f->mode & MODE_PLAY)
- rbuf = LIST_FIRST(&f->pipe.file.rproc->obuflist);
+ rbuf = LIST_FIRST(&f->pipe.file.rproc->outs);
if (f->mode & MODE_RECMASK)
- wbuf = LIST_FIRST(&f->pipe.file.wproc->ibuflist);
+ wbuf = LIST_FIRST(&f->pipe.file.wproc->ins);
f->pstate = WAV_RUN;
#ifdef DEBUG
if (debug_level >= 3) {
@@ -374,9 +374,9 @@ wav_freebuf(struct wav *f)
struct abuf *rbuf = NULL, *wbuf = NULL;
if (f->mode & MODE_PLAY)
- rbuf = LIST_FIRST(&f->pipe.file.rproc->obuflist);
+ rbuf = LIST_FIRST(&f->pipe.file.rproc->outs);
if (f->mode & MODE_RECMASK)
- wbuf = LIST_FIRST(&f->pipe.file.wproc->ibuflist);
+ wbuf = LIST_FIRST(&f->pipe.file.wproc->ins);
f->pstate = WAV_INIT;
#ifdef DEBUG
if (debug_level >= 3) {
@@ -472,7 +472,7 @@ wav_rdata(struct wav *f)
struct abuf *obuf;
p = f->pipe.file.rproc;
- obuf = LIST_FIRST(&p->obuflist);
+ obuf = LIST_FIRST(&p->outs);
if (obuf == NULL)
return 0;
if (!ABUF_WOK(obuf) || !(f->pipe.file.state & FILE_ROK))
@@ -519,7 +519,7 @@ wav_wdata(struct wav *f)
if (!(f->pipe.file.state & FILE_WOK))
return 0;
p = f->pipe.file.wproc;
- ibuf = LIST_FIRST(&p->ibuflist);
+ ibuf = LIST_FIRST(&p->ins);
if (ibuf == NULL)
return 0;
if (!ABUF_ROK(ibuf))
@@ -540,7 +540,7 @@ wav_setvol(void *arg, unsigned vol)
f->vol = vol;
if ((f->mode & MODE_PLAY) && f->pstate == WAV_RUN) {
- rbuf = LIST_FIRST(&f->pipe.file.rproc->obuflist);
+ rbuf = LIST_FIRST(&f->pipe.file.rproc->outs);
dev_setvol(rbuf, MIDI_TO_ADATA(vol));
}
}
@@ -775,7 +775,7 @@ rwav_in(struct aproc *p, struct abuf *ibuf_dummy)
if (!wav_rdata(f))
return 0;
- obuf = LIST_FIRST(&p->obuflist);
+ obuf = LIST_FIRST(&p->outs);
if (obuf && f->pstate >= WAV_RUN) {
if (!abuf_flush(obuf))
return 0;
@@ -837,7 +837,7 @@ wwav_in(struct aproc *p, struct abuf *ibuf)
int
wwav_out(struct aproc *p, struct abuf *obuf_dummy)
{
- struct abuf *ibuf = LIST_FIRST(&p->ibuflist);
+ struct abuf *ibuf = LIST_FIRST(&p->ins);
struct wav *f = (struct wav *)p->u.io.file;
if (ibuf && f->pstate == WAV_RUN) {