Autodecrypt in rust
This commit is contained in:
parent
30b77617e2
commit
b02247fbe6
10
src/lib.rs
10
src/lib.rs
@ -8,10 +8,10 @@ use std::process;
|
||||
const VERSION: &str = "2.0.0";
|
||||
|
||||
extern "C" {
|
||||
fn nmseffect_set_autodecrypt(_: c_int) -> c_void;
|
||||
fn nmseffect_set_clearscr(_: c_int) -> c_void;
|
||||
static mut foregroundColor: c_int;
|
||||
static mut maskBlank: c_int;
|
||||
static mut autoDecrypt: c_int;
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
@ -53,9 +53,11 @@ pub extern "C" fn rust_main() {
|
||||
}
|
||||
}
|
||||
|
||||
if args.autodecrypt {
|
||||
unsafe {
|
||||
nmseffect_set_autodecrypt(1);
|
||||
unsafe {
|
||||
if args.autodecrypt {
|
||||
autoDecrypt = 1;
|
||||
} else {
|
||||
autoDecrypt = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -32,7 +32,7 @@
|
||||
#define REVEAL_LOOP_SPEED 50 // miliseconds between each reveal loop
|
||||
|
||||
// Behavior settings
|
||||
static int autoDecrypt = 0; // Auto-decrypt flag
|
||||
int autoDecrypt = 0; // Auto-decrypt flag
|
||||
int maskBlank = 0; // Mask blank spaces
|
||||
static int colorOn = 1; // Terminal color flag
|
||||
|
||||
@ -290,18 +290,6 @@ char nmseffect_exec(unsigned char *string, int string_len) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the autoDecrypt flag according to the true/false value of the
|
||||
* 'setting' argument. When set to true, nmseffect_exec() will not
|
||||
* require a key press to start the decryption effect.
|
||||
*/
|
||||
void nmseffect_set_autodecrypt(int setting) {
|
||||
if (setting)
|
||||
autoDecrypt = 1;
|
||||
else
|
||||
autoDecrypt = 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Pass the 'setting' argument to the nmstermio module where it will set
|
||||
|
@ -11,7 +11,6 @@
|
||||
// Function prototypes
|
||||
char nmseffect_exec(unsigned char *, int string_len);
|
||||
void nmseffect_set_returnopts(char *);
|
||||
void nmseffect_set_autodecrypt(int);
|
||||
void nmseffect_set_clearscr(int);
|
||||
void nmseffect_use_color(int);
|
||||
void nmseffect_set_input_position(int, int);
|
||||
|
Loading…
Reference in New Issue
Block a user