/ * phoneman -- telephone manager Main program A.J. Fisher January 1996 */ #include <stdio.h> #include <signal.h> #include <fishaudio.h> #include "phoneman.h" #define DFLTRC "/usr/fisher/mipslib/phoneman/dfltrc" static audio_pval iopvals[] = { { AU_INPUT_RATE, AU_RATE_8000 }, { AU_OUTPUT_RATE, AU_RATE_8000 }, { AU_INPUT_SOURCE, AU_INPUT_LINE }, { AU_LEFT_INPUT_ATTEN, 0 }, { AU_RIGHT_INPUT_ATTEN, 0 }, { AU_MONITOR_CTL, 0 }, { -1, -1 }, }; global audio *Audio; static void newhandler(), catchsignal(int), sighandler(int), tidyaudio(), usage(); static char *findrcfile(); global int main(int argc, char *argv[]) { set_new_handler(newhandler); catchsignal(SIGINT); catchsignal(SIGTERM); unless (argc == 1 || argc == 2) usage(); char *pfn = (argc == 2) ? argv[1] : findrcfile(); pnode *program = parsescript(pfn); Audio = new audio(AU_IN | AU_OUT | AU_LOCK | AU_SAVE, iopvals); atexit(tidyaudio); obeyscript(program); } static void newhandler() { giveup("No room"); } static void catchsignal(int sig) { signal(sig, (SIG_PF) sighandler); } static void sighandler(int sig) { giveup("Signal %d!", sig); } static void tidyaudio() { delete Audio; } static void usage() { fprintf(stderr, "Usage: phoneman [dur]\n"); exit(2); } static char *findrcfile() { char *pfn = DFLTRC; char *hdir = getenv("HOME"); if (hdir != NULL) { char fn[MAXSTR+1]; sprintf(fn, "%s/phoneman.rc", hdir); if (exists(fn)) pfn = copystr(fn); /* file exists? */ } return pfn; }
file: /Techref/uk/ac/york/cs/www-users/http/~fisher/software/voicemail/phoneman/current/main.C, 1KB, , updated: 2000/4/4 12:11, local time: 2024/9/28 13:46,
18.191.176.194:LOG IN ©2024 PLEASE DON'T RIP! THIS SITE CLOSES OCT 1, 2024 SO LONG AND THANKS FOR ALL THE FISH!
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://piclist.com/Techref/uk/ac/york/cs/www-users/http/~fisher/software/voicemail/phoneman/current/main.C"> uk ac york cs www-users http ~fisher software voicemail phoneman current main</A> |
Did you find what you needed? |
PICList 2024 contributors:
o List host: MIT, Site host massmind.org, Top posters @none found - Page Editors: James Newton, David Cary, and YOU! * Roman Black of Black Robotics donates from sales of Linistep stepper controller kits. * Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters. * Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated! * Contributors: Richard Seriani, Sr. |
Welcome to piclist.com! |
.