DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ T X

⟦053cab1dd⟧ TextFile

    Length: 884 (0x374)
    Types: TextFile
    Names: »XStoreColors.c«

Derivation

└─⟦a0efdde77⟧ Bits:30001252 EUUGD11 Tape, 1987 Spring Conference Helsinki
    └─ ⟦526ad3590⟧ »EUUGD11/gnu-31mar87/X.V10.R4.tar.Z« 
        └─⟦2109abc41⟧ 
            └─ ⟦this⟧ »./X.V10R4/Xlib/XStoreColors.c« 

TextFile

#include <X/mit-copyright.h>

/* $Header: XStoreColors.c,v 10.5 86/04/22 15:25:11 jg Rel $ */
/* Copyright    Massachusetts Institute of Technology    1985	*/

#include "XlibInternal.h"
XStoreColors (ncolors, defs)
    	int ncolors;
	register Color *defs;
{
	register Display *dpy;
	register XReq *req;
	GetReq (X_StoreColors, 0);
	req->params0 = ncolors;

	/* Color structure in library uses int for pixel,
	   but protocol's ColorDef wants a short;
	   thus, data must be copied */
        {
	int nbytes = ncolors*sizeof(ColorDef);
	register int i;
	register ColorDef *proto_defs = (ColorDef *) malloc (nbytes);
	for (i=0;i<ncolors;i++) {
	    proto_defs[i].pixel = defs[i].pixel;
	    proto_defs[i].red = defs[i].red;
	    proto_defs[i].green = defs[i].green;
	    proto_defs[i].blue = defs[i].blue;
	    }
	Data (dpy, (char *)proto_defs, nbytes);
	free ((char *)proto_defs);
	}
}