home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
unix
/
volume26
/
modempool
/
part01
/
getargs.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-04-05
|
1KB
|
71 lines
/*******************************************************************
*
* Module: @(#)getargs.c 4.2 92/04/16
*
* Description:
* Get commandline arguments.
*
* Revision:
* Date By Reason
* ---- -- ------
* 920309 Lars Berntzon Created
*
*******************************************************************/
static char SccsId[] = "@(#)getargs.c 4.2 92/04/16";
#include <stdio.h>
#ifndef NOSTDLIB
#include <stdlib.h>
#endif
#include <unistd.h>
#include <string.h>
#include <signal.h>
#include <fcntl.h>
#include <stdarg.h>
#include <termios.h>
#include <ctype.h>
#include "modempool.h"
/*******************************************************************
* G E T A R G S
* -------------
* Description:
* Examine command line options.
*
*******************************************************************/
int
getargs(int *argc, char ***argv)
{
/*
* Get arguments
*/
while((*argv)[1] != NULL && (*argv)[1][0] == '-')
{
switch((*argv)[1][1])
{
case 'd':
debug_lvl++;
break;
case 'p':
(*argv)++, (*argc)--;
if ((*argv)[1] == NULL) usage();
strcpy(prefix, (*argv)[1]);
break;
case 'i':
(*argv)++, (*argc)--;
if((*argv)[1] == NULL) usage();
initstr = (*argv)[1];
break;
}
(*argv)++, (*argc)--;
}
/* Check args */
if ((*argc) != 3) usage();
return E_OK;
}