libversion-sys
Rust FFI bindings to libversion, an advanced version string comparison library.
The C source is included and compiled from source via CMake -- no system-level installation of libversion is required.
Usage
Add to Cargo.toml:
[]
= "0.1"
Safe API
use Ordering;
use ;
assert_eq!;
assert_eq!;
assert_eq!;
// "p" as patch (post-release) instead of pre-release
assert_eq!;
Raw FFI
use CString;
use ffi;
let v1 = new.unwrap;
let v2 = new.unwrap;
let result = unsafe ;
assert_eq!;
Flags
| Flag | Description |
|---|---|
VERSIONFLAG_P_IS_PATCH |
Treat p as patch (post-release) instead of pre-release |
VERSIONFLAG_ANY_IS_PATCH |
Treat any letter sequence as post-release |
VERSIONFLAG_LOWER_BOUND |
Derive lowest possible version with the given prefix |
VERSIONFLAG_UPPER_BOUND |
Derive highest possible version with the given prefix |
Build requirements
- Rust (stable)
- CMake
- C compiler (gcc/clang)
- libclang (for bindgen)
On Ubuntu/Debian:
License
MIT -- see LICENSE.
The bundled libversion is also MIT licensed.