/*	@(#)sh_cmapdata.h 1.1 88/07/15 SMI	*/

/*
 * Copyright (c) 1988 by Sun Microsystems, Inc.
 */

/*-
	Data object describing the contents of a color map

	sh_cmapdata.h, Tue Jul 12 16:09:57 1988

 */

/* A single entry in a color map */
struct sh_cmapdata_ent {
    unsigned short red, green, blue;
};

struct sh_cmapdata {
    unsigned short length;	/* number of colors */
    struct sh_cmapdata_ent color[2];	/* flexible array */
};

#define CMAPDATA_SIZE(length) ((length) * sizeof(struct sh_cmapdata_ent) \
	+ (sizeof(struct sh_cmapdata) \
	   - sizeof ((struct sh_cmapdata *)0)->color))
