From b1c417ab042b7cdb4a532c9d69958d667ce0cddf Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Mon, 18 Nov 2013 17:50:04 +0100 Subject: [PATCH] add prototypes --- aucat/abuf.c | 6 +++ aucat/aproc.c | 84 ++++++++++++++++++++++++++++++++++++++++++ aucat/aproc.h | 1 + aucat/aucat.c | 13 +++++++ aucat/dev.c | 5 +++ aucat/file.c | 5 +++ aucat/headers.c | 2 + aucat/midi.c | 16 ++++++++ aucat/siofile.c | 1 + aucat/wav.c | 30 +++++++++++++++ bsd-compat/issetugid.c | 3 +- bsd-compat/strlcat.c | 3 +- bsd-compat/strlcpy.c | 3 +- bsd-compat/strtonum.c | 3 +- examples/cap.c | 4 ++ examples/fd.c | 7 ++++ examples/play.c | 4 ++ examples/rec.c | 4 ++ examples/vol.c | 4 ++ libsndio/sio_alsa.c | 5 ++- sndioctl/sndioctl.c | 7 ++++ sndiod/dev.c | 66 ++++++++++++++++++++++++++++----- sndiod/dsp.h | 1 + sndiod/file.c | 5 +++ sndiod/midi.h | 1 + sndiod/siofile.c | 2 + sndiod/sndiod.c | 16 ++++++++ sndiod/sock.c | 51 ++++++++++++------------- 28 files changed, 312 insertions(+), 40 deletions(-) diff --git a/aucat/abuf.c b/aucat/abuf.c index 4ede545..af91c61 100644 --- a/aucat/abuf.c +++ b/aucat/abuf.c @@ -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/aucat/aproc.c b/aucat/aproc.c index 138debd..789fa9c 100644 --- a/aucat/aproc.c +++ b/aucat/aproc.c @@ -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/aucat/aproc.h b/aucat/aproc.h index 7507010..c3734f1 100644 --- a/aucat/aproc.h +++ b/aucat/aproc.h @@ -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/aucat/aucat.c b/aucat/aucat.c index acc5281..852b0cd 100644 --- a/aucat/aucat.c +++ b/aucat/aucat.c @@ -69,6 +69,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/aucat/dev.c b/aucat/dev.c index e64993d..10cd0b6 100644 --- a/aucat/dev.c +++ b/aucat/dev.c @@ -87,6 +87,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/aucat/file.c b/aucat/file.c index d555d97..3b85e08 100644 --- a/aucat/file.c +++ b/aucat/file.c @@ -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/aucat/headers.c b/aucat/headers.c index 92f67b0..b108e5e 100644 --- a/aucat/headers.c +++ b/aucat/headers.c @@ -76,6 +76,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/aucat/midi.c b/aucat/midi.c index dd2faf8..4bdc8b5 100644 --- a/aucat/midi.c +++ b/aucat/midi.c @@ -66,6 +66,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/aucat/siofile.c b/aucat/siofile.c index 1b1b6ee..0a10ac9 100644 --- a/aucat/siofile.c +++ b/aucat/siofile.c @@ -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/aucat/wav.c b/aucat/wav.c index 7e1df95..b89ba17 100644 --- a/aucat/wav.c +++ b/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/bsd-compat/issetugid.c b/bsd-compat/issetugid.c index 6ca7f4d..db0d887 100644 --- a/bsd-compat/issetugid.c +++ b/bsd-compat/issetugid.c @@ -13,9 +13,10 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef HAVE_ISSETUGID #include +#include "bsd-compat.h" +#ifndef HAVE_ISSETUGID int issetugid(void) { diff --git a/bsd-compat/strlcat.c b/bsd-compat/strlcat.c index 4799568..936e608 100644 --- a/bsd-compat/strlcat.c +++ b/bsd-compat/strlcat.c @@ -16,10 +16,11 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef HAVE_STRLCAT #include #include +#include "bsd-compat.h" +#ifndef HAVE_STRLCAT /* * Appends src to string dst of size siz (unlike strncat, siz is the * full size of dst, not space left). At most siz-1 characters diff --git a/bsd-compat/strlcpy.c b/bsd-compat/strlcpy.c index 54d52fa..b336682 100644 --- a/bsd-compat/strlcpy.c +++ b/bsd-compat/strlcpy.c @@ -14,10 +14,11 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef HAVE_STRLCPY #include #include +#include "bsd-compat.h" +#ifndef HAVE_STRLCPY /* * Copy src to string dst of size siz. At most siz-1 characters * will be copied. Always NUL terminates (unless siz == 0). diff --git a/bsd-compat/strtonum.c b/bsd-compat/strtonum.c index 56febb8..5f644f9 100644 --- a/bsd-compat/strtonum.c +++ b/bsd-compat/strtonum.c @@ -15,10 +15,10 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef HAVE_STRTONUM #include #include #include +#include "bsd-compat.h" #ifndef LLONG_MIN #define LLONG_MIN (-LLONG_MAX-1) @@ -31,6 +31,7 @@ #define TOOSMALL 2 #define TOOLARGE 3 +#ifndef HAVE_STRTONUM long long strtonum(const char *numstr, long long minval, long long maxval, const char **errstrp) diff --git a/examples/cap.c b/examples/cap.c index ce771a0..fcc9b3c 100644 --- a/examples/cap.c +++ b/examples/cap.c @@ -11,6 +11,10 @@ struct sio_par par; struct sio_cap cap; +void pr_enc(struct sio_enc *); +void cap_pr(struct sio_cap *); +void usage(void); + void pr_enc(struct sio_enc *enc) { diff --git a/examples/fd.c b/examples/fd.c index 41a269c..e7b3b64 100644 --- a/examples/fd.c +++ b/examples/fd.c @@ -16,6 +16,13 @@ struct buf { /* simple circular fifo */ unsigned char data[BUF_LEN]; }; +void cb(void *, int); +void buf_read(struct buf *, int); +void buf_write(struct buf *, int); +unsigned buf_rec(struct buf *, struct sio_hdl *); +unsigned buf_play(struct buf *, struct sio_hdl *); +void usage(void); + char *xstr[] = SIO_XSTRINGS; struct sio_par par; struct buf playbuf, recbuf; diff --git a/examples/play.c b/examples/play.c index 368aca9..6385f9a 100644 --- a/examples/play.c +++ b/examples/play.c @@ -9,6 +9,10 @@ #include "tools.h" #define BUFSZ 0x100 + +void cb(void *, int); +void usage(void); + unsigned char buf[BUFSZ]; struct sio_par par; char *xstr[] = SIO_XSTRINGS; diff --git a/examples/rec.c b/examples/rec.c index 644d96e..e45d7af 100644 --- a/examples/rec.c +++ b/examples/rec.c @@ -9,6 +9,10 @@ #include "tools.h" #define BUFSZ 0x1000 + +void cb(void *, int); +void usage(void); + unsigned char buf[BUFSZ]; struct sio_par par; char *xstr[] = SIO_XSTRINGS; diff --git a/examples/vol.c b/examples/vol.c index 2356f62..9cff949 100644 --- a/examples/vol.c +++ b/examples/vol.c @@ -11,6 +11,10 @@ #include "tools.h" #define BUFSZ 0x100 + +void usage(void); +void onvol(void *, unsigned); + unsigned char buf[BUFSZ]; struct sio_par par; unsigned vol = 0xdeadbeef; diff --git a/libsndio/sio_alsa.c b/libsndio/sio_alsa.c index f2a15b2..384ccaa 100644 --- a/libsndio/sio_alsa.c +++ b/libsndio/sio_alsa.c @@ -55,6 +55,9 @@ struct sio_alsa_hdl { int events; }; +/* stdin */ +static void sio_alsa_onmove(struct sio_alsa_hdl *); +static int sio_alsa_revents(struct sio_hdl *, struct pollfd *); static void sio_alsa_close(struct sio_hdl *); static int sio_alsa_start(struct sio_hdl *); static int sio_alsa_stop(struct sio_hdl *); @@ -450,7 +453,7 @@ sio_alsa_xrun(struct sio_alsa_hdl *hdl) return 1; } -int +static int sio_alsa_setpar_hw(snd_pcm_t *pcm, snd_pcm_hw_params_t *hwp, snd_pcm_format_t *reqfmt, unsigned int *rate, unsigned int *chans, snd_pcm_uframes_t *round, unsigned int *periods) diff --git a/sndioctl/sndioctl.c b/sndioctl/sndioctl.c index 8e49c6c..caa5f5f 100644 --- a/sndioctl/sndioctl.c +++ b/sndioctl/sndioctl.c @@ -27,6 +27,13 @@ #define MIDI_NCHAN 16 /* max channels */ #define MSGMAX 0x100 /* buffer size */ +void setvol(int, int); +void setmaster(int); +void onsysex(unsigned char *, int); +void oncommon(unsigned char *, int); +void oninput(unsigned char *, int); +void usage(void); + int verbose = 0; int mst, midx, mlen, mready; /* midi parser state */ unsigned char mmsg[MSGMAX]; /* resulting midi message */ diff --git a/sndiod/dev.c b/sndiod/dev.c index 65dc429..3c723b2 100644 --- a/sndiod/dev.c +++ b/sndiod/dev.c @@ -28,16 +28,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 *); @@ -48,11 +38,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/sndiod/dsp.h b/sndiod/dsp.h index 9f81f84..7c8637d 100644 --- a/sndiod/dsp.h +++ b/sndiod/dsp.h @@ -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/sndiod/file.c b/sndiod/file.c index bb2fc99..f4ef91a 100644 --- a/sndiod/file.c +++ b/sndiod/file.c @@ -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/sndiod/midi.h b/sndiod/midi.h index c48a9b8..b7daa62 100644 --- a/sndiod/midi.h +++ b/sndiod/midi.h @@ -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/sndiod/siofile.c b/sndiod/siofile.c index 128414f..23f3363 100644 --- a/sndiod/siofile.c +++ b/sndiod/siofile.c @@ -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/sndiod/sndiod.c b/sndiod/sndiod.c index 35fe28c..fd305ee 100644 --- a/sndiod/sndiod.c +++ b/sndiod/sndiod.c @@ -86,6 +86,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/sndiod/sock.c b/sndiod/sock.c index 6d62aef..909c729 100644 --- a/sndiod/sock.c +++ b/sndiod/sock.c @@ -32,39 +32,40 @@ #include "sock.h" #include "utils.h" -void sock_attach(struct sock *, int); -int sock_read(struct sock *); -int sock_write(struct sock *); +void sock_log(struct sock *); +void sock_close(struct sock *); +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 *); +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 *); -void sock_close(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 *); -/* - * 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_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); - struct fileops sock_fileops = { "sock", sock_pollfd,