mirror of https://git.cro.wtf/kip.git
20 lines
496 B
C
20 lines
496 B
C
#include<stdio.h>
|
|
#include<stdlib.h>
|
|
#include"kip.h"
|
|
IoDevice*ios;
|
|
|
|
I main(I ac,IM C*av[]){B*b;W l;FILE*f;
|
|
Q(2>ac,printf("inappropriate amount of args\n");R 1)
|
|
Q(3<=ac,disk_open(av[2]))
|
|
#define X(x)x,
|
|
ios=(IoDevice[]){
|
|
#include"kip-io.def"
|
|
};
|
|
#undef X
|
|
WIF(f,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))
|
|
b[l]=0,lod(b,l),front_init();
|
|
WH(1,front_events(),emu(),front_redraw())
|
|
kip_deinit();}
|
|
|
|
V kip_deinit(V){disk_close(),front_deinit();}
|