1: #include <X/mit-copyright.h>
2:
3: /* $Header: XStoreColors.c,v 10.4 86/02/01 15:40:12 tony Rel $ */
4: /* Copyright Massachusetts Institute of Technology 1985 */
5:
6: #include "XlibInternal.h"
7: XStoreColors (ncolors, defs)
8: int ncolors;
9: register Color *defs;
10: {
11: register Display *dpy;
12: register XReq *req;
13: GetReq (X_StoreColors, 0);
14: req->param.s[0] = ncolors;
15:
16: /* Color structure in library uses int for pixel,
17: but protocol's ColorDef wants a short;
18: thus, data must be copied */
19: {
20: int nbytes = ncolors*sizeof(ColorDef);
21: register int i;
22: register ColorDef *proto_defs = (ColorDef *) malloc (nbytes);
23: for (i=0;i<ncolors;i++) {
24: proto_defs[i].pixel = defs[i].pixel;
25: proto_defs[i].red = defs[i].red;
26: proto_defs[i].green = defs[i].green;
27: proto_defs[i].blue = defs[i].blue;
28: }
29: Data (dpy, proto_defs, nbytes);
30: free (proto_defs);
31: }
32: }
Defined functions
XStoreColors
defined in line
7; used 18 times
- in /usr/src/new/X/libnest/nest.c line
707
- in /usr/src/new/X/pikapix/pikapix.c line
138,
166,
269,
308,
314,
327,
371,
392,
470,
487,
495,
503,
514,
533-539(3),
550