home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 4 / CDPD_IV.bin / networking / dnet / dnet2.3.2 / amiga / client / quitdnet.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-29  |  853 b   |  57 lines

  1.  
  2. /*
  3.  *  QUITDNET.C
  4.  *
  5.  *  DNET (c)Copyright 1988, Matthew Dillon, All Rights Reserved.
  6.  *
  7.  *  QUITDNET [-Nnet]
  8.  *
  9.  */
  10.  
  11. #include "defs.h"
  12.  
  13.  
  14. #ifndef __GNUC__
  15. int
  16. brk()
  17. {
  18.     return(0);
  19. }
  20. #endif
  21.  
  22. void
  23. main(ac,av)
  24. char *av[];
  25. {
  26.     int ok;
  27.     char *host = NULL;
  28.  
  29. #ifndef __GNUC__
  30.     onbreak(brk);
  31. #endif
  32.  
  33.     printf("QuitDNet V%s%s\n", VERSION, QUITDNET_VERSION);
  34.     {
  35.     short i;
  36.     for (i = 1; i < ac; ++i) {
  37.         if (strncmp(av[i], "-N", 2) == 0) {
  38.         if(strlen(av[i]) > 2){
  39.             host = av[i] + 2;
  40.         }else{
  41.             fprintf(stderr, "%s: need hostname!\n", av[i]);
  42.         }
  43.         continue;
  44.         }
  45.     }
  46.     }
  47.     ok = DQuit(host);   /*  NULL ok */
  48.     printf("DQuit(%s) result %d\n", host, ok);
  49.     if (ok) {
  50.     Delay(50 * 5);   /* Uh, 5 seconds?  */
  51.     DBreak(host);
  52.     printf("DBreak(%s) done\n", host);
  53.     } else{
  54.     printf("DNET master port for network not found");
  55.     }
  56. }
  57.