1: #include <X/mit-copyright.h>
   2: 
   3: /* $Header: XGetHosts.c,v 10.4 86/02/01 15:35:02 tony Rel $ */
   4: /* Copyright    Massachusetts Institute of Technology    1985	*/
   5: 
   6: #include "XlibInternal.h"
   7: struct in_addr *XGetHosts (nhosts)
   8:         int *nhosts;
   9: {
  10:     register Display *dpy;
  11:     register XReq *req;
  12:     XRep rep;
  13:     char *buf;
  14:     int nbytes;
  15: 
  16:     GetReq(X_GetHosts, 0);
  17:     req->func = XAF_INET;
  18:     if (!(_XReply (dpy, &rep)) || !(nbytes = rep.param.l[0])) {
  19:         /* error or empty list */
  20:         *nhosts = 0;
  21:         return (NULL);
  22:         }
  23:     *nhosts = nbytes / sizeof (struct in_addr);
  24:     if (!(buf = (char *) malloc (nbytes))) {
  25:         errno = ENOMEM;
  26:         _XIOError (dpy);
  27:         }
  28:     _XReadPad (dpy, buf, nbytes);
  29:     return ((struct in_addr *) buf);
  30: }

Defined functions

XGetHosts defined in line 7; used 2 times
Last modified: 1986-02-01
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 738
Valid CSS Valid XHTML 1.0 Strict