import ctypes
import sys
from pathlib import Path
lib_path = Path("target/debug/libproofmode.so")
if not lib_path.exists():
lib_path = Path("target/debug/libproofmode.dylib")
if not lib_path.exists():
print("ERROR: Library not found")
sys.exit(1)
try:
lib = ctypes.CDLL(str(lib_path))
print(f"✓ Successfully loaded library: {lib_path}")
uniffi_functions = [
"uniffi_proofmode_checksum_func_get_version",
"uniffi_proofmode_checksum_func_get_file_hash",
"uniffi_proofmode_checksum_func_generate_proof_mobile",
"uniffi_proofmode_checksum_func_check_files_mobile"
]
available_functions = []
for func_name in uniffi_functions:
try:
func = getattr(lib, func_name)
available_functions.append(func_name)
print(f"✓ Found UniFFI function: {func_name}")
except AttributeError:
print(f"✗ Missing UniFFI function: {func_name}")
print(f"\nSummary: {len(available_functions)}/{len(uniffi_functions)} UniFFI functions available")
if len(available_functions) > 0:
print("\n✓ UniFFI scaffolding is properly exported from the Rust library")
print("✓ Language bindings can use these functions via FFI")
print("✓ The placeholder bindings can be replaced with real UniFFI calls")
else:
print("\n✗ No UniFFI functions found - check if library was built with --features uniffi")
except Exception as e:
print(f"ERROR loading library: {e}")
sys.exit(1)