/* @(#)sh_clrlst.h 22.1 89/08/10 SMI */ /* * Copyright (c) 1988 by Sun Microsystems, Inc. */ #ifndef COLORLIST_SIZE /* * Data object describing the contents of a color map. It's just a variable * length array of red, green and blue values. */ /* A single entry in a color map */ typedef struct { unsigned short red, green, blue; } COLORLIST_ENT; /* a list of them */ typedef struct { unsigned short length; /* number of colors */ COLORLIST_ENT color[2]; /* flexible array */ } COLORLIST; #define COLORLIST_SIZE(length) ((length) * sizeof (COLORLIST_ENT) \ + (sizeof(COLORLIST) - sizeof ((COLORLIST *)0)->color)) #endif