# cbindgen configuration for reovim FFI header generation
#
# This generates the C header file `include/reovim.h` which external modules
# can use to interface with the reovim kernel.
#
# Documentation: https://github.com/mozilla/cbindgen/blob/master/docs.md

[defines]

language = "C"

# Header settings
header = """/*
 * reovim.h - C header for reovim external modules
 *
 * This header is auto-generated by cbindgen. Do not edit manually.
 *
 * ABI Version: 1.0.0
 * API Version: 0.2.0
 *
 * External modules must implement the following entry points:
 *
 *   REOVIM_MODULE_API_VERSION  - Static version for pre-load check
 *   reovim_module_probe()      - Returns module metadata
 *   reovim_module_entry()      - Creates module instance
 *   reovim_module_init()       - Initializes module
 *   reovim_module_exit()       - Cleans up module
 *   reovim_module_destroy()    - Frees module memory
 *
 * See docs/architecture/ffi/overview.md for full documentation.
 */
"""

include_guard = "REOVIM_H"
autogen_warning = "/* Warning: this file is autogenerated by cbindgen. Don't modify this manually. */"

# Don't include Rust's built-in types
no_includes = true

# Include standard C types
sys_includes = ["stdint.h", "stdbool.h", "stddef.h"]

# Export settings
[export]
prefix = "Reovim"
include = [
    "Version",
    "ModuleProbe",
    "ABI_VERSION",
    "ABI_VERSION_MAJOR",
    "ABI_VERSION_MINOR",
    "ABI_VERSION_PATCH",
]

# Rename types for C convention
[export.rename]
"Version" = "Version"
"ModuleProbe" = "ModuleProbe"

# Function settings
[fn]
rename_args = "None"

# Struct settings
[struct]
rename_fields = "None"

# Enum settings
[enum]
rename_variants = "None"

# Documentation settings
[documentation]
style = "doxy"
