diff options
author | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2013-11-18 17:37:46 +0000 |
---|---|---|
committer | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2013-11-18 17:37:46 +0000 |
commit | 2af9e0bad6b3f9144caf8713aa3ec8df97d3dcd1 (patch) | |
tree | 0e5a8b881334347a701069968cee73fa39699b49 /usr.bin | |
parent | f22b9aa4bcdd430d10b8b094f5e4dbe3199f7992 (diff) |
add missing prototypes
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/aucat/abuf.c | 8 | ||||
-rw-r--r-- | usr.bin/aucat/aproc.c | 86 | ||||
-rw-r--r-- | usr.bin/aucat/aproc.h | 3 | ||||
-rw-r--r-- | usr.bin/aucat/aucat.c | 15 | ||||
-rw-r--r-- | usr.bin/aucat/dev.c | 7 | ||||
-rw-r--r-- | usr.bin/aucat/file.c | 7 | ||||
-rw-r--r-- | usr.bin/aucat/headers.c | 4 | ||||
-rw-r--r-- | usr.bin/aucat/midi.c | 18 | ||||
-rw-r--r-- | usr.bin/aucat/siofile.c | 3 | ||||
-rw-r--r-- | usr.bin/aucat/wav.c | 30 | ||||
-rw-r--r-- | usr.bin/sndiod/dev.c | 68 | ||||
-rw-r--r-- | usr.bin/sndiod/dsp.h | 3 | ||||
-rw-r--r-- | usr.bin/sndiod/file.c | 7 | ||||
-rw-r--r-- | usr.bin/sndiod/midi.h | 3 | ||||
-rw-r--r-- | usr.bin/sndiod/siofile.c | 4 | ||||
-rw-r--r-- | usr.bin/sndiod/sndiod.c | 18 | ||||
-rw-r--r-- | usr.bin/sndiod/sock.c | 51 |
17 files changed, 285 insertions, 50 deletions
diff --git a/usr.bin/aucat/abuf.c b/usr.bin/aucat/abuf.c index 181b40a9c93..63f7f4b261e 100644 --- a/usr.bin/aucat/abuf.c +++ b/usr.bin/aucat/abuf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: abuf.c,v 1.24 2012/04/11 06:05:43 ratchov Exp $ */ +/* $OpenBSD: abuf.c,v 1.25 2013/11/18 17:37:45 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org> * @@ -45,6 +45,12 @@ #include "dbg.h" #endif +void abuf_dump(struct abuf *); +int abuf_flush_do(struct abuf *); +int abuf_fill_do(struct abuf *); +void abuf_eof_do(struct abuf *); +void abuf_hup_do(struct abuf *); + #ifdef DEBUG void abuf_dbg(struct abuf *buf) diff --git a/usr.bin/aucat/aproc.c b/usr.bin/aucat/aproc.c index 7d0555a4b33..f65ac2d38c1 100644 --- a/usr.bin/aucat/aproc.c +++ b/usr.bin/aucat/aproc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aproc.c,v 1.73 2012/05/23 19:12:44 ratchov Exp $ */ +/* $OpenBSD: aproc.c,v 1.74 2013/11/18 17:37:45 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org> * @@ -60,6 +60,90 @@ */ #define SUB_WOK(buf) (ABUF_WOK(buf) || (buf)->w.sub.silence < 0) +int zomb_in(struct aproc *, struct abuf *); +int zomb_out(struct aproc *, struct abuf *); +void zomb_eof(struct aproc *, struct abuf *); +void zomb_hup(struct aproc *, struct abuf *); +void zomb_newin(struct aproc *, struct abuf *); +void zomb_newout(struct aproc *, struct abuf *); +void zomb_ipos(struct aproc *, struct abuf *, int); +void zomb_opos(struct aproc *, struct abuf *, int); + +int rfile_do(struct aproc *, unsigned int, unsigned int *); +int rfile_in(struct aproc *, struct abuf *); +int rfile_out(struct aproc *, struct abuf *); +void rfile_done(struct aproc *); +void rfile_eof(struct aproc *, struct abuf *); +void rfile_hup(struct aproc *, struct abuf *); + +void wfile_done(struct aproc *); +int wfile_do(struct aproc *, unsigned int, unsigned int *); +int wfile_in(struct aproc *, struct abuf *); +int wfile_out(struct aproc *, struct abuf *); +void wfile_eof(struct aproc *, struct abuf *); +void wfile_hup(struct aproc *, struct abuf *); + +void mix_drop(struct abuf *, int); +void mix_bzero(struct abuf *, unsigned int); +unsigned int mix_badd(struct abuf *, struct abuf *); +int mix_xrun(struct aproc *, struct abuf *); +int mix_in(struct aproc *, struct abuf *); +int mix_out(struct aproc *, struct abuf *); +void mix_eof(struct aproc *, struct abuf *); +void mix_hup(struct aproc *, struct abuf *); +void mix_newin(struct aproc *, struct abuf *); +void mix_newout(struct aproc *, struct abuf *); +void mix_opos(struct aproc *, struct abuf *, int); +void mix_setmaster(struct aproc *); +void mix_clear(struct aproc *); +void mix_quit(struct aproc *); + +void sub_silence(struct abuf *, int); +void sub_bcopy(struct abuf *, struct abuf *); +int sub_xrun(struct aproc *, struct abuf *); +int sub_in(struct aproc *, struct abuf *); +int sub_out(struct aproc *, struct abuf *); +void sub_eof(struct aproc *, struct abuf *); +void sub_hup(struct aproc *, struct abuf *); +void sub_newout(struct aproc *, struct abuf *); +void sub_ipos(struct aproc *, struct abuf *, int); +void sub_clear(struct aproc *); + +void resamp_bcopy(struct aproc *, struct abuf *, struct abuf *); +int resamp_in(struct aproc *, struct abuf *); +int resamp_out(struct aproc *, struct abuf *); +void resamp_eof(struct aproc *, struct abuf *); +void resamp_hup(struct aproc *, struct abuf *); +void resamp_ipos(struct aproc *, struct abuf *, int); +void resamp_opos(struct aproc *, struct abuf *, int); + +void enc_bcopy(struct aproc *, struct abuf *, struct abuf *); +int enc_in(struct aproc *, struct abuf *); +int enc_out(struct aproc *, struct abuf *); +void enc_eof(struct aproc *, struct abuf *); +void enc_hup(struct aproc *, struct abuf *); + +void dec_bcopy(struct aproc *, struct abuf *, struct abuf *); +int dec_in(struct aproc *, struct abuf *); +int dec_out(struct aproc *, struct abuf *); +void dec_eof(struct aproc *, struct abuf *); +void dec_hup(struct aproc *, struct abuf *); + +void join_bcopy(struct aproc *, struct abuf *, struct abuf *); +int join_in(struct aproc *, struct abuf *); +int join_out(struct aproc *, struct abuf *); +void join_eof(struct aproc *, struct abuf *); +void join_hup(struct aproc *, struct abuf *); + +void mon_flush(struct aproc *); +void mon_snoop(struct aproc *, struct abuf *, unsigned int, unsigned int); +int mon_in(struct aproc *, struct abuf *); +void mon_clear(struct aproc *); +int mon_out(struct aproc *, struct abuf *); +void mon_eof(struct aproc *, struct abuf *); +void mon_hup(struct aproc *, struct abuf *); +void mon_ipos(struct aproc *, struct abuf *, int); + #ifdef DEBUG void aproc_dbg(struct aproc *p) diff --git a/usr.bin/aucat/aproc.h b/usr.bin/aucat/aproc.h index a5376fb918a..659d756d896 100644 --- a/usr.bin/aucat/aproc.h +++ b/usr.bin/aucat/aproc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: aproc.h,v 1.44 2012/04/11 06:05:43 ratchov Exp $ */ +/* $OpenBSD: aproc.h,v 1.45 2013/11/18 17:37:45 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org> * @@ -205,6 +205,7 @@ void aproc_del(struct aproc *); void aproc_dbg(struct aproc *); void aproc_setin(struct aproc *, struct abuf *); void aproc_setout(struct aproc *, struct abuf *); +int aproc_inuse(struct aproc *); int aproc_depend(struct aproc *, struct aproc *); void aproc_ipos(struct aproc *, struct abuf *, int); diff --git a/usr.bin/aucat/aucat.c b/usr.bin/aucat/aucat.c index 88be81d6882..dbb2c65eeea 100644 --- a/usr.bin/aucat/aucat.c +++ b/usr.bin/aucat/aucat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aucat.c,v 1.142 2013/11/12 06:47:34 ratchov Exp $ */ +/* $OpenBSD: aucat.c,v 1.143 2013/11/18 17:37:45 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org> * @@ -68,6 +68,19 @@ #define DEFAULT_BUFSZ 7860 #endif +void sigint(int); +void sigusr1(int); +void sigusr2(int); +void opt_ch(struct aparams *); +void opt_enc(struct aparams *); +int opt_hdr(void); +int opt_mmc(void); +int opt_onoff(void); +int opt_xrun(void); +void setsig(void); +void unsetsig(void); +struct dev *mkdev(char *, int, int, int, int, int); + #ifdef DEBUG volatile sig_atomic_t debug_level = 1; #endif diff --git a/usr.bin/aucat/dev.c b/usr.bin/aucat/dev.c index 21351220a65..9751ae865a0 100644 --- a/usr.bin/aucat/dev.c +++ b/usr.bin/aucat/dev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dev.c,v 1.83 2013/11/12 06:47:34 ratchov Exp $ */ +/* $OpenBSD: dev.c,v 1.84 2013/11/18 17:37:45 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org> * @@ -86,6 +86,11 @@ void dev_stop(struct dev *); void dev_clear(struct dev *); void dev_onmove(void *, int); int devctl_open(struct dev *, struct devctl *); +int dev_getep(struct dev *, unsigned int, struct abuf **, struct abuf **); +void dev_sync(struct dev *, unsigned int, struct abuf *, struct abuf *); +int dev_mkslot(struct dev *, char *); +int dev_try(struct dev *, int); + struct dev *dev_list = NULL; unsigned int dev_sndnum = 0, dev_thrnum = 0; diff --git a/usr.bin/aucat/file.c b/usr.bin/aucat/file.c index cb535fc99cd..b2e6a7f1121 100644 --- a/usr.bin/aucat/file.c +++ b/usr.bin/aucat/file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: file.c,v 1.30 2012/04/11 06:05:43 ratchov Exp $ */ +/* $OpenBSD: file.c,v 1.31 2013/11/18 17:37:45 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org> * @@ -69,6 +69,11 @@ #define MAXFDS 100 #define TIMER_USEC 10000 +void timo_update(unsigned int); +void timo_init(void); +void timo_done(void); +void file_sigalrm(int); + struct timespec file_ts; struct filelist file_list; struct timo *timo_queue; diff --git a/usr.bin/aucat/headers.c b/usr.bin/aucat/headers.c index df958dc6648..5a338a87b6b 100644 --- a/usr.bin/aucat/headers.c +++ b/usr.bin/aucat/headers.c @@ -1,4 +1,4 @@ -/* $OpenBSD: headers.c,v 1.22 2012/04/11 06:05:43 ratchov Exp $ */ +/* $OpenBSD: headers.c,v 1.23 2013/11/18 17:37:45 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org> * @@ -75,6 +75,8 @@ char wav_guid[14] = { 0x9B, 0x71 }; +int wav_readfmt(int, unsigned int, struct aparams *, short **); + int wav_readfmt(int fd, unsigned int csize, struct aparams *par, short **map) { diff --git a/usr.bin/aucat/midi.c b/usr.bin/aucat/midi.c index 627f2d51a0e..63272679420 100644 --- a/usr.bin/aucat/midi.c +++ b/usr.bin/aucat/midi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: midi.c,v 1.45 2012/10/27 08:31:59 ratchov Exp $ */ +/* $OpenBSD: midi.c,v 1.46 2013/11/18 17:37:45 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org> * @@ -65,6 +65,22 @@ #define MIDI_CTLVOL 7 /* volume */ #define MIDI_CTLPAN 11 /* pan */ +void midi_cb(void *); +void midi_msg_info(struct aproc *, int, unsigned char *); +void midi_msg_vol(struct aproc *, int, unsigned char *); +void midi_msg_master(struct aproc *, unsigned char *); +void midi_copy(struct abuf *, struct abuf *, unsigned char *, unsigned int); +void midi_send(struct aproc *, struct abuf *, unsigned char *, unsigned int); +void midi_copy_dump(struct aproc *, struct abuf *); +void midi_onvoice(struct aproc *, struct abuf *); +void midi_onsysex(struct aproc *, struct abuf *); +int midi_in(struct aproc *, struct abuf *); +int midi_out(struct aproc *, struct abuf *); +void midi_eof(struct aproc *, struct abuf *); +void midi_hup(struct aproc *, struct abuf *); +void midi_newin(struct aproc *, struct abuf *); +void midi_done(struct aproc *); + /* * length of voice and common messages (status byte included) */ diff --git a/usr.bin/aucat/siofile.c b/usr.bin/aucat/siofile.c index cd0bc9dd13c..f6a1e77aa90 100644 --- a/usr.bin/aucat/siofile.c +++ b/usr.bin/aucat/siofile.c @@ -1,4 +1,4 @@ -/* $OpenBSD: siofile.c,v 1.12 2012/06/27 06:46:44 ratchov Exp $ */ +/* $OpenBSD: siofile.c,v 1.13 2013/11/18 17:37:45 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org> * @@ -57,6 +57,7 @@ void siofile_stop(struct file *); int siofile_nfds(struct file *); int siofile_pollfd(struct file *, struct pollfd *, int); int siofile_revents(struct file *, struct pollfd *); +void siofile_cb(void *, int); struct fileops siofile_ops = { "sio", diff --git a/usr.bin/aucat/wav.c b/usr.bin/aucat/wav.c index 7e1df95c01b..b89ba177f9c 100644 --- a/usr.bin/aucat/wav.c +++ b/usr.bin/aucat/wav.c @@ -30,6 +30,36 @@ #include "dbg.h" #endif +void wav_dbg(struct wav *); +void wav_conv(unsigned char *, unsigned int, short *); +unsigned int wav_read(struct file *, unsigned char *, unsigned int); +unsigned int wav_write(struct file *, unsigned char *, unsigned int); +void wav_close(struct file *); +int wav_attach(struct wav *, int); +void wav_midiattach(struct wav *); +void wav_allocbuf(struct wav *); +void wav_freebuf(struct wav *); +void wav_reset(struct wav *); +void wav_exit(struct wav *); +int wav_init(struct wav *); +int wav_seekmmc(struct wav *); +int wav_rdata(struct wav *); +int wav_wdata(struct wav *); +void wav_setvol(void *, unsigned int); +void wav_startreq(void *); +void wav_stopreq(void *); +void wav_locreq(void *, unsigned int); +void wav_quitreq(void *); +int wav_autohdr(char *, struct dev *, unsigned int *, unsigned int *); +void rwav_done(struct aproc *); +int rwav_in(struct aproc *, struct abuf *); +int rwav_out(struct aproc *, struct abuf *); +struct aproc *rwav_new(struct file *); +void wwav_done(struct aproc *); +int wwav_in(struct aproc *, struct abuf *); +int wwav_out(struct aproc *, struct abuf *); +struct aproc *wwav_new(struct file *); + short wav_ulawmap[256] = { -32124, -31100, -30076, -29052, -28028, -27004, -25980, -24956, -23932, -22908, -21884, -20860, -19836, -18812, -17788, -16764, diff --git a/usr.bin/sndiod/dev.c b/usr.bin/sndiod/dev.c index 38b42828229..3f39b99191d 100644 --- a/usr.bin/sndiod/dev.c +++ b/usr.bin/sndiod/dev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dev.c,v 1.6 2013/05/05 20:42:53 ratchov Exp $ */ +/* $OpenBSD: dev.c,v 1.7 2013/11/18 17:37:45 ratchov Exp $ */ /* * Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org> * @@ -27,16 +27,6 @@ #include "sysex.h" #include "utils.h" -int dev_open(struct dev *); -void dev_close(struct dev *); -void dev_clear(struct dev *); -void dev_master(struct dev *, unsigned int); - -void slot_attach(struct slot *); -void slot_ready(struct slot *); -void slot_mix_drop(struct slot *); -void slot_sub_sil(struct slot *); - void zomb_onmove(void *, int); void zomb_onvol(void *, unsigned int); void zomb_fill(void *); @@ -47,11 +37,67 @@ void zomb_mmcstop(void *); void zomb_mmcloc(void *, unsigned int); void zomb_exit(void *); +void dev_log(struct dev *); +void dev_midi_qfr(struct dev *, int); +void dev_midi_full(struct dev *); +void dev_midi_vol(struct dev *, struct slot *); +void dev_midi_master(struct dev *); +void dev_midi_slotdesc(struct dev *, struct slot *); +void dev_midi_dump(struct dev *); void dev_midi_imsg(void *, unsigned char *, int); void dev_midi_omsg(void *, unsigned char *, int); void dev_midi_fill(void *, int); void dev_midi_exit(void *); +void dev_mon_snoop(struct dev *); +int play_filt_resamp(struct slot *, void *, void *, int); +int play_filt_dec(struct slot *, void *, void *, int); +void dev_mix_badd(struct dev *, struct slot *); +void dev_empty_cycle(struct dev *); +void dev_mix_adjvol(struct dev *); +void dev_mix_cycle(struct dev *); +int rec_filt_resamp(struct slot *, void *, void *, int); +int rec_filt_enc(struct slot *, void *, void *, int); +void dev_sub_bcopy(struct dev *, struct slot *); +void dev_sub_cycle(struct dev *); + +void dev_onmove(struct dev *, int); +void dev_master(struct dev *, unsigned int); +void dev_cycle(struct dev *); +int dev_getpos(struct dev *); +struct dev *dev_new(char *, struct aparams *, unsigned int, unsigned int, + unsigned int, unsigned int, unsigned int, unsigned int); +void dev_adjpar(struct dev *, int, int, int, int, int); +int dev_open(struct dev *); +void dev_close(struct dev *); +int dev_ref(struct dev *); +void dev_unref(struct dev *); +int dev_init(struct dev *); +void dev_done(struct dev *); +struct dev *dev_bynum(int); +void dev_del(struct dev *); +unsigned int dev_roundof(struct dev *, unsigned int); +void dev_wakeup(struct dev *); +void dev_clear(struct dev *); +void dev_sync_attach(struct dev *); +void dev_mmcstart(struct dev *); +void dev_mmcstop(struct dev *); +void dev_mmcloc(struct dev *, unsigned int); + +void slot_log(struct slot *); +struct slot *slot_new(struct dev *, char *, struct slotops *, void *, int); +void slot_del(struct slot *); +void slot_setvol(struct slot *, unsigned int); +void slot_attach(struct slot *); +void slot_ready(struct slot *); +void slot_start(struct slot *); +void slot_detach(struct slot *); +void slot_stop(struct slot *); +void slot_write(struct slot *); +void slot_read(struct slot *); +void slot_mix_drop(struct slot *); +void slot_sub_sil(struct slot *); + struct midiops dev_midiops = { dev_midi_imsg, dev_midi_omsg, diff --git a/usr.bin/sndiod/dsp.h b/usr.bin/sndiod/dsp.h index 7fe7e7514a7..f582e3bdcec 100644 --- a/usr.bin/sndiod/dsp.h +++ b/usr.bin/sndiod/dsp.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dsp.h,v 1.1 2012/11/23 07:03:28 ratchov Exp $ */ +/* $OpenBSD: dsp.h,v 1.2 2013/11/18 17:37:45 ratchov Exp $ */ /* * Copyright (c) 2012 Alexandre Ratchov <alex@caoua.org> * @@ -157,5 +157,6 @@ void dec_init(struct conv *, struct aparams *, int); void cmap_add(struct cmap *, void *, void *, int, int); void cmap_copy(struct cmap *, void *, void *, int, int); void cmap_init(struct cmap *, int, int, int, int, int, int, int, int); +int sqrtone(int, adata_t *, int, int, int); #endif /* !defined(DSP_H) */ diff --git a/usr.bin/sndiod/file.c b/usr.bin/sndiod/file.c index bef2ae58791..7ffa2546496 100644 --- a/usr.bin/sndiod/file.c +++ b/usr.bin/sndiod/file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: file.c,v 1.3 2013/02/01 09:06:27 ratchov Exp $ */ +/* $OpenBSD: file.c,v 1.4 2013/11/18 17:37:45 ratchov Exp $ */ /* * Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org> * @@ -62,6 +62,11 @@ #define MAXFDS 100 #define TIMER_USEC 10000 +void timo_update(unsigned int); +void timo_init(void); +void timo_done(void); +void file_sigalrm(int); + struct timespec file_ts; struct file *file_list; struct timo *timo_queue; diff --git a/usr.bin/sndiod/midi.h b/usr.bin/sndiod/midi.h index 3e1aaeb6ff8..40b94541361 100644 --- a/usr.bin/sndiod/midi.h +++ b/usr.bin/sndiod/midi.h @@ -1,4 +1,4 @@ -/* $OpenBSD: midi.h,v 1.5 2012/11/30 22:26:34 ratchov Exp $ */ +/* $OpenBSD: midi.h,v 1.6 2013/11/18 17:37:45 ratchov Exp $ */ /* * Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org> * @@ -110,6 +110,7 @@ void midi_fill(struct midi *); void midi_tag(struct midi *, unsigned int); void midi_link(struct midi *, struct midi *); +void port_log(struct port *); struct port *port_new(char *, unsigned int, int); struct port *port_bynum(int); void port_del(struct port *); diff --git a/usr.bin/sndiod/siofile.c b/usr.bin/sndiod/siofile.c index 606e1ad1ed2..da95e611fe8 100644 --- a/usr.bin/sndiod/siofile.c +++ b/usr.bin/sndiod/siofile.c @@ -1,4 +1,4 @@ -/* $OpenBSD: siofile.c,v 1.2 2013/02/01 09:06:27 ratchov Exp $ */ +/* $OpenBSD: siofile.c,v 1.3 2013/11/18 17:37:45 ratchov Exp $ */ /* * Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org> * @@ -33,6 +33,8 @@ #define WATCHDOG_USEC 2000000 /* 2 seconds */ +void dev_sio_onmove(void *, int); +void dev_sio_timeout(void *); int dev_sio_pollfd(void *, struct pollfd *); int dev_sio_revents(void *, struct pollfd *); void dev_sio_run(void *); diff --git a/usr.bin/sndiod/sndiod.c b/usr.bin/sndiod/sndiod.c index 4b38cb0fedf..ce83b5199c3 100644 --- a/usr.bin/sndiod/sndiod.c +++ b/usr.bin/sndiod/sndiod.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sndiod.c,v 1.4 2012/12/01 12:06:14 ratchov Exp $ */ +/* $OpenBSD: sndiod.c,v 1.5 2013/11/18 17:37:45 ratchov Exp $ */ /* * Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org> * @@ -85,6 +85,22 @@ #define DEFAULT_DEV "rsnd/0" #endif +void sigint(int); +void opt_ch(int *, int *); +void opt_enc(struct aparams *); +int opt_mmc(void); +int opt_onoff(void); +int getword(char *, char **); +unsigned int opt_mode(void); +void getbasepath(char *, size_t); +void setsig(void); +void unsetsig(void); +void privdrop(void); +struct dev *mkdev(char *, struct aparams *, + int, int, int, int, int, int); +struct opt *mkopt(char *, struct dev *, + int, int, int, int, int, int, int, int); + unsigned int log_level = 0; volatile sig_atomic_t quit_flag = 0; diff --git a/usr.bin/sndiod/sock.c b/usr.bin/sndiod/sock.c index d4bc4928ec8..a552190795a 100644 --- a/usr.bin/sndiod/sock.c +++ b/usr.bin/sndiod/sock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sock.c,v 1.6 2013/05/05 20:42:53 ratchov Exp $ */ +/* $OpenBSD: sock.c,v 1.7 2013/11/18 17:37:45 ratchov Exp $ */ /* * Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org> * @@ -32,38 +32,39 @@ #include "sock.h" #include "utils.h" -void sock_attach(struct sock *, int); -int sock_read(struct sock *); -int sock_write(struct sock *); -int sock_execmsg(struct sock *); -int sock_buildmsg(struct sock *); +void sock_log(struct sock *); void sock_close(struct sock *); - -int sock_pollfd(void *, struct pollfd *); -int sock_revents(void *, struct pollfd *); -void sock_in(void *); -void sock_out(void *); -void sock_hup(void *); - -/* - * slot call-backs - */ -void sock_slot_onmove(void *, int); -void sock_slot_onvol(void *, unsigned int); void sock_slot_fill(void *); void sock_slot_flush(void *); void sock_slot_eof(void *); +void sock_slot_onmove(void *, int); +void sock_slot_onvol(void *, unsigned int); +void sock_midi_imsg(void *, unsigned char *, int); +void sock_midi_omsg(void *, unsigned char *, int); +void sock_midi_fill(void *, int); +struct sock *sock_new(int); void sock_slot_mmcstart(void *); void sock_slot_mmcstop(void *); void sock_slot_mmcloc(void *, unsigned int); void sock_exit(void *); - -/* - * midi call-backs - */ -void sock_midi_imsg(void *, unsigned char *, int); -void sock_midi_omsg(void *, unsigned char *, int); -void sock_midi_fill(void *, int); +int sock_fdwrite(struct sock *, void *, int); +int sock_fdread(struct sock *, void *, int); +int sock_rmsg(struct sock *); +int sock_wmsg(struct sock *); +int sock_rdata(struct sock *); +int sock_wdata(struct sock *); +int sock_setpar(struct sock *); +int sock_auth(struct sock *); +int sock_hello(struct sock *); +int sock_execmsg(struct sock *); +int sock_buildmsg(struct sock *); +int sock_read(struct sock *); +int sock_write(struct sock *); +int sock_pollfd(void *, struct pollfd *); +int sock_revents(void *, struct pollfd *); +void sock_in(void *); +void sock_out(void *); +void sock_hup(void *); struct fileops sock_fileops = { "sock", |