/* ===========================================================================
*
*                            PUBLIC DOMAIN NOTICE
*               National Center for Biotechnology Information
*
*  This software/database is a "United States Government Work" under the
*  terms of the United States Copyright Act.  It was written as part of
*  the author's official duties as a United States Government employee and
*  thus cannot be copyrighted.  This software/database is freely available
*  to the public for use. The National Library of Medicine and the U.S.
*  Government have not placed any restriction on its use or reproduction.
*
*  Although all reasonable efforts have been taken to ensure the accuracy
*  and reliability of the software and data, the NLM and the U.S.
*  Government do not and cannot warrant the performance or results that
*  may be obtained by using this software or data. The NLM and the U.S.
*  Government disclaim all warranties, express or implied, including
*  warranties of performance, merchantability or fitness for any particular
*  purpose.
*
*  Please cite the author in any work or product based on this material.
*
* ===========================================================================*/
#ifndef __BLAST_CONFIG__
#define __BLAST_CONFIG__
#ifdef __cplusplus
extern "C" {
#endif

/* Many state variables for the blast library functions are stored here */
/************************************************************************
	When changing this structure, be sure to coordinate with the default
	values set in config.c!
************************************************************************/
typedef struct _blast_config {
		struct _blast_config	PNTR next;
		BLAST_Error	blast_errno;
		Nlm_VoidPtr		(LIBCALLBACK *malloc) PROTO((size_t));
		Nlm_VoidPtr		(LIBCALLBACK *calloc) PROTO((size_t));
		Nlm_VoidPtr		(LIBCALLBACK *realloc) PROTO((Nlm_VoidPtr,size_t));
		void		(LIBCALLBACK *free) PROTO((Nlm_VoidPtr));
		Nlm_Boolean	refined_stats;
		Nlm_Boolean	consistency;
		double		(LIBCALLBACK *sump) PROTO((int,double));
		double		sump_epsilon;
		int			K_iter;
		double		K_sumlimit;
		int			Lambda_iter;
		double		Lambda_accuracy;
		double		Lambda0; /* initial guess for Lambda calculations */
		double		poissonp_accuracy;
		double		consistp_accuracy;
		double		gapdecayrate;
		Nlm_Boolean	exact_words;
		Nlm_Boolean	neighborhood_words;
		Nlm_Boolean	map_words;
		Nlm_VoidPtr	fill;
	} BLAST_Config, PNTR BLAST_ConfigPtr;


#define BLAST_WORDSIZE_MIN  1
#define BLAST_WORDSIZE_MAX  32
 
#define BLAST_WF_EXACT_WORDS_DEFAULT TRUE
#define BLAST_WF_MAP_WORDS_DEFAULT TRUE
#define BLAST_WF_NH_WORDS_DEFAULT   TRUE
  
BLAST_EXTERN BLAST_ConfigPtr	blast_config; /* the current configuration */

BLAST_Error LIBCALL _blast_config_init PROTO((void));

BLAST_ConfigPtr LIBCALL BlastConfigNew PROTO((void));
void LIBCALL BlastConfigDestruct PROTO((BLAST_ConfigPtr));
BLAST_Error LIBCALL BlastConfigSave PROTO((BLAST_ConfigPtr stp));
BLAST_Error LIBCALL BlastConfigRestore PROTO((BLAST_ConfigPtr stp, Nlm_Boolean resterr));
BLAST_Error LIBCALL BlastConfigPush PROTO((void));
BLAST_Error LIBCALL BlastConfigPop PROTO((Nlm_Boolean poperr));

#ifdef __cplusplus
}
#endif
#endif /* !__BLAST_CONFIG__ */
