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
53
typedef
struct
{
55
uint32_t
width
;
56
58
uint32_t
height
;
59
61
uint8_t*
data
;
62
64
size_t
data_len
;
65
}
GhosttySysImage
;
66
70
typedef
enum
GHOSTTY_ENUM_TYPED
{
71
GHOSTTY_SYS_LOG_LEVEL_ERROR = 0,
72
GHOSTTY_SYS_LOG_LEVEL_WARNING = 1,
73
GHOSTTY_SYS_LOG_LEVEL_INFO = 2,
74
GHOSTTY_SYS_LOG_LEVEL_DEBUG = 3,
75
GHOSTTY_SYS_LOG_LEVEL_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
76
}
GhosttySysLogLevel
;
77
98
typedef
void (*
GhosttySysLogFn
)(
99
void
* userdata,
100
GhosttySysLogLevel
level,
101
const
uint8_t* scope,
102
size_t
scope_len,
103
const
uint8_t* message,
104
size_t
message_len);
105
120
typedef
bool (*
GhosttySysDecodePngFn
)(
121
void
* userdata,
122
const
GhosttyAllocator
* allocator,
123
const
uint8_t* data,
124
size_t
data_len,
125
GhosttySysImage
* out);
126
140
typedef
bool (*
GhosttySysRandomSecureFn
)(
141
void
* userdata,
142
uint8_t* buf,
143
size_t
len);
144
148
typedef
enum
GHOSTTY_ENUM_TYPED
{
154
GHOSTTY_SYS_OPT_USERDATA
= 0,
155
165
GHOSTTY_SYS_OPT_DECODE_PNG
= 1,
166
185
GHOSTTY_SYS_OPT_LOG
= 2,
186
200
GHOSTTY_SYS_OPT_RANDOM_SECURE
= 3,
201
GHOSTTY_SYS_OPT_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
202
}
GhosttySysOption
;
203
217
GHOSTTY_API
GhosttyResult
ghostty_sys_set
(
GhosttySysOption
option,
218
const
void
* value);
219
230
GHOSTTY_API
void
ghostty_sys_log_stderr
(
void
* userdata,
231
GhosttySysLogLevel
level,
232
const
uint8_t* scope,
233
size_t
scope_len,
234
const
uint8_t* message,
235
size_t
message_len);
236
237
#ifdef __cplusplus
238
}
239
#endif
240
242
243
#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:98
GhosttySysLogLevel
GhosttySysLogLevel
Definition
sys.h:70
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:120
GhosttySysRandomSecureFn
bool(*) GhosttySysRandomSecureFn(void *userdata, uint8_t *buf, size_t len)
Definition
sys.h:140
GhosttySysOption
GhosttySysOption
Definition
sys.h:148
GHOSTTY_SYS_OPT_DECODE_PNG
@ GHOSTTY_SYS_OPT_DECODE_PNG
Definition
sys.h:165
GHOSTTY_SYS_OPT_LOG
@ GHOSTTY_SYS_OPT_LOG
Definition
sys.h:185
GHOSTTY_SYS_OPT_RANDOM_SECURE
@ GHOSTTY_SYS_OPT_RANDOM_SECURE
Definition
sys.h:200
GHOSTTY_SYS_OPT_USERDATA
@ GHOSTTY_SYS_OPT_USERDATA
Definition
sys.h:154
GhosttyAllocator
Definition
allocator.h:203
GhosttySysImage
Definition
sys.h:53
GhosttySysImage::width
uint32_t width
Definition
sys.h:55
GhosttySysImage::height
uint32_t height
Definition
sys.h:58
GhosttySysImage::data
uint8_t * data
Definition
sys.h:61
GhosttySysImage::data_len
size_t data_len
Definition
sys.h:64
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