kip/kip.c

24 lines
536 B
C

#include<stdio.h>
#include<stdlib.h>
#include"kip.h"
IoDevice*ios;
#define STEP 0x1000
int main(int ac,char*av[]){
B*b;W l;FILE*f;
Q(2!=ac,printf("inappropriate amount of args (expected 1)\n");R 1)
#define X(x)x,
ios=(IoDevice[]){
#include"kip-io.def"
};
#undef X
f=fopen(av[1],"rb"),fseek(f,0,SEEK_END),l=ftell(f),fseek(f,0,SEEK_SET),
b=mk(l+1),fread(b,1,l,f),fclose(f),b[l]=0,lod(b,l),front_init();
for(;;)front_events(),emu(STEP),front_redraw();
front_deinit();
}