bd44b5aa08
Test / build-libghostty-vt (x86_64-windows-gnu) (push) Has been cancelled
Test / build-libghostty-vt-macos (aarch64-ios) (push) Has been cancelled
Test / build-libghostty-vt-macos (aarch64-macos) (push) Has been cancelled
Test / build-libghostty-vt-macos (x86_64-macos) (push) Has been cancelled
Test / build-nix (namespace-profile-ghostty-md-arm64) (push) Has been cancelled
Test / build-dist (push) Has been cancelled
Test / GTK x11=true wayland=true (push) Has been cancelled
Test / Build -Dsimd=false (push) Has been cancelled
Test / Build -Dsimd=true (push) Has been cancelled
Test / Build -Dsentry=false (push) Has been cancelled
Test / Build -Dsentry=true (push) Has been cancelled
Test / zig-fmt (push) Has been cancelled
Test / GitHub Actions Pins (push) Has been cancelled
Test / prettier (push) Has been cancelled
Test / swiftlint (push) Has been cancelled
Test / alejandra (push) Has been cancelled
Test / typos (push) Has been cancelled
Nix / Required Checks: Nix (push) Has been cancelled
Nix / check-zig-cache-hash (push) Has been cancelled
Test / skip (push) Has been cancelled
Test / Required Checks: Test (push) Has been cancelled
Test / build-bench (push) Has been cancelled
Test / list-examples (push) Has been cancelled
Test / Example ${{ matrix.dir }} (Windows) (push) Has been cancelled
Test / build-cmake (push) Has been cancelled
Test / test-lib-vt-pkgconfig (push) Has been cancelled
Test / build-flatpak (push) Has been cancelled
Test / build-snap (push) Has been cancelled
Test / build-libghostty-vt (aarch64-linux) (push) Has been cancelled
Test / build-libghostty-vt (aarch64-macos) (push) Has been cancelled
Test / build-libghostty-vt (wasm32-freestanding) (push) Has been cancelled
Test / build-libghostty-vt (x86_64-linux) (push) Has been cancelled
Test / build-libghostty-vt (x86_64-linux-musl) (push) Has been cancelled
Test / build-libghostty-vt (x86_64-macos) (push) Has been cancelled
Test / build-libghostty-vt-android (aarch64-linux-android) (push) Has been cancelled
Test / build-libghostty-vt-android (arm-linux-androideabi) (push) Has been cancelled
Test / build-libghostty-vt-android (x86_64-linux-android) (push) Has been cancelled
Test / build-libghostty-vt-windows (push) Has been cancelled
Test / build-libghostty-windows-gnu (push) Has been cancelled
Test / build-linux (namespace-profile-ghostty-md) (push) Has been cancelled
Test / build-linux (namespace-profile-ghostty-md-arm64) (push) Has been cancelled
Test / build-linux-libghostty (push) Has been cancelled
Test / build-nix (namespace-profile-ghostty-md) (push) Has been cancelled
Test / build-dist-lib-vt (push) Has been cancelled
Test / trigger-snap (push) Has been cancelled
Test / trigger-flatpak (push) Has been cancelled
Test / build-macos (push) Has been cancelled
Test / build-macos-freetype (push) Has been cancelled
Test / test (push) Has been cancelled
Test / test-lib-vt (push) Has been cancelled
Test / GTK x11=false wayland=false (push) Has been cancelled
Test / GTK x11=true wayland=false (push) Has been cancelled
Test / GTK x11=false wayland=true (push) Has been cancelled
Test / test-macos (push) Has been cancelled
Test / test-windows (push) Has been cancelled
Test / Build -Di18n=false (push) Has been cancelled
Test / Build -Di18n=true (push) Has been cancelled
Test / Build test/fuzz-libghostty (push) Has been cancelled
Test / shellcheck (push) Has been cancelled
Test / translations (push) Has been cancelled
Test / blueprint-compiler (push) Has been cancelled
Test / Test pkg/wuffs (push) Has been cancelled
Test / Test build on Debian 13 (push) Has been cancelled
Test / valgrind (push) Has been cancelled
Test / Example ${{ matrix.dir }} (push) Has been cancelled
151 lines
3.3 KiB
C
151 lines
3.3 KiB
C
/**
|
|
* @file build_info.h
|
|
*
|
|
* Build info - query compile-time build configuration of libghostty-vt.
|
|
*/
|
|
|
|
#ifndef GHOSTTY_VT_BUILD_INFO_H
|
|
#define GHOSTTY_VT_BUILD_INFO_H
|
|
|
|
/** @defgroup build_info Build Info
|
|
*
|
|
* Query compile-time build configuration of libghostty-vt.
|
|
*
|
|
* These values reflect the options the library was built with and are
|
|
* constant for the lifetime of the process.
|
|
*
|
|
* ## Basic Usage
|
|
*
|
|
* Use ghostty_build_info() to query individual build options:
|
|
*
|
|
* @snippet c-vt-build-info/src/main.c build-info-query
|
|
*
|
|
* @{
|
|
*/
|
|
|
|
#include <stddef.h>
|
|
#include <stdbool.h>
|
|
|
|
#include <ghostty/vt/types.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/**
|
|
* Build optimization mode.
|
|
*/
|
|
typedef enum GHOSTTY_ENUM_TYPED {
|
|
GHOSTTY_OPTIMIZE_DEBUG = 0,
|
|
GHOSTTY_OPTIMIZE_RELEASE_SAFE = 1,
|
|
GHOSTTY_OPTIMIZE_RELEASE_SMALL = 2,
|
|
GHOSTTY_OPTIMIZE_RELEASE_FAST = 3,
|
|
GHOSTTY_OPTIMIZE_MODE_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
|
|
} GhosttyOptimizeMode;
|
|
|
|
/**
|
|
* Build info data types that can be queried.
|
|
*
|
|
* Each variant documents the expected output pointer type.
|
|
*/
|
|
typedef enum GHOSTTY_ENUM_TYPED {
|
|
/** Invalid data type. Never results in any data extraction. */
|
|
GHOSTTY_BUILD_INFO_INVALID = 0,
|
|
|
|
/**
|
|
* Whether SIMD-accelerated code paths are enabled.
|
|
*
|
|
* Output type: bool *
|
|
*/
|
|
GHOSTTY_BUILD_INFO_SIMD = 1,
|
|
|
|
/**
|
|
* Whether Kitty graphics protocol support is available.
|
|
*
|
|
* Output type: bool *
|
|
*/
|
|
GHOSTTY_BUILD_INFO_KITTY_GRAPHICS = 2,
|
|
|
|
/**
|
|
* Whether tmux control mode support is available.
|
|
*
|
|
* Output type: bool *
|
|
*/
|
|
GHOSTTY_BUILD_INFO_TMUX_CONTROL_MODE = 3,
|
|
|
|
/**
|
|
* The optimization mode the library was built with.
|
|
*
|
|
* Output type: GhosttyOptimizeMode *
|
|
*/
|
|
GHOSTTY_BUILD_INFO_OPTIMIZE = 4,
|
|
|
|
/**
|
|
* The full version string (e.g. "1.2.3" or "1.2.3-dev+abcdef").
|
|
*
|
|
* Output type: GhosttyString *
|
|
*/
|
|
GHOSTTY_BUILD_INFO_VERSION_STRING = 5,
|
|
|
|
/**
|
|
* The major version number.
|
|
*
|
|
* Output type: size_t *
|
|
*/
|
|
GHOSTTY_BUILD_INFO_VERSION_MAJOR = 6,
|
|
|
|
/**
|
|
* The minor version number.
|
|
*
|
|
* Output type: size_t *
|
|
*/
|
|
GHOSTTY_BUILD_INFO_VERSION_MINOR = 7,
|
|
|
|
/**
|
|
* The patch version number.
|
|
*
|
|
* Output type: size_t *
|
|
*/
|
|
GHOSTTY_BUILD_INFO_VERSION_PATCH = 8,
|
|
|
|
/**
|
|
* The pre metadata string (e.g. "alpha", "beta", "dev"). Has zero length if
|
|
* no pre metadata is present.
|
|
*
|
|
* Output type: GhosttyString *
|
|
*/
|
|
GHOSTTY_BUILD_INFO_VERSION_PRE = 9,
|
|
|
|
/**
|
|
* The build metadata string (e.g. commit hash). Has zero length if
|
|
* no build metadata is present.
|
|
*
|
|
* Output type: GhosttyString *
|
|
*/
|
|
GHOSTTY_BUILD_INFO_VERSION_BUILD = 10,
|
|
GHOSTTY_BUILD_INFO_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
|
|
} GhosttyBuildInfo;
|
|
|
|
/**
|
|
* Query a compile-time build configuration value.
|
|
*
|
|
* The caller must pass a pointer to the correct output type for the
|
|
* requested data (see GhosttyBuildInfo variants for types).
|
|
*
|
|
* @param data The build info field to query
|
|
* @param out Pointer to store the result (type depends on data parameter)
|
|
* @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if the
|
|
* data type is invalid
|
|
*
|
|
* @ingroup build_info
|
|
*/
|
|
GHOSTTY_API GhosttyResult ghostty_build_info(GhosttyBuildInfo data, void *out);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
/** @} */
|
|
|
|
#endif /* GHOSTTY_VT_BUILD_INFO_H */
|