libghostty-vt 0.0.0
Loading...
Searching...
No Matches
sys.h
Go to the documentation of this file.
1
6
7#ifndef GHOSTTY_VT_SYS_H
8#define GHOSTTY_VT_SYS_H
9
10#include <stdbool.h>
11#include <stddef.h>
12#include <stdint.h>
13#include <ghostty/vt/types.h>
15
37
38#ifdef __cplusplus
39extern "C" {
40#endif
41
54typedef struct {
56 uint32_t width;
57
59 uint32_t height;
60
65 uint8_t* data;
66
72 size_t data_len;
74
78typedef enum GHOSTTY_ENUM_TYPED {
79 GHOSTTY_SYS_LOG_LEVEL_ERROR = 0,
80 GHOSTTY_SYS_LOG_LEVEL_WARNING = 1,
81 GHOSTTY_SYS_LOG_LEVEL_INFO = 2,
82 GHOSTTY_SYS_LOG_LEVEL_DEBUG = 3,
83 GHOSTTY_SYS_LOG_LEVEL_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
85
106typedef void (*GhosttySysLogFn)(
107 void* userdata,
108 GhosttySysLogLevel level,
109 const uint8_t* scope,
110 size_t scope_len,
111 const uint8_t* message,
112 size_t message_len);
113
177typedef bool (*GhosttySysDecodePngFn)(
178 void* userdata,
179 const GhosttyAllocator* allocator,
180 const uint8_t* data,
181 size_t data_len,
182 GhosttySysImage* out);
183
198 void* userdata,
199 uint8_t* buf,
200 size_t len);
201
205typedef enum GHOSTTY_ENUM_TYPED {
212
219
230
250
265 GHOSTTY_SYS_OPT_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
267
282 const void* value);
283
294GHOSTTY_API void ghostty_sys_log_stderr(void* userdata,
295 GhosttySysLogLevel level,
296 const uint8_t* scope,
297 size_t scope_len,
298 const uint8_t* message,
299 size_t message_len);
300
301#ifdef __cplusplus
302}
303#endif
304
306
307#endif /* GHOSTTY_VT_SYS_H */
GhosttyResult
Definition types.h:143
#define GHOSTTY_ENUM_TYPED
Definition types.h:124
GHOSTTY_API GhosttyResult ghostty_sys_set(GhosttySysOption option, const void *value)
void(* GhosttySysLogFn)(void *userdata, GhosttySysLogLevel level, const uint8_t *scope, size_t scope_len, const uint8_t *message, size_t message_len)
Definition sys.h:106
GhosttySysLogLevel
Definition sys.h:78
bool(* GhosttySysRandomSecureFn)(void *userdata, uint8_t *buf, size_t len)
Definition sys.h:197
GHOSTTY_API void ghostty_sys_log_stderr(void *userdata, GhosttySysLogLevel level, const uint8_t *scope, size_t scope_len, const uint8_t *message, size_t message_len)
bool(* GhosttySysDecodePngFn)(void *userdata, const GhosttyAllocator *allocator, const uint8_t *data, size_t data_len, GhosttySysImage *out)
Definition sys.h:177
GhosttySysOption
Definition sys.h:205
@ GHOSTTY_SYS_OPT_DECODE_PNG
Definition sys.h:229
@ GHOSTTY_SYS_OPT_LOG
Definition sys.h:249
@ GHOSTTY_SYS_OPT_INVALID
Definition sys.h:211
@ GHOSTTY_SYS_OPT_RANDOM_SECURE
Definition sys.h:264
@ GHOSTTY_SYS_OPT_USERDATA
Definition sys.h:218
uint32_t width
Definition sys.h:56
uint32_t height
Definition sys.h:59
uint8_t * data
Definition sys.h:65
size_t data_len
Definition sys.h:72