keymapping

This commit is contained in:
2026-07-03 22:07:03 +03:00
parent c809aa98f5
commit 7a98eb4dfb
12 changed files with 248 additions and 119 deletions

View File

@@ -2,16 +2,16 @@
#include <stdio.h>
#include <stdarg.h>
void log_error(char* file, size_t line, char* str) {
fprintf(stderr, "[ERROR] %s:%zu: %s\n", file, line, str);
void log_with_tag(FILE* out_file, char* file_name, size_t line, const char* tag, char* str) {
fprintf(out_file, "[%s] %s:%zu: %s\n", tag, file_name, line, str);
}
void log_errorf(char* file, size_t line, char* fmt, ...) {
fprintf(stderr, "[ERROR] %s:%zu: ", file, line);
void logf_with_tag(FILE* out_file, char* file_name, size_t line, const char* tag, char* fmt, ...) {
fprintf(out_file, "[%s] %s:%zu: ", tag, file_name, line);
va_list args;
va_start(args, fmt);
vfprintf(stderr, fmt, args);
vfprintf(out_file, fmt, args);
va_end(args);
fprintf(stderr, "\n");
fprintf(out_file, "\n");
}