This commit is contained in:
Nishi 2025-12-20 12:11:57 +09:00
commit 8e82909923
Signed by: nishi
GPG key ID: 27EF69B208EB9343
9 changed files with 180 additions and 19 deletions

14
src/log.c Normal file
View file

@ -0,0 +1,14 @@
#include <af_common.h>
static void af_common_log(const char* type, const char* fmt, va_list va) {
printf("[%.4s] ", type);
vprintf(fmt, va);
}
void af_common_log_info(const char* fmt, ...) {
va_list va;
va_start(va, fmt);
af_common_log("INFO", fmt, va);
va_end(va);
}

11
src/version.c Normal file
View file

@ -0,0 +1,11 @@
#include <af_common.h>
void af_common_version(unsigned char* v_major, unsigned char* v_minor, unsigned char* v_patch) {
char* mj = AF_VERSION;
char* mi = strchr(mj, '.') + 1;
char* pt = strchr(mi, '.') + 1;
*v_major = atoi(mj);
*v_minor = atoi(mi);
*v_patch = atoi(pt);
}