/*
    ragmaan/db_files.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	DB_FILES_H
#define	DB_FILES_H

#include "ragmaan.h"

extern gchar *read_words_from_file (const gchar *file_name, size_t * db_size,
				   void (pc) (void *, gdouble), void *pcdata);

/*     reads a database, returns the size and a gchar pointer
 *     to the start of the database (raw data)
 *     uses a gzip pipe if file_name ends in .gz or .zip
 */

extern gint
create_hash (HASH_TABLE_T * ht, gchar *words, size_t db_size,
	     void (pc) (void *, gdouble), void *pcdata);

/*     creates the hash table, needs the start and the size of the raw data
 *     returns -1 if the data is invalid
 */

extern void free_hash_table (HASH_TABLE_T * ht);

#endif
