Restructure native codebase

This commit is contained in:
topjohnwu
2022-05-12 02:03:42 -07:00
parent 7505599ea0
commit 622e09862a
78 changed files with 102 additions and 98 deletions

View File

@@ -0,0 +1,26 @@
#pragma once
#include <cerrno>
#include <cstdarg>
struct log_callback {
int (*d)(const char* fmt, va_list ap);
int (*i)(const char* fmt, va_list ap);
int (*w)(const char* fmt, va_list ap);
int (*e)(const char* fmt, va_list ap);
void (*ex)(int code);
};
extern log_callback log_cb;
void LOGD(const char *fmt, ...) __printflike(1, 2);
void LOGI(const char *fmt, ...) __printflike(1, 2);
void LOGW(const char *fmt, ...) __printflike(1, 2);
void LOGE(const char *fmt, ...) __printflike(1, 2);
#define PLOGE(fmt, args...) LOGE(fmt " failed with %d: %s\n", ##args, errno, std::strerror(errno))
int nop_log(const char *, va_list);
void nop_ex(int);
void no_logging();
void cmdline_logging();