Annotation of researchv9/X11/src/X.V11R1/lib/X/XLiICmaps.c, revision 1.1.1.1

1.1       root        1: #include "copyright.h"
                      2: 
                      3: /* $Header: XLiICmaps.c,v 11.13 87/09/11 08:04:49 toddb Exp $ */
                      4: /* Copyright    Massachusetts Institute of Technology    1986  */
                      5: 
                      6: #define NEED_REPLIES
                      7: #include "Xlibint.h"
                      8: 
                      9: Colormap *XListInstalledColormaps(dpy, win, n)
                     10: register Display *dpy;
                     11: Window win;
                     12: int *n;  /* RETURN */
                     13: {
                     14:     long nbytes;
                     15:     Colormap *cmaps;
                     16:     xListInstalledColormapsReply rep;
                     17:     register xResourceReq *req;
                     18: 
                     19:     LockDisplay(dpy);
                     20:     GetResReq(ListInstalledColormaps, win, req);
                     21: 
                     22:     if(_XReply(dpy, (xReply *) &rep, 0, xFalse) == 0) {
                     23:            UnlockDisplay(dpy);
                     24:            SyncHandle();
                     25:            *n = 0;
                     26:            return((Colormap *)None);
                     27:        }
                     28:        
                     29: 
                     30:     *n = rep.nColormaps;
                     31:     cmaps = (Colormap *) Xmalloc(
                     32:        (unsigned) (nbytes = ((long)rep.nColormaps * sizeof(Colormap))));
                     33:     _XRead (dpy, (char *) cmaps, nbytes);
                     34: 
                     35:     UnlockDisplay(dpy);
                     36:     SyncHandle();
                     37:     return(cmaps);
                     38: }
                     39: 

unix.superglobalmegacorp.com

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