libghostty-vt 0.0.0
Loading...
Searching...
No Matches
GhosttyCodepointBuffer Struct Reference

#include <ghostty/vt/types.h>

Data Fields

uint32_t * ptr
size_t cap
size_t len

Detailed Description

A buffer you provide for the library to fill with Unicode codepoints.

Set ptr to an array of uint32_t and cap to the number of elements it holds. The library writes up to cap codepoints and sets len to the total number available. When len is greater than cap, the call returns GHOSTTY_OUT_OF_SPACE and ptr holds only the first cap codepoints.

To learn the count without copying anything, set ptr to NULL and cap to 0, then read len.

This struct has a frozen layout and will not gain fields in future versions.

Examples
c-vt-render/src/main.c.

Definition at line 518 of file types.h.

Field Documentation

◆ cap

size_t cap

Number of uint32_t elements ptr can hold.

Examples
c-vt-render/src/main.c.

Definition at line 523 of file types.h.

◆ len

size_t len

Set by the library to the total number of codepoints, whether or not they all fit.

Examples
c-vt-render/src/main.c.

Definition at line 527 of file types.h.

◆ ptr

uint32_t* ptr

Where codepoints are written. May be NULL when cap is 0.

Definition at line 520 of file types.h.


The documentation for this struct was generated from the following file: