things
This commit is contained in:
parent
65c2ac8212
commit
8e82909923
9 changed files with 180 additions and 19 deletions
14
src/log.c
Normal file
14
src/log.c
Normal 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
11
src/version.c
Normal 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);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue