gfxd_sys/
execution.rs

1/* SPDX-FileCopyrightText: © 2025 Decompollaborate */
2/* SPDX-License-Identifier: MIT */
3
4//! Disassemble the `Gfx` packets.
5//!
6//! Decompilation is started using the [`gfxd_execute`] function. When gfxd is
7//! executing (i.e. after [`gfxd_execute`] has been entered, and before it
8//! returns), the general settings and the I/O settings should not be changed.
9
10use crate::ffi;
11
12extern "C" {
13    /// Start executing gfxd with the current settings.
14    ///
15    /// For each macro, the macro handler registered with [`gfxd_macro_fn`] is
16    /// called.
17    ///
18    /// Execution ends when the input ends, the macro handler returns non-zero,
19    /// when an invalid macro is encountered and [`gfxd_stop_on_invalid`] is
20    /// enabled, or when `SPBranchList` or `SPEndDisplayList` is encountered
21    /// and [`gfxd_stop_on_end`] is enabled.
22    ///
23    /// If execution ends due to an invalid macro, `-1` is returned.
24    ///
25    /// If execution ends because the macro handler returns non-zero, the
26    /// return value from the macro handler is returned.
27    ///
28    /// Otherwise zero is returned.
29    ///
30    /// [`gfxd_macro_fn`]: crate::handlers::gfxd_macro_fn
31    /// [`gfxd_stop_on_invalid`]: crate::settings::gfxd_stop_on_invalid
32    /// [`gfxd_stop_on_end`]: crate::settings::gfxd_stop_on_end
33    pub fn gfxd_execute() -> ffi::c_int;
34}