feat(teipe): initial commit
This commit is contained in:
17
libxkbcommonrs/ffi/logger.c
Normal file
17
libxkbcommonrs/ffi/logger.c
Normal file
@@ -0,0 +1,17 @@
|
||||
#include "logger.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#define buf_size 256
|
||||
static callback_type global_callback = NULL;
|
||||
|
||||
void log_set_callback(callback_type callback) { global_callback = callback; }
|
||||
|
||||
void log_logger(struct xkb_context *context, enum xkb_log_level level,
|
||||
const char *format, va_list args) {
|
||||
if (global_callback) {
|
||||
char buf[buf_size] = {0};
|
||||
vsnprintf(buf, buf_size, format, args);
|
||||
global_callback(context, level, buf);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user