/* $Id: chash.h,v 1.2 2009/01/04 18:44:39 kiesling Exp $ */

/*
  This file is part of Ctalk.
  Copyright © 2005-2009  Robert Kiesling, ctalk@ctalklang.org.
  Permission is granted to copy this software provided that this copyright
  notice is included in all source code modules.

  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2 of the License, or (at your option) any later version.

  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  Lesser General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software Foundation, 
  Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301 USA.
*/

#ifndef _CHASH_H
#define _CHASH_H

typedef struct _h_list HLIST;

struct _h_list {
  char sig[5];
  char s_key[MAXLABEL];
  char source_file[FILENAME_MAX];
  int error_line,
    error_column;
  int hits;
  void *data;
  void *obj;
  struct _h_list *next,
    *prev;
};

typedef struct _hashbucket{
  char sig[4];
  HLIST *mbrs,
    *mbrs_head;
} HASHBUCKET;

typedef HASHBUCKET **HASHTAB;

#define IS_HLIST(x) (!memcmp ((void *)x, "HLIST", 5))

#endif /* _PHASH_H */
