#ifndef OPENGL_CMN_HTBL_H
#define OPENGL_CMN_HTBL_H

#define  CMN_HASH( val , mod )  val %= mod
#define  CMN_HASH_ELEM_TBL_SIZE 251

typedef struct CMN_HTBL_ELEM_STRUCT
{
    struct CMN_HTBL_ELEM_STRUCT  *next; /* should be 1st */
    void   *data;
    Tint   token;
} CMN_HTBL_ELEM, *cmn_htbl_elem;


typedef struct CMN_HTBL_STRUCT
{
    Tint           size;
    Tint           foo;
    cmn_htbl_elem  ptr[1];
} CMN_HTBL, *cmn_htbl;

/* function prototypes */
extern  cmn_htbl        cmn_create_htbl( Tint );
extern  cmn_htbl_elem   cmn_add_in_htbl( cmn_htbl, Tint, void* );
extern  cmn_htbl_elem   cmn_find_in_htbl( cmn_htbl, Tint, void** );
extern  TStatus         cmn_delete_from_htbl( cmn_htbl, Tint, void** );
extern  cmn_htbl_elem   cmn_get_from_htbl( cmn_htbl, Tint*, void**, cmn_htbl_elem );

#endif
