libghostty
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
41
42#ifdef __cplusplus
43extern "C" {
44#endif
45
53typedef struct {
55 uint32_t width;
56
58 uint32_t height;
59
61 uint8_t* data;
62
64 size_t data_len;
66
70typedef 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,
77
98typedef 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
120typedef bool (*GhosttySysDecodePngFn)(
121 void* userdata,
122 const GhosttyAllocator* allocator,
123 const uint8_t* data,
124 size_t data_len,
125 GhosttySysImage* out);
126
141 void* userdata,
142 uint8_t* buf,
143 size_t len);
144
148typedef enum GHOSTTY_ENUM_TYPED {
155
166
186
201 GHOSTTY_SYS_OPT_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
203
218 const void* value);
219
230GHOSTTY_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 */
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:98
GhosttySysLogLevel
Definition sys.h:70
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:120
bool(*) GhosttySysRandomSecureFn(void *userdata, uint8_t *buf, size_t len)
Definition sys.h:140
GhosttySysOption
Definition sys.h:148
@ GHOSTTY_SYS_OPT_DECODE_PNG
Definition sys.h:165
@ GHOSTTY_SYS_OPT_LOG
Definition sys.h:185
@ GHOSTTY_SYS_OPT_RANDOM_SECURE
Definition sys.h:200
@ GHOSTTY_SYS_OPT_USERDATA
Definition sys.h:154
uint32_t width
Definition sys.h:55
uint32_t height
Definition sys.h:58
uint8_t * data
Definition sys.h:61
size_t data_len
Definition sys.h:64
GhosttyResult
Definition types.h:88
#define GHOSTTY_ENUM_TYPED
Definition types.h:81