Exemple #1
0
void main(int argc, char *argv[])
{
	int n;

	memset(startdir,0,sizeof(startdir));
	memset(cfgfilename,0,sizeof(cfgfilename));
	ArgInit(argc, argv);
	VideoInit();
	ShowCopyright(argc, argv);
//	CheckIfLocked();
	ShowSysInfo();
	ShowEnvInfo();
	ShowMainMenu();
	ShowMemory();
//	CheckVersion();
	ValidateConfig();

l1:	ShowMemory();
	SelectMainMenu();
l2:	switch(mainmenu_sel)
	{
		case 0:		ShowKernelMenu();
					if(keycode==F2)
					{
						ShowMemory();
						mainmenu_sel=1;
						goto l2;
					} else break;
		case 1:		ShowExtenderMenu();
					if(keycode==F1)
					{
						ShowMemory();
						mainmenu_sel=0;
						goto l2;
					} else break;
		case 2:		CreateConfig(); break;
		case 3:		RestoreConfig();break;
		case 4:		id32=id32_old; ClearConfigName(); break;
		case 5:		DiscardExit(); break;
		case 6:		ApplyExit(); break;
	}
	goto l1;
}
Exemple #2
0
void main(int argc, char *argv[])
{
	int n;

//	Debug_Init();

	setbuf(stdout,NULL);
	CheckEnvironment();
	ArgInit(argc, argv);
	DeleteTempFiles();
	CreateD32AEnvVar();
	CheckExec(argv);
	oldfilesize=GetFileSize(oldfilename);
	UnbindExec();

	OpenExec();
	Exec_Type=FindExecType();
	Print("\n");
	if(!verbose) Print("+ Unbinding Exec     :   Ok.\n");
	else	     Print("+ Unbinding Exec     :   Ok.  (%s-style)\n",execstyle[Exec_Type-1]);
	CloseExec();

	if(advanced)
	{
		if(!quiet) printf("+ Preprocessing Exec :   ");
		n=relocate_exec(tempname1);
		if(n!=0)
		{
			Print("Error!     \n");
			err_relocator(n);
		}
		if(!verbose) Print("Ok.\n");
		else	     Print("Ok.  (%d fixups)\n",relocated_fixups);
	}

	OpenExec();
	CompressExec();
	CloseExec();

	if(bind)
	{
		BindExec();
		if(!verbose) Print("+ Binding Exec       :   Ok.\n");
		else	     Print("+ Binding Exec       :   Ok.  (Stub file used: \"%s\")\n",stubnames[bindtype]);
	}
	else
	{
		unlink(newfilename);
		copy_file(tempname2,newfilename);
		unlink(tempname2);

	}
	newfilesize=GetFileSize(newfilename);
	DeleteTempFiles();

	if(!quiet)
	{
		printf("\n  Original Exec Stats:   \"%s\", %s-style, %d bytes\n", oldfilename, execstyle[Exec_Type-1], oldfilesize);
		printf("Compressed Exec Stats:   \"%s\", %s-style, %d bytes   (%1.1f%%)\n", newfilename, execstyle[2], newfilesize, (float)(newfilesize+0.01)/(float)(oldfilesize+0.01) *100);
	}
	else
	{
		if(!silent) printf("SC/32A: File \"%s\" has been successfully compressed\n", oldfilename);
	}
	exit(0);
}