Rev 6857 | Rev 7802 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
959 | leency | 1 | |
2 | |||
3 | |||
4 | |||
5 | |||
6 | /// just checks, if dir[] is really a directory |
||
6857 | siemargl | 7 | { |
959 | leency | 8 | kol_struct70 k70; |
9 | int result; |
||
10 | |||
11 | |||
12 | k70.p04 = 0; |
||
13 | //k70.p08 = 0; |
||
6857 | siemargl | 14 | k70.p12 = 2; // enough to read . & .. |
15 | k70.p16 = (unsigned)malloc(32+k70.p12*560); |
||
16 | k70.p20 = 0; |
||
959 | leency | 17 | k70.p21 = dir; |
18 | |||
19 | |||
20 | |||
21 | |||
3245 | Albom | 22 | |
959 | leency | 23 | |
6857 | siemargl | 24 | return TRUE; |
959 | leency | 25 | else |
26 | return FALSE; |
||
27 | |||
28 | |||
29 | |||
30 | |||
31 | |||
32 | |||
33 | { |
||
34 | int i; |
||
35 | i = strlen(dir)-1; |
||
36 | for (;;i--) |
||
37 | if ('/' == dir[i]) |
||
38 | { |
||
39 | dir[i+1] = 0; |
||
40 | break; |
||
41 | } |
||
42 | } |
||
43 | |||
44 | |||
45 | |||
46 | |||
47 | { |
||
48 | kol_struct70 k70; |
||
49 | int result; |
||
50 | |||
51 | |||
52 | k70.p04 = 0; |
||
53 | //k70.p08 = 0; |
||
6857 | siemargl | 54 | k70.p12 = 0; |
959 | leency | 55 | k70.p16 = 0; |
56 | k70.p20 = 0; |
||
57 | k70.p21 = file; |
||
58 | |||
59 | |||
60 | |||
61 | |||
62 | return TRUE; |
||
63 | else |
||
64 | return FALSE; |
||
65 | } |
||
66 | |||
67 | |||
68 | |||
69 | |||
2617 | Albom | 70 | { |
71 | #if LANG_ENG |
||
72 | printf (" File '%s' not found.\n\r", file); |
||
73 | #elif LANG_RUS |
||
74 | printf (" ” ©« '%s' ¥ ©¤¥.\n\r", file); |
||
75 | #endif |
||
76 | } |
||
77 | |||
78 | |||
79 | |||
80 | |||
959 | leency | 81 | { |
82 | return ((' ' == c) || ('\t' == c) || (13 == c) || (10 == c)); |
||
83 | } |
||
84 | |||
85 | |||
86 | |||
87 | |||
88 | { |
||
89 | int i, j; |
||
90 | |||
91 | |||
92 | if ( !iswhite(string[i]) ) |
||
93 | break; |
||
94 | j = 0; |
||
95 | for (;;i++, j++) |
||
96 | { |
||
97 | string[j] = string[i]; |
||
98 | if ('\0' == string[i] ) |
||
99 | break; |
||
100 | } |
||
101 | |||
102 | |||
103 | if ('\0' == string[i]) |
||
104 | break; |
||
105 | i--; |
||
106 | for (;i>0;--i) |
||
107 | if ( iswhite(string[i]) ) |
||
108 | string[i] = '\0'; |
||
109 | else |
||
110 | break; |
||
111 | } |
||
112 | |||
113 | |||
114 | |||
115 | |||
116 | { |
||
117 | |||
118 | |||
1647 | Nasarus | 119 | |
120 | |||
959 | leency | 121 | strcat(title, SHELL_VERSION); |
122 | CONSOLE_INIT(title); |
||
123 | |||
124 | |||
6826 | siemargl | 125 | { |
126 | printf("Invalid struct align kol_struct70, need to fix compile options\n\r"); |
||
127 | kol_exit(); |
||
128 | } |
||
129 | |||
130 | |||
131 | |||
6862 | siemargl | 132 | //dir_truncate(cur_dir); |
133 | getcwd(cur_dir, sizeof cur_dir); |
||
134 | //printf("curdir %s\n", cur_dir); |
||
135 | |||
959 | leency | 136 | |
137 | |||
138 | |||
1647 | Nasarus | 139 | |
140 | |||
6862 | siemargl | 141 | { |
4109 | leency | 142 | strcpy(CMD, PATH); |
6862 | siemargl | 143 | dir_truncate(CMD); |
144 | strcat(CMD, ".shell"); |
||
4106 | Albom | 145 | if ( !file_check(CMD) ) |
146 | strcpy(CMD, "/sys/settings/.shell"); |
||
147 | } |
||
4109 | leency | 148 | else |
3988 | leency | 149 | { |
150 | if (PARAM[0] == '/') |
||
151 | { |
||
152 | strcpy(cur_dir, PARAM); |
||
153 | *(strrchr(cur_dir, '/')+1)=0; |
||
4109 | leency | 154 | } |
3988 | leency | 155 | strcpy(CMD, PARAM); |
959 | leency | 156 | } |
3988 | leency | 157 | |
959 | leency | 158 | |
159 | |||
160 | |||
161 | { |
||
162 | printf ("# "); |
||
163 | command_get(); |
||
164 | command_execute(); |
||
165 | } |
||
166 | |||
167 | |||
168 | kol_exit(); |
||
169 | } |
||
170 | |||
171 | |||
172 |