+ sdev= open("/dev/dsp", O_WRONLY);
+ if (sdev<0) { perror("open sound device"); exit(8); }
+
+ snprintf(cbuf, sizeof(cbuf), "sox -t raw -s -w -r 44100 -c 2"
+ " - </dev/null -t ossdsp - >&%d", sdev);
+ r= system(cbuf); if (r) { fprintf(stderr,"sox gave %d\n",r); exit(5); }
+}
+
+void wrbuf_report(const char *m) {
+ printf("writing %s\n", m);
+}
+
+static void selectcopy(void) {
+ int slave= inq.head ? inq.head->fd : -1;
+ wrbufcore_prepselect(slave, sdev);
+ fdsetset(master,&readfds);
+ callselect();
+ wrbufcore_afterselect(slave, sdev);
+}
+
+static void expireoldconns(void) {
+ struct inqnode *searchold, *nextsearchold;
+
+ for (searchold= inq.head ? inq.head->next : 0;
+ searchold;
+ searchold= nextsearchold) {
+ nextsearchold= searchold->next;
+ if (searchold->accepted < now-maxstartdelay) {
+ printf("expired %p\n",searchold);
+ LIST_UNLINK(inq,searchold);
+ free(searchold);
+ }
+ }
+}
+
+static void acceptnewconns(void) {
+ static int bad;