11 int main(
int,
char *[])
17 ret = stat(
"map.bin", &statbuff);
19 printf(
"Can't stat file map.bin (%s)\n", strerror(errno));
23 int sz = statbuff.st_size;
24 uint *buff = (uint *)malloc(sz);
25 float *fbuff = (
float *)buff;
26 char *cbuff = (
char *)buff;
29 printf(
"Can't allocate %d bytes\n",sz);
33 int fd = open(
"map.bin", O_RDONLY);
35 printf(
"Can't open file map.bin (%s)\n", strerror(errno));
39 ret = read(fd, buff, sz);
41 printf(
"Only read %d of %d bytes\n",ret,sz);
47 printf(
"#define MAPDOTBINFILE_SZ %d\n", sz);
48 printf(
"u_int mapdotbinfile[%d] = {\n", sz/4);
50 for(
int i=0;i<sz/4;i++) {
51 printf(
"0x%08x, ", buff[i]);
52 if( ((i+1) % 10) == 0) printf(
"\n");