/*
    ragmaan/hash_func.h            (C) 2003 Raymond (zandbergen@home.nl)

    "ragmaan" is an anagram generator

    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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

#ifndef	RM_HASH_FUNC_H
#define	RM_HASH_FUNC_H
#include "hash_func.h"

typedef guint32 HASH2_KEY_T;

typedef struct HASH_TABLE_S
{
  gint valid;
  gint nof_words;
  gint max_observed_word_length;
  gchar **words;
  gchar *dictionary_start;
  gint **hash2_table_key;
  gchar ***hash2_table_string;
  gint *hash2_table_length;
  gint target_char_count[26];
}
HASH_TABLE_T;

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

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

extern void char_count (const gchar * s, gint * chars);

/*     counts the characters in a given string
 */

extern gint is_sub (gint * chars, gint * chars_sub);
extern gint is_sub2 (gint * chars, const gchar * sub);
extern gint is_sub3 (gchar * s, gchar * sub);

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

extern void subtract (gchar * total, gint * subset_char_count);
extern void subtract2 (gchar * total, gint * total_char_count,
		       gchar * subset);
extern void subtract3 (gchar * total, gchar * subset);

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

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

#endif
