diff --git a/utshell-0.5/r_input/src/lib.rs b/utshell-0.5/r_input/src/lib.rs index 3b044649cbc82c7746800698755e61ede6a11724..317b024bc6e6d99ad9b5818fd650c3880e83af72 100644 --- a/utshell-0.5/r_input/src/lib.rs +++ b/utshell-0.5/r_input/src/lib.rs @@ -142,4 +142,24 @@ pub struct BASH_INPUT { pub location: INPUT_STREAM, pub getter: Option, pub ungetter: Option, +} + +#[macro_export] +macro_rules! CHECK_TERMSIG { + () => { + if terminating_signal != 0 { + termsig_handler(terminating_signal); + } + }; +} +#[macro_export] +macro_rules! QUIT { + () => { + if terminating_signal != 0 { + termsig_handler(terminating_signal); + } + if interrupt_state != 0 { + throw_to_top_level(); + } + }; } \ No newline at end of file