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

#include "ragmaan.h"

extern char *read_words_from_file (const char *file_name, size_t * db_size);

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

extern int create_hash (HASH_TABLE_T * ht, char *words, size_t db_size,
			progress_callback_t pc);

/*     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
