libghostty
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
41
42
#ifdef __cplusplus
43
extern
"C"
{
44
#endif
45
58
typedef
struct
{
60
uint32_t
width
;
61
63
uint32_t
height
;
64
69
uint8_t*
data
;
70
76
size_t
data_len
;
77
}
GhosttySysImage
;
78
82
typedef
enum
GHOSTTY_ENUM_TYPED
{
83
GHOSTTY_SYS_LOG_LEVEL_ERROR = 0,
84
GHOSTTY_SYS_LOG_LEVEL_WARNING = 1,
85
GHOSTTY_SYS_LOG_LEVEL_INFO = 2,
86
GHOSTTY_SYS_LOG_LEVEL_DEBUG = 3,
87
GHOSTTY_SYS_LOG_LEVEL_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
88
}
GhosttySysLogLevel
;
89
110
typedef
void (*
GhosttySysLogFn
)(
111
void
* userdata,
112
GhosttySysLogLevel
level,
113
const
uint8_t* scope,
114
size_t
scope_len,
115
const
uint8_t* message,
116
size_t
message_len);
117
168
typedef
bool (*
GhosttySysDecodePngFn
)(
169
void
* userdata,
170
const
GhosttyAllocator
* allocator,
171
const
uint8_t* data,
172
size_t
data_len,
173
GhosttySysImage
* out);
174
188
typedef
bool (*
GhosttySysRandomSecureFn
)(
189
void
* userdata,
190
uint8_t* buf,
191
size_t
len);
192
196
typedef
enum
GHOSTTY_ENUM_TYPED
{
202
GHOSTTY_SYS_OPT_USERDATA
= 0,
203
213
GHOSTTY_SYS_OPT_DECODE_PNG
= 1,
214
233
GHOSTTY_SYS_OPT_LOG
= 2,
234
248
GHOSTTY_SYS_OPT_RANDOM_SECURE
= 3,
249
GHOSTTY_SYS_OPT_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
250
}
GhosttySysOption
;
251
265
GHOSTTY_API
GhosttyResult
ghostty_sys_set
(
GhosttySysOption
option,
266
const
void
* value);
267
278
GHOSTTY_API
void
ghostty_sys_log_stderr
(
void
* userdata,
279
GhosttySysLogLevel
level,
280
const
uint8_t* scope,
281
size_t
scope_len,
282
const
uint8_t* message,
283
size_t
message_len);
284
285
#ifdef __cplusplus
286
}
287
#endif
288
290
291
#endif
/* GHOSTTY_VT_SYS_H */
allocator.h
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:110
GhosttySysLogLevel
GhosttySysLogLevel
Definition
sys.h:82
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:168
GhosttySysRandomSecureFn
bool(*) GhosttySysRandomSecureFn(void *userdata, uint8_t *buf, size_t len)
Definition
sys.h:188
GhosttySysOption
GhosttySysOption
Definition
sys.h:196
GHOSTTY_SYS_OPT_DECODE_PNG
@ GHOSTTY_SYS_OPT_DECODE_PNG
Definition
sys.h:213
GHOSTTY_SYS_OPT_LOG
@ GHOSTTY_SYS_OPT_LOG
Definition
sys.h:233
GHOSTTY_SYS_OPT_RANDOM_SECURE
@ GHOSTTY_SYS_OPT_RANDOM_SECURE
Definition
sys.h:248
GHOSTTY_SYS_OPT_USERDATA
@ GHOSTTY_SYS_OPT_USERDATA
Definition
sys.h:202
GhosttyAllocator
Definition
allocator.h:209
GhosttySysImage
Definition
sys.h:58
GhosttySysImage::width
uint32_t width
Definition
sys.h:60
GhosttySysImage::height
uint32_t height
Definition
sys.h:63
GhosttySysImage::data
uint8_t * data
Definition
sys.h:69
GhosttySysImage::data_len
size_t data_len
Definition
sys.h:76
types.h
GhosttyResult
GhosttyResult
Definition
types.h:88
GHOSTTY_ENUM_TYPED
#define GHOSTTY_ENUM_TYPED
Definition
types.h:81
include
ghostty
vt
sys.h
Generated by
1.18.0