kolibrios/programs/fs/Eolite/trunk/include/run_file.h--
Kirill Lipatov (Leency) e80aaced2b Eolite 0.97
git-svn-id: svn://kolibrios.org@935 a494cfbc-eb01-0410-851d-a64ba20cac60
2008-11-24 00:49:58 +00:00

85 lines
3.7 KiB
Plaintext

f70 run_file_70;
///////////////////////////
// Çàïóñê ïðîãðàììû //
///////////////////////////
void Run_Program(dword run_path, run_param)
{
run_file_70.func = 7;
run_file_70.param1 = 0;
run_file_70.param2 = run_param;
run_file_70.param3 = 0;
run_file_70.param4 = 0;
run_file_70.rezerv = 0;
run_file_70.name = run_path;
$mov eax,70
$mov ebx,#run_file_70.func
$int 0x40
}
/*char *extension[25]={".skn",".avi",".htm","html",".3ds",".lif",".cvs",".mp3",
".wav",".mid","midi",".rtf",".txt",".inc",".ini",".dat",".asm",".gif",".bmp",
".tga",".pcx",".png",".jpg","jpeg", 0}; //ìàññèâ óêàçàòåëåé
char *prog_path[25]={"desktop","/sys/kvid","/sys/network/HTMLv","/sys/network/HTMLv",
"/sys/demos/3d/view3ds","/sys/demos/life2","graph","AC97SND","AC97SND","MIDAMP",
"MIDAMP","RtfRead","TinyPad","TinyPad","TinyPad","TinyPad","TinyPad","MV","MV",
"MV","MV","@rcher","JpegView","JpegView", 0};
void Run_File(dword fpath)
{
byte i;
dword file_ext[4]=fpath+strlen(fpath)-4;
FOR(i=0; extension[i]!=0; i++) IF (strcmp(file_ext,extension[i])==0)
{
Run_Program(prog_path[i], fpath);
return;
}
Run_Program(fpath, "");
}*/
void Run_File(dword fpath)
{
dword extension[4], fparam[256];
copystr(fpath,#fparam); //ïî-óìîë÷àíèþ ïðîãà è ïàðàìåòð ðàâíû, åñëè îêàæåòñÿ ÷òî ýòî ôàéë, ïàðàì - ñáðîñèì
copystr(fpath+strlen(fpath)-4,#extension); //óçíà¸ì ðàñøèðåíèå ôàéëà ñ êàêèì ðàáîòàåì
//òóò ìû ýòî ðàñøèðåíèå ñðàâíèìàåì, è, åñëè îíî àñîöèèðóåòñÿ ñ ïðîãîé, ïðîãà - ýòî fpath
IF (!strcmp(#extension,".skn")) copystr("desktop",fpath);
IF (!strcmp(#extension,".avi")) copystr("/sys/kvid",fpath);
IF (!strcmp(#extension,".mpg")) copystr("/sys/kvid",fpath);
IF (!strcmp(#extension,".htm")) copystr("/sys/network/HTMLv",fpath);
IF (!strcmp(#extension,"html")) copystr("/sys/network/HTMLv",fpath);
//IF (strcmp(#extension,".htm")==0) || (strcmp(#extension,"html")==0) copystr("/hd0/2/Programs/QIP/Users/419114984/RcvdFiles/313257308_Veliant/browser/HTMLv",fpath);
IF (!strcmp(#extension,".3ds")) copystr("/sys/demos/3d/view3ds",fpath);
IF (!strcmp(#extension,".lif")) copystr("/sys/demos/life2",fpath);
IF (!strcmp(#extension,".cvs")) copystr("graph",fpath);
IF (!strcmp(#extension,".nes")) copystr("/sys/games/fce",fpath);
//audio
IF (!strcmp(#extension,".mp3")) copystr("AC97SND",fpath);
IF (!strcmp(#extension,".wav")) copystr("AC97SND",fpath);
IF (!strcmp(#extension,".mid")) copystr("MIDAMP",fpath);
IF (!strcmp(#extension,"midi")) copystr("MIDAMP",fpath);
//text
IF (!strcmp(#extension,".rtf")) copystr("RtfRead",fpath);
IF (!strcmp(#extension,".txt")) copystr("TinyPad",fpath);
IF (!strcmp(#extension,".inc")) copystr("TinyPad",fpath);
IF (!strcmp(#extension,".ini")) copystr("TinyPad",fpath);
IF (!strcmp(#extension,".dat")) copystr("TinyPad",fpath);
IF (!strcmp(#extension,".asm")) copystr("TinyPad",fpath);
IF (!strcmp(#extension,".cpp")) copystr("TinyPad",fpath);
//èçîáðàæåíèÿ
IF (!strcmp(#extension,".gif")) copystr("MV",fpath); //GifView,MenuAnimage
IF (!strcmp(#extension,".bmp")) copystr("MV",fpath); //BmpMenu1,MenuAnimage
IF (!strcmp(#extension,".tga")) copystr("MV",fpath);
IF (!strcmp(#extension,".pcx")) copystr("MV",fpath);
IF (!strcmp(#extension,".cur")) copystr("MV",fpath);
IF (!strcmp(#extension,".ico")) copystr("MV",fpath);
IF (!strcmp(#extension,".png")) copystr("@rcher",fpath);
IF (!strcmp(#extension,".jpg")) copystr("JpegView",fpath);
IF (!strcmp(#extension,"jpeg")) copystr("JpegView",fpath);
IF (!strcmp(fpath,#fparam)) fparam=''; //åñëè fpath íå èçìåíèëñÿ, òî ýòî òàêè, íàâåðíîå, ïðîãà, ïàðàìåòðîâ íåò.
Run_Program(fpath, #fparam); //çàïóñê!
}