/***********************************************************
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
and the Massachusetts Institute of Technology, Cambridge, Massachusetts.

                        All Rights Reserved

Permission to use, copy, modify, and distribute this software and its 
documentation for any purpose and without fee is hereby granted, 
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in 
supporting documentation, and that the names of Digital or MIT not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.  

DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.

******************************************************************/
/* $XConsortium: rgb.h,v 1.3 88/09/06 15:48:42 jim Exp $ */

#ifndef RGB_H
#define RGB_H
typedef struct _RGB {
    unsigned short red;
    unsigned short green;
    unsigned short blue;
} RGB;

#define MAX_RGB_NAME	256
struct RGB_ent {
    unsigned short length;
    RGB	rgb;
    char name[MAX_RGB_NAME];
};

#define DO_HASH(hash, src) ((src) + hash ^ hitab[(hash) & HITAB_MASK])
/* hitab comes from ndbm.c */
#define HITAB_MASK	15
static unsigned char hitab[16] = {
    61, 57, 53, 49, 45, 41, 37, 33,
    29, 25, 21, 17, 13,  9,  5,  1
/*
     37,  59,  79, 103,   1,  11,  29,  47,
     71,  97, 113,   5,  19,  41,  61,  83,
    107,   2,  13,  31,  53,  73, 101, 127,
      7,  23,  43,  69,  89, 109,   3,  17

     1,  2,  3,  5,  7, 11, 13, 17,
    19, 23, 29, 31, 37, 41, 43, 47,
    53, 59, 61, 69, 71, 73, 79, 83,
    89, 97,101,103,107,109,113,127 */
};

#endif /* RGB_H */
