diff options
| author | Berke Güzel <wenekar1@gmail.com> | 2026-10-15 12:38:28 +0300 |
|---|---|---|
| committer | Berke Güzel <wenekar1@gmail.com> | 2026-10-15 12:38:28 +0300 |
| commit | 86b1eed7dd946d6054eff37cdb7b4a784283e23b (patch) | |
| tree | a8ce1c995aed62d2e67a48a10dee112788b32ff1 /include/term/term.h | |
| parent | 1924e4e0c9c863b641f08224f740feb51bf1bc7d (diff) | |
| parent | 57ebf3b3238a165c1973ecdf96ba79f95d650fc9 (diff) | |
Merge branch 'wt/abi-version' into api-hardening
Diffstat (limited to 'include/term/term.h')
| -rw-r--r-- | include/term/term.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/term/term.h b/include/term/term.h index d413db5..4eea622 100644 --- a/include/term/term.h +++ b/include/term/term.h @@ -41,6 +41,16 @@ struct term_snapshot; #define TERM_SCROLLBACK_DEFAULT 10000 /* + * The version of this header. A host compares TERM_VERSION_CODE with + * term_version() to check that the library matches the header. + */ +#define TERM_VERSION(major, minor, patch) (((major) << 16) | ((minor) << 8) | (patch)) +#define TERM_VERSION_MAJOR 0 +#define TERM_VERSION_MINOR 1 +#define TERM_VERSION_PATCH 0 +#define TERM_VERSION_CODE TERM_VERSION(TERM_VERSION_MAJOR, TERM_VERSION_MINOR, TERM_VERSION_PATCH) + +/* * Colors. A term_color is either a direct color (alpha 0xFF, then RGB) or a * palette slot: an index 0-255, the default foreground, or the default * background. A slot resolves when a snapshot is painted, so a theme change @@ -147,12 +157,17 @@ struct term_options { enum term_cursor_style cursor_style; bool cursor_steady; /* false: the cursor blinks */ struct term_callbacks callbacks; + /* Must be zero. term_new() returns NULL if any word is nonzero, so a + * later version can give a word a meaning. */ + uint32_t reserved[8]; }; /* NULL when memory runs out. */ /* The Unicode version of the width tables, such as "18.0.0". A host can * pass it to programs as UNICODE_VERSION. */ TERM_API const char *term_unicode_version(void); +/* The TERM_VERSION_CODE the library was built with. */ +TERM_API unsigned term_version(void); /* The length of the prefix of buf made of bytes in [0x20, hi). With hi * 0x7f, it finds a run of printable ASCII in UTF-8 text, so a host can |
