yaslapi-sys

Crates.ioyaslapi-sys
lib.rsyaslapi-sys
version0.2.5
sourcesrc
created_at2023-04-01 23:57:46.895623
updated_at2024-02-18 20:56:18.521782
descriptionA library that provides bindings to the Yet Another Scripting Language (YASL) API.
homepage
repositoryhttps://github.com/ryco117/yaslapi-sys
max_upload_size
id827764
size717,878
Ryan Andersen (ryco117)

documentation

README

yaslapi-sys

yaslapi-sys is a Rust library that provides raw bindings to the Yet Another Scripting Language (YASL) API.

Installation

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.

Usage

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());
    // ...
}

License

yaslapi-sys is licensed under the MIT License.

Commit count: 0

cargo fmt