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 / dstat.c < prev    next >
C/C++ Source or Header  |  1989-12-11  |  577b  |  35 lines

  1.  
  2. /*
  3.  *  DStat.C
  4.  */
  5.  
  6. #include "lib.h"
  7.  
  8. int
  9. DStat(host, buffer, max)
  10. char *host;
  11. APTR buffer;
  12. long max;
  13. {
  14.     IOSTD ior;
  15.     char buf[sizeof(DNETPORTNAME)+32];
  16.     PORT *replyport = CreatePort(NULL, 0);
  17.     PORT *dnetport;
  18.  
  19.     if (!host)
  20.     host = "0";
  21.     sprintf(buf, "%s%s", DNETPORTNAME, host);
  22.     if (dnetport = FindPort(buf)) {
  23.     ior.io_Command = DNCMD_INFO;
  24.     ior.io_Unit = 0;
  25.     ior.io_Offset = 0;
  26.     ior.io_Data = buffer;
  27.     ior.io_Message.mn_ReplyPort = replyport;
  28.     PutMsg(dnetport, (MSG *)&ior);
  29.     WaitMsg(&ior);
  30.     DeletePort(replyport);
  31.     }
  32.     return(dnetport != NULL);
  33. }
  34.  
  35.