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
130typedef enum GHOSTTY_ENUM_TYPED {
137
148
168 GHOSTTY_SYS_OPT_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
170
185 const void* value);
186
197GHOSTTY_API void ghostty_sys_log_stderr(void* userdata,
198 GhosttySysLogLevel level,
199 const uint8_t* scope,
200 size_t scope_len,
201 const uint8_t* message,
202 size_t message_len);
203
204#ifdef __cplusplus
205}
206#endif
207
209
210#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
GhosttySysOption
Definition sys.h:130
@ GHOSTTY_SYS_OPT_DECODE_PNG
Definition sys.h:147
@ GHOSTTY_SYS_OPT_LOG
Definition sys.h:167
@ GHOSTTY_SYS_OPT_USERDATA
Definition sys.h:136
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:74
#define GHOSTTY_ENUM_TYPED
Definition types.h:67