Annotation of 43BSDTahoe/new/X/Xlib/XQueryTree.c, revision 1.1.1.1

1.1       root        1: #include <X/mit-copyright.h>
                      2: 
                      3: /* $Header: XQueryTree.c,v 10.5 86/04/22 15:20:57 jg Rel $ */
                      4: /* Copyright    Massachusetts Institute of Technology    1985  */
                      5: 
                      6: #include "XlibInternal.h"
                      7: Status XQueryTree (w, parent, nchildren, children)
                      8:        Window w;
                      9:        Window *parent;
                     10:        int *nchildren;
                     11:        Window **children;
                     12: 
                     13: {
                     14:        register Display *dpy;
                     15:        register XReq *req;
                     16:        XRep rep;
                     17:        int nbytes;
                     18: 
                     19:        GetReq(X_QueryTree, w);
                     20: 
                     21:        if (!_XReply(dpy, &rep))
                     22:            return (0);
                     23:        *parent = rep.param.l[0];
                     24:        if ((*nchildren = rep.param.l[1]) == 0) {
                     25:            *children = NULL;
                     26:            return (1);
                     27:            }
                     28:        
                     29:        if ((*children = (Window *) malloc (nbytes = rep.param.l[1]*sizeof(Window))) == NULL)
                     30:            _XIOError (dpy);
                     31: 
                     32:        _XRead (dpy, (char *)*children, nbytes);
                     33:        return (1);
                     34:        }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.