libghostty-vt
0.0.0
Toggle main menu visibility
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
>
14
#include <
ghostty/vt/allocator.h
>
15
37
38
#ifdef __cplusplus
39
extern
"C"
{
40
#endif
41
54
typedef
struct
{
56
uint32_t
width
;
57
59
uint32_t
height
;
60
65
uint8_t*
data
;
66
72
size_t
data_len
;
73
}
GhosttySysImage
;
74
78
typedef
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,
84
}
GhosttySysLogLevel
;
85
106
typedef
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
177
typedef
bool (*
GhosttySysDecodePngFn
)(
178
void
* userdata,
179
const
GhosttyAllocator
* allocator,
180
const
uint8_t* data,
181
size_t
data_len,
182
GhosttySysImage
* out);
183
197
typedef
bool (*
GhosttySysRandomSecureFn
)(
198
void
* userdata,
199
uint8_t* buf,
200
size_t
len);
201
205
typedef
enum
GHOSTTY_ENUM_TYPED
{
211
GHOSTTY_SYS_OPT_INVALID
= 0,
212
218
GHOSTTY_SYS_OPT_USERDATA
= 1,
219
229
GHOSTTY_SYS_OPT_DECODE_PNG
= 2,
230
249
GHOSTTY_SYS_OPT_LOG
= 3,
250
264
GHOSTTY_SYS_OPT_RANDOM_SECURE
= 4,
265
GHOSTTY_SYS_OPT_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
266
}
GhosttySysOption
;
267
281
GHOSTTY_API
GhosttyResult
ghostty_sys_set
(
GhosttySysOption
option,
282
const
void
* value);
283
294
GHOSTTY_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 */
allocator.h
GhosttyResult
GhosttyResult
Definition
types.h:143
GHOSTTY_ENUM_TYPED
#define GHOSTTY_ENUM_TYPED
Definition
types.h:124
ghostty_sys_set
GHOSTTY_API GhosttyResult ghostty_sys_set(GhosttySysOption option, const void *value)
GhosttySysLogFn
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
GhosttySysLogLevel
Definition
sys.h:78
GhosttySysRandomSecureFn
bool(* GhosttySysRandomSecureFn)(void *userdata, uint8_t *buf, size_t len)
Definition
sys.h:197
ghostty_sys_log_stderr
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)
GhosttySysDecodePngFn
bool(* GhosttySysDecodePngFn)(void *userdata, const GhosttyAllocator *allocator, const uint8_t *data, size_t data_len, GhosttySysImage *out)
Definition
sys.h:177
GhosttySysOption
GhosttySysOption
Definition
sys.h:205
GHOSTTY_SYS_OPT_DECODE_PNG
@ GHOSTTY_SYS_OPT_DECODE_PNG
Definition
sys.h:229
GHOSTTY_SYS_OPT_LOG
@ GHOSTTY_SYS_OPT_LOG
Definition
sys.h:249
GHOSTTY_SYS_OPT_INVALID
@ GHOSTTY_SYS_OPT_INVALID
Definition
sys.h:211
GHOSTTY_SYS_OPT_RANDOM_SECURE
@ GHOSTTY_SYS_OPT_RANDOM_SECURE
Definition
sys.h:264
GHOSTTY_SYS_OPT_USERDATA
@ GHOSTTY_SYS_OPT_USERDATA
Definition
sys.h:218
GhosttyAllocator
Definition
allocator.h:164
GhosttySysImage
Definition
sys.h:54
GhosttySysImage::width
uint32_t width
Definition
sys.h:56
GhosttySysImage::height
uint32_t height
Definition
sys.h:59
GhosttySysImage::data
uint8_t * data
Definition
sys.h:65
GhosttySysImage::data_len
size_t data_len
Definition
sys.h:72
types.h
include
ghostty
vt
sys.h
Generated by
1.17.0