luadec_sys/
lib.rs

1//! Raw FFI bindings for LuaDec
2//!
3//! This crate provides low-level FFI bindings to the LuaDec C library.
4//! For a high-level safe API, use the `luadec` crate instead.
5
6#![allow(non_camel_case_types)]
7#![allow(non_snake_case)]
8#![allow(non_upper_case_globals)]
9
10use libc::{c_char, size_t};
11
12/// Opaque structure representing the decompile result from C
13#[repr(C)]
14pub struct DecompileResult {
15    _private: [u8; 0],
16}
17
18extern "C" {
19    /// Decompile bytecode from a buffer
20    pub fn luadec_decompile_buffer(bytecode: *const c_char, size: size_t) -> *mut DecompileResult;
21    
22    /// Free the result structure
23    pub fn luadec_free_result(result: *mut DecompileResult);
24    
25    /// Get the decompiled result string (NULL if error occurred)
26    pub fn luadec_get_result(result: *const DecompileResult) -> *const c_char;
27    
28    /// Get the error string (NULL if no error)
29    pub fn luadec_get_error(result: *const DecompileResult) -> *const c_char;
30}