A freecell_solver_instance_t is allocated by
lib.c
to start solving a board. The logic
of solving a board is present in intrface.c
while the external API functions to use it are implemented in
lib.c
.
After an instance is allocated, it should be parametrised to
specify how it will solve the board. Afterwards,
freecell_solver_init_instance()
should
be called. After that,
freecell_solver_solve_instance()
should
be called for the first time, and
freecell_solver_resume_instance()
afterwards.
(these functions solve until they reach a limit of iterations
number.)
If one would like to use the instance to solve another board,
it is possible to recycle it by calling
freecell_solver_recycle_instance()
. This will
keep its configuration but free all its associated resources, and
thus will not require parsing the command line again.
The function that calls the actual scans is
run_hard_thread()
, which is called from
within freecell_solver_resume_instance()
.