verovioxide-sys 0.1.0

Raw FFI bindings to the Verovio music engraving library
docs.rs failed to build verovioxide-sys-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: verovioxide-sys-0.0.1

Raw FFI bindings to the Verovio C++ library.

This crate provides unsafe, low-level bindings to the Verovio music engraving library via its C wrapper API. For a safe, idiomatic Rust API, use the verovioxide crate instead.

Safety

All functions in this crate are unsafe and require careful handling:

  • Toolkit pointers must be valid and non-null (obtained from constructor functions)
  • String pointers must be valid null-terminated C strings
  • Returned string pointers are owned by the toolkit and may be invalidated by subsequent calls
  • The toolkit must be properly destroyed with vrvToolkit_destructor to avoid memory leaks

Example

use std::ffi::{CStr, CString};
use verovioxide_sys::*;

unsafe {
    // Create a toolkit instance
    let toolkit = vrvToolkit_constructorNoResource();
    assert!(!toolkit.is_null());

    // Get the version
    let version_ptr = vrvToolkit_getVersion(toolkit);
    let version = CStr::from_ptr(version_ptr).to_string_lossy();
    println!("Verovio version: {}", version);

    // Clean up
    vrvToolkit_destructor(toolkit);
}

Memory Management

  • String values returned by Verovio are stored internally in the toolkit instance
  • These strings remain valid until the next call that returns a string, or until the toolkit is destroyed
  • Callers should copy returned strings if they need to persist beyond the next API call