From 92e2a9937fb2722b27826d58b07ee69c641df500 Mon Sep 17 00:00:00 2001 From: Lucas Garron Date: Mon, 21 Aug 2023 14:42:29 -0700 Subject: [PATCH] FREEZE.indexed --- Cargo.toml | 3 +++ src/cpp/ffi/ffi_api.h | 4 +++- src/rs/internal_debug.rs | 5 +++++ src/rs/main.rs | 3 +++ src/rs/options.rs | 9 +++++++++ 5 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 src/rs/internal_debug.rs diff --git a/Cargo.toml b/Cargo.toml index fb253843..2b3c3252 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,3 +25,6 @@ path = "./src/rs/main.rs" [dev-dependencies] wait-timeout = "0.2.0" + +[features] +internal_debug = [] diff --git a/src/cpp/ffi/ffi_api.h b/src/cpp/ffi/ffi_api.h index df1357e1..2337a770 100644 --- a/src/cpp/ffi/ffi_api.h +++ b/src/cpp/ffi/ffi_api.h @@ -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(); @@ -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 diff --git a/src/rs/internal_debug.rs b/src/rs/internal_debug.rs new file mode 100644 index 00000000..9ef37c5d --- /dev/null +++ b/src/rs/internal_debug.rs @@ -0,0 +1,5 @@ +use crate::options::DebugPrintSetvalArgs; + +pub fn debug_print_setval(args: DebugPrintSetvalArgs) -> Result<(), String> { + Ok(()) +} diff --git a/src/rs/main.rs b/src/rs/main.rs index 74dbeda9..da1d0db2 100644 --- a/src/rs/main.rs +++ b/src/rs/main.rs @@ -1,3 +1,4 @@ +mod internal_debug; mod options; mod search; mod serialize; @@ -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); diff --git a/src/rs/options.rs b/src/rs/options.rs index bd21c04f..cf41b9a2 100644 --- a/src/rs/options.rs +++ b/src/rs/options.rs @@ -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 { @@ -512,3 +515,9 @@ impl SetCppArgs for ServeClientArgs { } } } + +#[derive(Args, Debug)] +pub struct DebugPrintSetvalArgs { + #[command(flatten)] + pub input_args: InputDefAndOptionalScrambleFileArgs, +}