Contact us

LibReviewQA

Platform acceptance test library: wrapping add and saturating multiply.

LibraryBy SignalPlus

GetOpens in SignalPlus OS. Sign in to install.
Ratings
—
No ratings yet
Price
Free
Version
1
Nov 6, 2026
Developer
SignalPlus

About this library

LibReviewQA

Small integer helpers (wrapping add, saturating multiply) published by the platform team to exercise Marketplace Library review end to end. Pure compute — the consuming app passes integers in and gets integers back; the library performs no I/O and keeps no state.

Interface

All functions use the C ABI (see include/01a1b01b-9b1a-7271-9366-b36f2024e789.h). Scalars only.

sp2_01a1b01b_9b1a_7271_9366_b36f2024e789_init() -> i32

One-time initialisation. The consuming app MUST call this exactly once from its init() before any other function. Returns 0 on success.

| Return | Meaning | | ------ | ------- | | 0 | success (the only value returned) |

sp2_01a1b01b_9b1a_7271_9366_b36f2024e789_add(a: i32, b: i32) -> i32

Returns a + b with two's-complement wrapping on overflow (for example add(i32::MAX, 1) == i32::MIN). Never fails.

sp2_01a1b01b_9b1a_7271_9366_b36f2024e789_mul_saturating(a: i32, b: i32) -> i32

Returns a * b, clamped to i32::MIN / i32::MAX when the exact product does not fit (for example mul_saturating(65536, 65536) == i32::MAX). Never fails.

Usage in a consuming app

backend/Cargo.toml (rename the dependency — the raw crate name is not a valid Rust identifier):

[dependencies]
mylib = { package = "sp2019e3a82f6bc77ee9a56cfbd377c5f5f-01a1b01b-9b1a-7271-9366-b36f2024e789-sys", version = "0.1.2", registry = "sp2-cargo" }

backend/src/lib.rs:

fn try_init() -> Result<(), String> {
    let rc = unsafe { mylib::sp2_01a1b01b_9b1a_7271_9366_b36f2024e789_init() };
    if rc != 0 {
        return Err(format!("lib init failed: {rc}"));
    }
    let sum = unsafe { mylib::sp2_01a1b01b_9b1a_7271_9366_b36f2024e789_add(1, 2) };
    let product = unsafe { mylib::sp2_01a1b01b_9b1a_7271_9366_b36f2024e789_mul_saturating(sum, 7) };
    let _ = product;
    Ok(())
}

Deployed apps pin exact versions via Cargo.lock.

Versioning & compatibility

  • Entitlement is per-lib: one purchase unlocks all released versions; a version priced above what was already paid costs the difference, and zero-difference upgrades apply automatically.
  • Breaking the C ABI (changing/removing an exported symbol) requires a new major version.
  • 0.1.x: initial interface (init, add, mul_saturating).

Pricing & entitlement notes

Free test library for platform acceptance; no expiry.

What's new

Version 1 · Nov 6, 2026

0.1.2: initial interface (init, add, mul_saturating).

Information

Developer
SignalPlus
Type
Library
Price
Free
Remix
Not open to remix
Listed
Nov 6, 2026

More from this developer

Apps on the Marketplace are made by independent developers and reviewed by SignalPlus before listing; their descriptions are the developers' own. Nothing here is investment advice or a promise of returns.