home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 103.lha / IntDevExpl / main.h < prev    next >
C/C++ Source or Header  |  1986-11-21  |  1KB  |  54 lines

  1. /*
  2. ** FILE:    main.h
  3. ** PROGRAM:    idev
  4. ** VERSION:    1.0
  5. **
  6. ** DESCRIPTIPON:
  7. **    This file contains main().  It checks the arguments, creates
  8. **    the reply port and IORequest, and initializes the IORequest
  9. **    through OpenDevice.  It then calls idev() (see idev.[ch])
  10. **    to perform the user interaction.  When idev() returns, the
  11. **    IORequest and reply port are cleaned up, and the device is
  12. **    closed.
  13. **
  14. **    Quit() is the function which handles cleanup.  If fmt is not
  15. **    NULL, an information line of the form:
  16. **        progname: fmt_msg
  17. **    is printed before cleanup.  The extra arguments are passed to
  18. **    printf() for the format string (in case it includes %X's).
  19. **    Finally, exit() is called with exitval.
  20. **
  21. **    Cmdname is set to argv[0] (the name of the program) upon
  22. **    program entry.
  23. **
  24. ** HISTORY:
  25. **    26-Aug-87    Original Version   (Ed Puckett)
  26. */
  27.  
  28. #ifndef MAIN_H
  29. #define MAIN_H
  30.  
  31.  
  32. #define IOREQSIZE    8192
  33.  
  34. extern char  *cmdname;           /* argv[0] - set upon entry by main() */
  35.  
  36.  
  37. /* exit statuses */
  38.  
  39. #define Q_OK        0    /* no error */
  40. #define Q_USAGE     1    /* improper usage */
  41. #define Q_ARGERR    1    /* error in command line argument */
  42. #define Q_ABORT     10    /* user aborted */
  43. #define Q_RSRCERR    20    /* could not obtain some resource */
  44.  
  45.  
  46. extern void  main ( int,  char ** );
  47. /*            argc, argv      */
  48.  
  49. extern void  quit ( int,     char *, int,  int,  int );
  50. /*            exitval, fmt,    arg1, arg2, arg3 */
  51.  
  52. #endif MAIN_H
  53.  
  54.