please dont rip this site

UK AC York CS Www-users Http ~fisher Software Voicemail Phoneman Current Main.c

/ * 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 11:11, local time: 2025/2/11 03:29,
TOP NEW HELP FIND: 
3.138.119.128:LOG IN

 ©2025 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?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://sxlist.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?

 

Welcome to sxlist.com!


Site supported by
sales, advertizing,
& kind contributors
just like you!

Please don't rip/copy
(here's why

Copies of the site on CD
are available at minimal cost.
 

Welcome to sxlist.com!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .