/*
 * This file is part of Freecell Solver. It is subject to the license terms in
 * the COPYING.txt file found in the top-level directory of this distribution
 * and at http://fc-solve.shlomifish.org/docs/distro/COPYING.html . No part of
 * Freecell Solver, including this file, may be copied, modified, propagated,
 * or distributed except according to the terms contained in the COPYING file.
 *
 * Copyright (c) 2000 Shlomi Fish
 */

/*
 * config.h - Configuration file for Freecell Solver
 *
 * ${AUTOGENERATED_CONFIG_H}
*/
#pragma once

#ifdef __cplusplus
extern "C" {
#endif

#include "fcs_back_compat.h"

#cmakedefine COMPACT_STATES
#cmakedefine INDIRECT_STACK_STATES

#cmakedefine FCS_RCS_STATES
#cmakedefine CARD_DEBUG_PRES

/* The size of a single pack in alloc.c/alloc.h measured in 1024 chars. */
#cmakedefine FCS_IA_PACK_SIZE ${FCS_IA_PACK_SIZE}

#ifndef FCS_FREECELL_ONLY
#cmakedefine FCS_FREECELL_ONLY
#endif

#cmakedefine FCS_DISABLE_SIMPLE_SIMON
#cmakedefine FCS_SINGLE_HARD_THREAD
#cmakedefine FCS_WITHOUT_FC_PRO_MOVES_COUNT
#cmakedefine FCS_WITHOUT_TRIM_MAX_STORED_STATES
/*
 * Get rid of the visited_iter counter on each state's extra_info. It is
 * used a little for debugging, but otherwise is not needed for the run-time
 * operation.
 * */
#cmakedefine FCS_WITHOUT_VISITED_ITER
/*
 * Disable the patsolve code at compile time in case it isn't wanted.
 * */
#ifndef FCS_DISABLE_PATSOLVE
#cmakedefine FCS_DISABLE_PATSOLVE
#endif
/*
 * Get rid of the "depth" field on each state's extra_info. It is
 * used a little, but otherwise is not needed for the run-time
 * operation.
 * */
#cmakedefine FCS_WITHOUT_DEPTH_FIELD
#cmakedefine FCS_WITHOUT_CMD_LINE_HELP
#cmakedefine FCS_WITHOUT_ITER_HANDLER
#cmakedefine FCS_WITHOUT_MAX_NUM_STATES
#cmakedefine FCS_DISABLE_MULTI_FLARES
#cmakedefine FCS_DISABLE_MULTI_NEXT_INSTS
#cmakedefine FCS_DISABLE_MOVES_TRACKING
#cmakedefine FCS_DISABLE_NUM_STORED_STATES
#cmakedefine FCS_WITHOUT_EXPORTED_RESUME_SOLUTION
#cmakedefine FCS_DISABLE_STATE_VALIDITY_CHECK
#cmakedefine FCS_ENABLE_PRUNE__R_TF__UNCOND
#cmakedefine FCS_USE_PRECOMPILED_CMD_LINE_THEME
/*
 * This flag controls a hash behaviour. It seems to improve things somewhat.
 * */
#cmakedefine FCS_INLINED_HASH_COMPARISON ${FCS_INLINED_HASH_COMPARISON}
#cmakedefine FCS_INT_BIT_SIZE_LOG2 ${FCS_INT_BIT_SIZE_LOG2}
#cmakedefine FCS_WITH_CONTEXT_VARIABLE
/* This is an integer that specifies the maximal size of identifiers
 * in chars/bytes. */
#cmakedefine FCS_MAX_IDENT_LEN ${FCS_MAX_IDENT_LEN}
/*
 * The size of void*.
 */
@SIZEOF_VOID_P_CODE@

// This flag determines whether we are using the more compact but slower,
// internal move tokens.
#cmakedefine FCS_USE_COMPACT_MOVE_TOKENS
#cmakedefine FCS_HARD_CODED_NUM_FCS_FOR_FREECELL_ONLY ${FCS_HARD_CODED_NUM_FCS_FOR_FREECELL_ONLY}

#ifndef FCS_HARD_CODED_NUM_FCS_FOR_FREECELL_ONLY
#define FCS_HARD_CODED_NUM_FCS_FOR_FREECELL_ONLY 4
#endif


#ifndef FCS_DISABLE_MULTI_FLARES
#define FCS_WITH_FLARES
#endif
#ifndef FCS_DISABLE_MULTI_NEXT_INSTS
#define FCS_WITH_NI
#endif

#ifndef FCS_DISABLE_MOVES_TRACKING
#define FCS_WITH_MOVES
#endif

#ifdef FCS_WITH_MOVES
#define SFS__PASS_MOVE_STACK(arg) , arg
#else
#define SFS__PASS_MOVE_STACK(arg)
#endif

#ifndef FCS_HARD_CODE_SCANS_SYNERGY_AS_TRUE
#cmakedefine FCS_HARD_CODE_SCANS_SYNERGY_AS_TRUE
#endif

#ifndef FCS_HARD_CODE_REPARENT_STATES_AS_FALSE
#cmakedefine FCS_HARD_CODE_REPARENT_STATES_AS_FALSE
#endif

#ifndef FCS_HARD_CODE_CALC_REAL_DEPTH_AS_FALSE
#cmakedefine FCS_HARD_CODE_CALC_REAL_DEPTH_AS_FALSE
#endif
/*
 * The maximal number of Freecells. For efficiency's sake it should be a
 * multiple of 4.
 * */

#ifdef FCS_FREECELL_ONLY
#define HARD_CODED_NUM_FREECELLS FCS_HARD_CODED_NUM_FCS_FOR_FREECELL_ONLY
#define HARD_CODED_NUM_STACKS 8
#define HARD_CODED_NUM_DECKS 1
#ifndef FCS_DISABLE_SIMPLE_SIMON
#define FCS_DISABLE_SIMPLE_SIMON
#endif

#endif

#ifdef HARD_CODED_NUM_FREECELLS
#define MAX_NUM_FREECELLS HARD_CODED_NUM_FREECELLS
#else
#define MAX_NUM_FREECELLS ${MAX_NUM_FREECELLS}
#endif

#cmakedefine FCS_DBM_FREECELLS_NUM ${FCS_DBM_FREECELLS_NUM}

/*
 * The maximal number of Stacks. For efficiency's sake it should be a
 * multiple of 4.
 * */

#ifdef HARD_CODED_NUM_STACKS
#define MAX_NUM_STACKS HARD_CODED_NUM_STACKS
#else
#define MAX_NUM_STACKS ${MAX_NUM_STACKS}
#endif
/*
 * The maximal number of initial cards that can be found in a stack.
 * */
#define MAX_NUM_INITIAL_CARDS_IN_A_STACK ${MAX_NUM_INITIAL_CARDS_IN_A_STACK}

#ifdef HARD_CODED_NUM_DECKS
#define MAX_NUM_DECKS HARD_CODED_NUM_DECKS
#else
#define MAX_NUM_DECKS ${MAX_NUM_DECKS}
#endif


#define FCS_STATE_STORAGE_INDIRECT 0
#define FCS_STATE_STORAGE_INTERNAL_HASH 1
#define FCS_STATE_STORAGE_LIBAVL2_TREE 2
#define FCS_STATE_STORAGE_LIBREDBLACK_TREE 3
#define FCS_STATE_STORAGE_GLIB_TREE 4
#define FCS_STATE_STORAGE_GLIB_HASH 5
#define FCS_STATE_STORAGE_DB_FILE 6
#define FCS_STATE_STORAGE_JUDY 7
#define FCS_STATE_STORAGE_GOOGLE_DENSE_HASH 8
#define FCS_STATE_STORAGE_KAZ_TREE 9

#define FCS_STACK_STORAGE_NULL (-1)
#define FCS_STACK_STORAGE_INTERNAL_HASH 0
#define FCS_STACK_STORAGE_LIBAVL2_TREE 1
#define FCS_STACK_STORAGE_LIBREDBLACK_TREE 2
#define FCS_STACK_STORAGE_GLIB_TREE 3
#define FCS_STACK_STORAGE_GLIB_HASH 4
#define FCS_STACK_STORAGE_JUDY 5
#define FCS_STACK_STORAGE_GOOGLE_DENSE_HASH 6

#define FCS_STATE_STORAGE ${FCS_STATE_STORAGE}
#define FCS_STACK_STORAGE ${FCS_STACK_STORAGE}

#define FCS_RCS_CACHE_STORAGE_JUDY 0
#define FCS_RCS_CACHE_STORAGE_KAZ_TREE 1

#define FCS_RCS_CACHE_STORAGE ${FCS_RCS_CACHE_STORAGE}

/* Define to 1 if you have the `m' library (-lm). */
#cmakedefine HAVE_LIBM
#cmakedefine HAVE_STRNCASECMP
#cmakedefine HAVE_VASPRINTF
#cmakedefine FCS_USE_INT128_FOR_VAR_BASE

/* Name of package */
#define PACKAGE "${PACKAGE}"

/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "${PACKAGE_BUGREPORT}"

/* Define to the full name of this package. */
#define PACKAGE_NAME "${PACKAGE_NAME}"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "${PACKAGE_STRING}"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "${PACKAGE_TARNAME}"

/* Define to the version of this package. */
#define PACKAGE_VERSION "${PACKAGE_VERSION}"

/* Version number of package */
#define VERSION "${VERSION}"

#ifndef FCS_INT_BIT_SIZE_LOG2
#define FCS_INT_BIT_SIZE_LOG2 ((sizeof(int) == 8) ? 6 : (sizeof(int) == 2) ? 4 : 5)
#endif

#define FCS_WHICH_STATES_GOOGLE_HASH__DENSE  0
#define FCS_WHICH_STATES_GOOGLE_HASH__SPARSE 1

#define FCS_WHICH_COLUMNS_GOOGLE_HASH__DENSE  0
#define FCS_WHICH_COLUMNS_GOOGLE_HASH__SPARSE 1

#define FCS_WHICH_COLUMNS_GOOGLE_HASH ${FCS_WHICH_COLUMNS_GOOGLE_HASH}
#define FCS_WHICH_STATES_GOOGLE_HASH ${FCS_WHICH_STATES_GOOGLE_HASH}

#if defined(FCS_RCS_STATES) && (!defined(COMPACT_STATES) )
#error FCS_RCS_STATES requires COMPACT_STATES
#endif

#ifdef _WIN32
#define plan_tests(...) plan(__VA_ARGS__)
#endif

#ifdef _POSIX_C_SOURCE
#if _POSIX_C_SOURCE > 200809L
#define HAVE_GETLINE 1
#endif
#endif

#if (defined(HARD_CODED_NUM_FREECELLS) && defined(HARD_CODED_NUM_STACKS) &&  \
         defined(HARD_CODED_NUM_DECKS))
#define HARD_CODED_ALL
#define HARD__SET_GAME_PARAMS()
#else
#define HARD__SET_GAME_PARAMS() SET_GAME_PARAMS()
#endif
#ifdef FCS_ENABLE_PRUNE__R_TF__UNCOND
#define freecell_solver_user_set_pruning(...)
#endif

#ifdef __cplusplus
}
#endif
