forked from VictorYXL/MyOS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
open.c
57 lines (56 loc) · 1.67 KB
/
open.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include"nasmfunc.h"
#include"memory.h"
#include"sheet.h"
#include"graphic.h"
#include"buffer.h"
#include"timer.h"
#include"mtask.h"
#include"keyboard.h"
#include"mouse.h"
#include"console.h"
#include"textviewer.h"
#include"imageviewer.h"
#include"player.h"
#include"open.h"
#include<stdio.h>
#include<string.h>
void openFile(char *fileName)
{
if (strcmp(fileName,"\\Text\\Welcome")==0)
{
struct Task *textViewerTask;
textViewerTask=allocTask();
initTask(textViewerTask,(int)&textViewerTask_Main,"TextViewer",11);
sprintf(textViewerTask->par[0],"\\Text\\Welcome");
textViewerTask->parCount++;
createWindow(textViewerTask,"TextViewer");
runTask(textViewerTask);
}else if (strcmp(fileName,"\\Source\\Play.c")==0)
{
struct Task *textViewerTask;
textViewerTask=allocTask();
initTask(textViewerTask,(int)&textViewerTask_Main,"TextViewer",11);
sprintf(textViewerTask->par[0],"\\Source\\Play.c");
textViewerTask->parCount++;
createWindow(textViewerTask,"Play.c");
runTask(textViewerTask);
}else if (strcmp(fileName,"\\Image\\Pic1")==0)
{
struct Task *imageViewerTask;
imageViewerTask=allocTask();
initTask(imageViewerTask,(int)&imageViewerTask_Main,"ImageViewer",1);
sprintf(imageViewerTask->par[0],"\\Image\\Pic1");
imageViewerTask->parCount++;
createWindow(imageViewerTask,"ImageViewer");
runTask(imageViewerTask);
}else if (strcmp(fileName,"\\Music\\Mus1")==0)
{
struct Task *textViewerTask;
textViewerTask=allocTask();
initTask(textViewerTask,(int)&textViewerTask_Main,"TextViewer",11);
sprintf(textViewerTask->par[0],"\\Music\\Mus1");
textViewerTask->parCount++;
createWindow(textViewerTask,"TextViewer");
runTask(textViewerTask);
}
}