|
|
@ -3,6 +3,7 @@
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <sys/mman.h>
|
|
|
|
#include <sys/mman.h>
|
|
|
|
|
|
|
|
#include <time.h>
|
|
|
|
|
|
|
|
|
|
|
|
#include <ints.h>
|
|
|
|
#include <ints.h>
|
|
|
|
#include <macros.h>
|
|
|
|
#include <macros.h>
|
|
|
@ -15,6 +16,21 @@
|
|
|
|
#include <map.h>
|
|
|
|
#include <map.h>
|
|
|
|
#include <comp.h>
|
|
|
|
#include <comp.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static const char* _compdate_readable()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
static const time_t comp = PROG_COMPILED_TIMESTAMP;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static _Thread_local char date[40] = {0};
|
|
|
|
|
|
|
|
debug_assert(sizeof(date) == 40);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct tm* time = gmtime(&comp);
|
|
|
|
|
|
|
|
if(!date[0]) {
|
|
|
|
|
|
|
|
usize w = strftime(date, sizeof(date), "%Y-%m-%d %H:%M:%S", time);
|
|
|
|
|
|
|
|
TRACE("size of hr time: %lu / %lu", w, sizeof(date));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return date;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void pi_print_trace_infos(FILE* out)
|
|
|
|
static void pi_print_trace_infos(FILE* out)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const char* name;
|
|
|
|
const char* name;
|
|
|
@ -42,10 +58,19 @@ void prog_info(FILE* out)
|
|
|
|
#ifdef DEBUG
|
|
|
|
#ifdef DEBUG
|
|
|
|
" (debug build)"
|
|
|
|
" (debug build)"
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
"\n written by %s with <3 (compiled at %lu UTC (unix ts))\n license %s.\n",
|
|
|
|
"\n written by %s with <3 (compiled at %s UTC."
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
|
|
|
|
" %lu uts)"
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
")"
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
"\n license %s.\n",
|
|
|
|
v_ctoss(v_rawtoc(PROG_VERSION)),
|
|
|
|
v_ctoss(v_rawtoc(PROG_VERSION)),
|
|
|
|
PROG_AUTHOUR,
|
|
|
|
PROG_AUTHOUR,
|
|
|
|
|
|
|
|
_compdate_readable(),
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
PROG_COMPILED_TIMESTAMP,
|
|
|
|
PROG_COMPILED_TIMESTAMP,
|
|
|
|
|
|
|
|
#endif
|
|
|
|
PROG_LICENSE);
|
|
|
|
PROG_LICENSE);
|
|
|
|
fprintf(out, "\nLogging levels: (set with env-var `%s')\n", _TRACE_CONTROL_ENV_NAME);
|
|
|
|
fprintf(out, "\nLogging levels: (set with env-var `%s')\n", _TRACE_CONTROL_ENV_NAME);
|
|
|
|
pi_print_trace_infos(out);
|
|
|
|
pi_print_trace_infos(out);
|
|
|
|