Subversion Repositories Kolibri OS

Rev

Rev 3247 | Rev 8634 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3247 Rev 8633
Line 5... Line 5...
5
{
5
{
6
 
6
 
Line 7... Line 7...
7
char name[32];
7
char name[32];
8
char *buffer;
8
char *buffer;
-
 
9
char *buf1k;
9
int result;
10
int result;
10
int i;
11
int i;
11
char command;
12
char command;
12
int size;
13
int size;
13
int is_end;
14
int is_end;
Line 14... Line 15...
14
 
15
 
15
itoa(pid, name);
16
itoa(pid, name);
Line 16... Line 17...
16
strcat(name, "-SHELL");
17
strcat(name, "-SHELL");
17
 
18
 
Line 18... Line 19...
18
buffer = NULL;
19
buffer = NULL;
19
 
20
buf1k = NULL;
20
 
21
 
21
for (i = 0; i < 30;  i++)
22
for (i = 0; i < 30;  i++)
Line 39... Line 40...
39
		command = *(buffer);
40
		command = *(buffer);
Line 40... Line 41...
40
	
41
	
41
		switch (command)
42
		switch (command)
42
			{
-
 
43
			
43
			{
44
			case SC_EXIT:
44
			case SC_EXIT:
45
				*buffer = SC_OK;
45
				*buffer = SC_OK;
46
				is_end = 1;
46
				is_end = 1;
Line 74... Line 74...
74
				gets(buffer+1, size-2);
74
				gets(buffer+1, size-2);
75
				*buffer = SC_OK;
75
				*buffer = SC_OK;
76
				break;	
76
				break;	
77
				
77
        
Line -... Line 78...
-
 
78
			case SC_GET_PID:
-
 
79
				buf1k=malloc(1024);
-
 
80
				kol_process_info(-1, buf1k);
-
 
81
                memcpy(buffer+1, buf1k+30, sizeof(unsigned));
-
 
82
				*buffer = SC_OK;
-
 
83
				free(buf1k);
-
 
84
				break;
-
 
85
                
78
			default:
86
			default:
79
				#if LANG_ENG
87
				#if LANG_ENG
80
					printf ("  Error in console application.\n\r");
88
					printf ("  Error in console application.\n\r");
81
				#elif LANG_RUS
89
				#elif LANG_RUS
82
					printf ("  Žè¨¡ª  ¢ ª®­á®«ì­®¬ ¯à¨«®¦¥­¨¨.\n\r");
90
					printf ("  Žè¨¡ª  ¢ ª®­á®«ì­®¬ ¯à¨«®¦¥­¨¨.\n\r");