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 / statdnet.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-29  |  696 b   |  54 lines

  1.  
  2. /*
  3.  *  STATDNET.C
  4.  *
  5.  *  DNET (c)Copyright 1988, Matthew Dillon, All Rights Reserved.
  6.  *
  7.  *  STATDNET [-Nnet]
  8.  *
  9.  */
  10.  
  11. #include "defs.h"
  12.  
  13.  
  14. char buf[2048];
  15.  
  16. #ifndef __GNUC__
  17. int
  18. brk()
  19. {
  20.     return(0);
  21. }
  22. #endif
  23.  
  24.  
  25. main(ac,av)
  26. char *av[];
  27. {
  28.     int ok;
  29.     char *host = NULL;
  30.  
  31.     printf("StatDNet V%s%s\n", VERSION, STATDNET_VERSION);
  32.  
  33. #ifndef __GNUC__
  34.     onbreak(brk);
  35. #endif
  36.  
  37.     {
  38.     short i;
  39.     for (i = 1; i < ac; ++i) {
  40.         if (strncmp(av[i], "-N", 2) == 0) {
  41.         host = av[i] + 2;
  42.         continue;
  43.         }
  44.     }
  45.     }
  46.     fflush(stdout);
  47.     buf[0] = 0;
  48.     ok = DStat(host, (APTR)buf, 2048);
  49.     if (ok)
  50.     write(1, buf, strlen(buf));
  51.     else
  52.     puts("DStat() failed; master port for network not found");
  53. }
  54.