You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
naka/src/main.c

35 lines
904 B

// *naka* - find a file within another file
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <ints.h>
#include <macros.h>
#include <version.h>
int main(int argc, char** argv)
{
IGNORE(argc);
IGNORE(argv);
const u32 vraw = VERSION(100,200,101,255);
version_t vers = v_rawtoc(vraw);
usize sz = v_ctosn_sz(vers);
char verstr[sz+1];
v_ctosn(vers, sz+1, verstr);
char* verstr_h;
INFO("Version: 0x%x, raw: 0x%x", vers.raw, vraw);
INFO("Output is: (%lu chars)\t%s", sz, verstr);
INFO("Output is (static):\t%s", v_ctoss(vers));
INFO("Output is (leak):\t\t%s", (verstr_h = v_ctos(vers)));
free(verstr_h);
//INFO("Hello world %lu %lu %lu!", i, bswap(i), bswap(bswap(i)));
//INFO("Version: 0x%x (0x%x)", vers, bswap(vers)); // Check which version endian was preferrable, we'll stick with the default system endian (little, for this one.)
return 0;
}