Crates.io | yaslapi-sys |
lib.rs | yaslapi-sys |
version | 0.2.5 |
source | src |
created_at | 2023-04-01 23:57:46.895623 |
updated_at | 2024-02-18 20:56:18.521782 |
description | A library that provides bindings to the Yet Another Scripting Language (YASL) API. |
homepage | |
repository | https://github.com/ryco117/yaslapi-sys |
max_upload_size | |
id | 827764 |
size | 717,878 |
yaslapi-sys is a Rust library that provides raw bindings to the Yet Another Scripting Language (YASL) API.
First, you must have CMake and a C compiler installed so that YASL can be compiled locally.
To install yaslapi-sys, add the following to your Cargo.toml
file:
[dependencies]
yaslapi-sys = "0.2.4"
Then run cargo build to build your project.
Here’s an example of how to use yaslapi-sys in your Rust code:
use yaslapi_sys::YASL_State;
use std::ffi::CString;
fn main() {
const SRC: &str = "let x = 5; echo x**x;";
let state: *mut YASL_State = unsafe { yaslapi_sys::YASL_newstate_bb(SRC.as_ptr().cast(), SRC.len()) };
assert!(!state.is_null());
// ...
}
yaslapi-sys is licensed under the MIT License.