home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / networking / misc / sana2.lha / sana2 / examples / offline / offline.c < prev   
Encoding:
C/C++ Source or Header  |  1991-11-18  |  919 b   |  53 lines

  1. /*
  2. **  $Id: offline.c,v 1.4 91/11/13 11:12:08 dlarson Exp $
  3. **
  4. **  SANA-II driver utility -- Make online driver go offline.
  5. **
  6. **  Copyright 1991 Commodore-Amiga, Inc.
  7. **
  8. **  This code may be modified and used freely on Amiga computers.
  9. **
  10. */
  11.  
  12.  
  13. #define NOBUFFS
  14. #include "/skeleton/skeleton.h"
  15.  
  16. struct MsgPort   *DevPort = NULL;
  17. struct IOSana2Req *IOB1    = NULL;
  18.  
  19. int    DeviceOpen = 0;
  20. long   DevBits;
  21.  
  22. void DoOffLine();
  23.  
  24.  
  25. main(argc , argv)
  26. char *argv[];
  27. {
  28.     if (!initdev())
  29.         printf("Open Failed\n");
  30.     else
  31.     {
  32.         printf("Attempting To Go OffLine\n");
  33.         DoOffLine();
  34.         if (IOB1->ios2_Req.io_Error)
  35.             printf("Error: %ld WireError: %ld\n",
  36.                    (long)IOB1->ios2_Req.io_Error,
  37.                    IOB1->ios2_WireError);
  38.         else
  39.             printf("No Error\n");
  40.  
  41.     }
  42. bottom:    closedev();
  43. }
  44.  
  45.  
  46. void DoOffLine()
  47. {
  48.     IOB1->ios2_Req.io_Error   = 0;
  49.     IOB1->ios2_Req.io_Flags   = IOF_QUICK;
  50.     IOB1->ios2_Req.io_Command = S2_OFFLINE;
  51.     DoIO(IOB1);
  52. }
  53.