home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 200-299 / ff294.lzh / DNet / amiga / lib / dquit.c < prev    next >
C/C++ Source or Header  |  1989-12-11  |  769b  |  46 lines

  1.  
  2. /*
  3.  *  DQuit.C
  4.  */
  5.  
  6. #include "lib.h"
  7.  
  8. int
  9. DBreak(host)
  10. char *host;
  11. {
  12.     char buf[sizeof(DNETPORTNAME)+32];
  13.     PORT *dnetport;
  14.  
  15.     if (!host)
  16.     host = "0";
  17.     sprintf(buf, "%s%s", DNETPORTNAME, host);
  18.     if (dnetport = FindPort(buf))
  19.     Signal(dnetport->mp_SigTask, SIGBREAKF_CTRL_C);
  20. }
  21.  
  22. int
  23. DQuit(host)
  24. char *host;
  25. {
  26.     IOSTD ior;
  27.     char buf[sizeof(DNETPORTNAME)+32];
  28.     PORT *replyport = CreatePort(NULL, 0);
  29.     PORT *dnetport;
  30.  
  31.     if (!host)
  32.     host = "0";
  33.     sprintf(buf, "%s%s", DNETPORTNAME, host);
  34.     if (dnetport = FindPort(buf)) {
  35.     ior.io_Command = DNCMD_QUIT;
  36.     ior.io_Unit = 0;
  37.     ior.io_Offset = 0;
  38.     ior.io_Message.mn_ReplyPort = replyport;
  39.     PutMsg(dnetport, (MSG *)&ior);
  40.     WaitMsg(&ior);
  41.     DeletePort(replyport);
  42.     }
  43.     return(dnetport != NULL);
  44. }
  45.  
  46.