|
|
1.1 root 1: #include <X/mit-copyright.h>
2:
3: /* $Header: XFreeColors.c,v 10.5 86/04/22 15:19:33 jg Rel $ */
4: /* Copyright Massachusetts Institute of Technology 1985 */
5:
6: #include "XlibInternal.h"
7: XFreeColors (pixels, npixels, planes)
8: register int *pixels;
9: int npixels;
10: int planes;
11: {
12: register Display *dpy;
13: register XReq *req;
14:
15: GetReq (X_FreeColors, 0);
16: req->mask = planes;
17: req->params0 = npixels;
18:
19: /* "pixels" is an array of ints, but the protocol wants
20: * an array of shorts, therefore data must be copied */
21: {
22: register int i;
23: int nbytes = npixels*psizeof(short);
24: #ifdef BIGSHORTS
25: PackData(dpy, (short *)pixels, nbytes);
26: #else
27: register u_short *proto_pixels = (u_short *) malloc (nbytes);
28: for (i=0;i<npixels;i++)
29: proto_pixels[i] = pixels[i];
30: Data (dpy, proto_pixels, nbytes);
31: free ((char *)proto_pixels);
32: #endif
33: }
34: }
35:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.