|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T X
Length: 1077 (0x435)
Types: TextFile
Names: »XQueryColors.c«
└─⟦a0efdde77⟧ Bits:30001252 EUUGD11 Tape, 1987 Spring Conference Helsinki
└─⟦526ad3590⟧ »EUUGD11/gnu-31mar87/X.V10.R4.tar.Z«
└─⟦2109abc41⟧
└─⟦this⟧ »./X.V10R4/Xlib/XQueryColors.c«
#include <X/mit-copyright.h>
/* $Header: XQueryColors.c,v 10.5 86/04/22 15:23:30 jg Rel $ */
/* Copyright Massachusetts Institute of Technology 1985 */
#include "XlibInternal.h"
#define MAXREQS 80 /* to prevent deadlock due to full TCP buffers */
XQueryColors (colors, ncolors)
Color colors[];
int ncolors;
{
register Display *dpy;
register XReq *req;
register int i;
register Color *color = colors;
XRep rep;
while (ncolors > 0) {
register int nreqs = (ncolors > MAXREQS) ? MAXREQS : ncolors;
for (i=0;i<nreqs;i++) {
GetReq (X_QueryColor, 0);
req->paramu0 = (color++)->pixel;
}
/* Reset request number, so error packets are handled correctly */
dpy->request -= nreqs;
color -= nreqs;
for (i=0;i<nreqs;i++) {
/* Increment request number, so error packets are handled
correctly */
dpy->request++;
_XReply (dpy, &rep);
color->red = rep.paramu0;
color->green = rep.paramu1;
(color++)->blue = rep.paramu2;
}
ncolors -= nreqs;
}
}