libghostty
Loading...
Searching...
No Matches
types.h File Reference

Go to the source code of this file.

Macros

#define GHOSTTY_INIT_SIZED(type)

Enumerations

enum  GhosttyResult { GHOSTTY_SUCCESS = 0 , GHOSTTY_OUT_OF_MEMORY = -1 , GHOSTTY_INVALID_VALUE = -2 , GHOSTTY_OUT_OF_SPACE = -3 }

Detailed Description

Common types, macros, and utilities for libghostty-vt.

Definition in file types.h.

Macro Definition Documentation

◆ GHOSTTY_INIT_SIZED

#define GHOSTTY_INIT_SIZED ( type)
Value:
((type){ .size = sizeof(type) })

Initialize a sized struct to zero and set its size field.

Sized structs use a size field as the first member for ABI compatibility. This macro zero-initializes the struct and sets the size field to sizeof(type), which allows the library to detect which version of the struct the caller was compiled against.

Parameters
typeThe struct type to initialize
Returns
A zero-initialized struct with the size field set

Example:

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

Definition at line 42 of file types.h.

Enumeration Type Documentation

◆ GhosttyResult

Result codes for libghostty-vt operations.

Enumerator
GHOSTTY_SUCCESS 

Operation completed successfully

GHOSTTY_OUT_OF_MEMORY 

Operation failed due to failed allocation

GHOSTTY_INVALID_VALUE 

Operation failed due to invalid value

GHOSTTY_OUT_OF_SPACE 

Operation failed because the provided buffer was too small

Examples
c-vt-formatter/src/main.c, c-vt-key-encode/src/main.c, and c-vt-sgr/src/main.c.

Definition at line 13 of file types.h.