#include <windows.h>

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#define equal(s1,s2) (strcmp(s1,s2)==0)

main(int argc, char** argv) {

char* lfname = ".license";
FILE* file;
char s[128];
char msg[2048];
int mb_id;

if (argc > 1) lfname = argv[1];

file = fopen(lfname,"w");
fputs("LEDA LICENSE FILE",file);
fclose(file);

if (getenv("NO_LICENSE_CHECK")) exit(0);


file = fopen("license.txt","r");

strcpy(msg,"");

while (fgets(s,128,file)) strcat(msg,s);

fclose(file);

strcat(msg,"Do you wish to continue ?\n");

mb_id = MessageBox(NULL,msg,"LEDA 3.5",MB_YESNO | MB_ICONINFORMATION);

if (mb_id != IDYES)
{ sprintf(s,"del %s > NUL",lfname);
  system(s);
 }

return 0;

}
