~ubuntu-branches/ubuntu/saucy/freecell-solver/saucy

« back to all changes in this revision

Viewing changes to dbm_lru_cache.h

  • Committer: Package Import Robot
  • Author(s): Gergely Risko
  • Date: 2012-06-22 10:08:05 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20120622100805-evoda1ccdr8vt5xr
Tags: 3.12.0-1
New upstream version. (closes: #675262)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef FC_SOLVE_DBM_LRU_CACHE_H
 
2
#define FC_SOLVE_DBM_LRU_CACHE_H
 
3
 
 
4
#ifdef __cplusplus
 
5
extern "C"
 
6
{
 
7
#endif
 
8
 
 
9
#include "generic_tree.h"
 
10
#include "fcc_brfs_test.h"
 
11
 
 
12
struct fcs_cache_key_info_struct
 
13
{
 
14
    fcs_encoded_state_buffer_t key;
 
15
    fcs_fcc_move_t * moves_to_key;
 
16
    /* lower_pri and higher_pri form a doubly linked list.
 
17
     *
 
18
     * pri == priority.
 
19
     * */
 
20
    struct fcs_cache_key_info_struct * lower_pri, * higher_pri;
 
21
};
 
22
 
 
23
typedef struct fcs_cache_key_info_struct fcs_cache_key_info_t;
 
24
 
 
25
typedef struct
 
26
{
 
27
#if (FCS_RCS_CACHE_STORAGE == FCS_RCS_CACHE_STORAGE_JUDY)
 
28
    Pvoid_t states_values_to_keys_map;
 
29
#elif (FCS_RCS_CACHE_STORAGE == FCS_RCS_CACHE_STORAGE_KAZ_TREE)
 
30
    dict_t * kaz_tree;
 
31
#else
 
32
#error unknown FCS_RCS_CACHE_STORAGE
 
33
#endif
 
34
    fcs_compact_allocator_t states_values_to_keys_allocator;
 
35
    long count_elements_in_cache, max_num_elements_in_cache;
 
36
 
 
37
    fcs_cache_key_info_t * lowest_pri, * highest_pri;
 
38
 
 
39
#define RECYCLE_BIN_NEXT(el) ((el)->higher_pri)
 
40
    fcs_cache_key_info_t * recycle_bin;
 
41
} fcs_lru_cache_t;
 
42
 
 
43
#ifdef __cplusplus
 
44
}
 
45
#endif
 
46
 
 
47
#endif /* FC_SOLVE_DBM_LRU_CACHE_H */