source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11"
-[[package]]
-name = "cfg-if"
-version = "0.1.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
-
[[package]]
name = "cfg-if"
version = "1.0.0"
"subtle",
]
+[[package]]
+name = "ctrlc"
+version = "3.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b37feaa84e6861e00a1f5e5aa8da3ee56d605c9992d33e082786754828e20865"
+dependencies = [
+ "nix 0.24.1",
+ "winapi",
+]
+
[[package]]
name = "difflib"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"dirs-sys-next",
]
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "46e245f4c8ec30c6415c56cb132c07e69e74f1942f6b4a4061da748b49f486ca"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"rustix",
"windows-sys 0.30.0",
]
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"libc",
"wasi 0.10.2+wasi-snapshot-preview1",
]
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
]
[[package]]
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f404a90a744e32e8be729034fc33b90cf2a56418fbf594d69aa3c0214ad414e5"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"lexical-core",
]
dependencies = [
"arrayvec",
"bitflags",
- "cfg-if 1.0.0",
+ "cfg-if",
"ryu",
"static_assertions",
]
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6389c490849ff5bc16be905ae24bc913a9c8892e19b2341dbc175e14c341c2b8"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
]
[[package]]
[[package]]
name = "nix"
-version = "0.15.0"
+version = "0.23.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3b2e0b4f3320ed72aaedb9a5ac838690a8047c7b275da22711fddff4f8a14229"
+checksum = "9f866317acbd3a240710c63f065ffb1e4fd466259045ccb504130b7f668f35c6"
dependencies = [
"bitflags",
"cc",
- "cfg-if 0.1.10",
+ "cfg-if",
"libc",
- "void",
+ "memoffset",
]
[[package]]
name = "nix"
-version = "0.23.1"
+version = "0.24.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9f866317acbd3a240710c63f065ffb1e4fd466259045ccb504130b7f668f35c6"
+checksum = "8f17df307904acd05aa8e32e97bb20f2a0df1728bbc2d771ae8f9a90463441e9"
dependencies = [
"bitflags",
- "cc",
- "cfg-if 1.0.0",
+ "cfg-if",
"libc",
- "memoffset",
]
[[package]]
checksum = "0c7ae222234c30df141154f159066c5093ff73b63204dcda7121eb082fc56a95"
dependencies = [
"bitflags",
- "cfg-if 1.0.0",
+ "cfg-if",
"foreign-types",
"libc",
"once_cell",
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"instant",
"libc",
"redox_syscall",
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28141e0cc4143da2443301914478dc976a61ffdb3f043058310c70df2fed8954"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"libc",
"redox_syscall",
"smallvec",
checksum = "db7826789c0e25614b03e5a54a0717a86f9ff6e6e5247f92b369472869320039"
dependencies = [
"bitflags",
- "cfg-if 1.0.0",
+ "cfg-if",
"clipboard-win",
"dirs-next",
"fd-lock",
"chrono",
"cpu-time",
"crossterm",
+ "ctrlc",
"dirs-next",
"divrem",
"fxhash",
"libc",
"modular-bitfield",
"native-tls",
- "nix 0.15.0",
"num-rug-adapter",
"openssl",
"ordered-float",
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"fastrand",
"libc",
"redox_syscall",
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4a1bdf54a7c28a2bbf701e1d2233f6c77f473486b94bee4f9678da5a148dca7f"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"pin-project-lite",
"tracing-core",
]
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
-[[package]]
-name = "void"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
-
[[package]]
name = "wait-timeout"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "25f1af7423d8588a3d840681122e72e6a24ddbcb3f0ec385cac0d12d24256c06"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"wasm-bindgen-macro",
]
## Installing Scryer Prolog
-### Native Install (Unix Only)
+### Native Install
First, install the latest stable version of
[Rust](https://www.rust-lang.org/en-US/install.html) using your
The optional `--release` flag will perform various optimizations,
producing a faster executable.
+On Windows, Scryer Prolog is easier to build inside a [MSYS2](https://www.msys2.org/)
+environment as some crates may require native C compilation. However,
+the resulting binary does not need MSYS2 to run. When executing Scryer in a shell, it is recommended to use a more advanced shell than mintty (the default MSYS2 shell). The [Windows Terminal](https://github.com/microsoft/terminal) works correctly.
+
Scryer Prolog must be built with **Rust 1.57 and up**.
-### Docker Install (All Platforms)
+### Docker Install
First, install [Docker](https://docs.docker.com/get-docker/) on Linux,
Windows, or Mac.
fn main() {
- use nix::sys::signal;
+ use std::sync::atomic::Ordering;
use scryer_prolog::*;
- let handler = signal::SigHandler::Handler(handle_sigint);
- unsafe { signal::signal(signal::Signal::SIGINT, handler) }.unwrap();
+ ctrlc::set_handler(move || {
+ scryer_prolog::machine::INTERRUPT.store(true, Ordering::Relaxed);
+ }).unwrap();
let mut wam = machine::Machine::new();
wam.run_top_level();
}
-
-pub extern "C" fn handle_sigint(signal: libc::c_int) {
- use nix::sys::signal;
- use std::sync::atomic::Ordering;
- let signal = signal::Signal::from_c_int(signal).unwrap();
- if signal == signal::Signal::SIGINT {
- scryer_prolog::machine::INTERRUPT.store(true, Ordering::Relaxed);
- }
-}