/*
   "hash_func.h" - part of "RAGMAAN, een anagrammengenerator" 

   Copyright (C) 1999 Raymond Zandbergen

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

   This program 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 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., 675 Mass Ave, Cambridge, MA 02139, USA.

   The maintainer of this program is Raymond Zandbergen (ray@wirehub.nl)
 */

#ifndef	RM_HASH_FUNC_H
#define	RM_HASH_FUNC_H

typedef unsigned int HASH2_KEY_T;

typedef struct HASH_TABLE_S
  {

    int nof_words;
    int max_observed_word_length;
    char **words;
    char *dictionary_start;

    int **hash2_table_key;
    char ***hash2_table_string;
    int *hash2_table_length;

    int target_char_count[26];

  }
HASH_TABLE_T;

extern void make_hash2 (const char *s, HASH2_KEY_T * hash2);

/*     creates a hash2-key for a given string
 */

extern void char_count (const char *s, int *chars);

/*     counts the characters in a given string
 */

extern int is_sub (int *chars, int *chars_sub);
extern int is_sub2 (int *chars, const char *sub);
extern int is_sub3 (char *s, char *sub);

/*     see if a string is a subset of another string
 */

extern void subtract (char *total, char *subset);

/*     removes the characters of "subset" from "total"

 *     e.g.  "foobar" - "for" = "abo"
 */

#endif
