/*
** FILE:	main.h
** PROGRAM:	idev
** VERSION:	1.0
**
** DESCRIPTIPON:
**	This file contains main().  It checks the arguments, creates
**	the reply port and IORequest, and initializes the IORequest
**	through OpenDevice.  It then calls idev() (see idev.[ch])
**	to perform the user interaction.  When idev() returns, the
**	IORequest and reply port are cleaned up, and the device is
**	closed.
**
**	Quit() is the function which handles cleanup.  If fmt is not
**	NULL, an information line of the form:
**		progname: fmt_msg
**	is printed before cleanup.  The extra arguments are passed to
**	printf() for the format string (in case it includes %X's).
**	Finally, exit() is called with exitval.
**
**	Cmdname is set to argv[0] (the name of the program) upon
**	program entry.
**
** HISTORY:
**	26-Aug-87	Original Version   (Ed Puckett)
*/

#ifndef MAIN_H
#define MAIN_H


#define IOREQSIZE	8192

extern char  *cmdname;	       /* argv[0] - set upon entry by main() */


/* exit statuses */

#define Q_OK		0	/* no error */
#define Q_USAGE 	1	/* improper usage */
#define Q_ARGERR	1	/* error in command line argument */
#define Q_ABORT 	10	/* user aborted */
#define Q_RSRCERR	20	/* could not obtain some resource */


extern void  main ( int,  char ** );
/*		    argc, argv	  */

extern void  quit ( int,     char *, int,  int,  int );
/*		    exitval, fmt,    arg1, arg2, arg3 */

#endif MAIN_H

