home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d4xx / d430 / smartfields.lha / SmartFields / Functions / console_close.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-01-11  |  929 b   |  38 lines

  1. /***************************************
  2. *  CONSOLE CLOSE v1.01
  3. *  © Copyright 1988 Timm Martin
  4. *  All Rights Reserved
  5. ****************************************/
  6.  
  7. #include <console/console.h>
  8. #include <console/functions.h>
  9.  
  10. void console_close( header )
  11.   struct ConsoleHeader *header;
  12. {
  13.   void CloseDevice();  /* exec.library (CLOSE_CONSOLE) */
  14.   void DeletePort();   /* exec.library */
  15.   void DeleteStdIO();  /* exec.library */
  16.  
  17.   if (!header->ConsoleError) {
  18.     CLOSE_CONSOLE( header->WriteReq );
  19.     header->ConsoleError = CONSOLE_ERROR;
  20.   }
  21.   if (header->ReadReq) {
  22.     DeleteStdIO( header->ReadReq );
  23.     header->ReadReq = NULL;
  24.   }
  25.   if (header->ReadPort) {
  26.     DeletePort( header->ReadPort );
  27.     header->ReadPort = NULL;
  28.   }
  29.   if (header->WriteReq) {
  30.     DeleteStdIO( header->WriteReq );
  31.     header->WriteReq = NULL;
  32.   }
  33.   if (header->WritePort) {
  34.     DeletePort( header->WritePort );
  35.     header->WritePort = NULL;
  36.   }
  37. }
  38.