Skip to content

Commit

Permalink
FREEZE.indexed
Browse files Browse the repository at this point in the history
  • Loading branch information
lgarron committed Aug 21, 2023
1 parent afa2a18 commit d5bc5ff
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ path = "./src/rs/main.rs"

[dev-dependencies]
wait-timeout = "0.2.0"

[features]
internal_debug = []
4 changes: 3 additions & 1 deletion src/cpp/ffi/ffi_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
void ffi_api_set_arg(std::string s) ;
void ffi_api_set_kpuzzle_definition(std::string s) ;
std::string ffi_api_solve_scramble(std::string s) ;
std::string ffi_api_solve_position(std::string s) ;
void ffi_api_internal_debug_print_setval_position(std::string s) ;

extern "C" {
void ffi_api_reset();
Expand All @@ -13,6 +13,8 @@ extern "C" {
void ffi_api_cstr_set_kpuzzle_definition(const char *s) ;
const char *ffi_api_cstr_solve_scramble(const char *s) ;
const char *ffi_api_cstr_solve_position(const char *s) ;

void ffi_api_internal_debug_print_setval_position(const char *s) ;
}

#define FFI_FFI_API_H
Expand Down
5 changes: 5 additions & 0 deletions src/rs/internal_debug.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
use crate::options::DebugPrintSetvalArgs;

pub fn debug_print_setval(args: DebugPrintSetvalArgs) -> Result<(), String> {
Ok(())
}
3 changes: 3 additions & 0 deletions src/rs/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
mod internal_debug;
mod options;
mod search;
mod serialize;
Expand Down Expand Up @@ -82,6 +83,8 @@ fn main() {
args.input_args.debug_print_serialized_json,
&None, // TODO: allow custom target pattern?
),
#[cfg(feature = "twsearch_internal_debug")]
options::Command::DebugPrintSetval(args) => debug_print_setval(args),
};
if let Err(err) = result {
eprintln!("{}", err);
Expand Down
9 changes: 9 additions & 0 deletions src/rs/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ pub enum Command {

/// Print completions for the given shell.
Completions(CompletionsArgs),

#[cfg(feature = "twsearch_internal_debug")]
DebugPrintSetval(DebugPrintSetvalArgs),
}

pub trait SetCppArgs {
Expand Down Expand Up @@ -512,3 +515,9 @@ impl SetCppArgs for ServeClientArgs {
}
}
}

#[derive(Args, Debug)]
pub struct DebugPrintSetvalArgs {
#[command(flatten)]
pub input_args: InputDefAndOptionalScrambleFileArgs,
}

0 comments on commit d5bc5ff

Please sign in to comment.