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

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