Subversion Repositories Kolibri OS

Rev

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

Rev 6074 Rev 6536
Line 7... Line 7...
7
void     __stdcall con_exit(char bCloseWindow);
7
void     __stdcall con_exit(char bCloseWindow);
8
unsigned __stdcall con_get_flags(void);
8
unsigned __stdcall con_get_flags(void);
9
unsigned __stdcall con_set_flags(unsigned new_flags);
9
unsigned __stdcall con_set_flags(unsigned new_flags);
10
void     __stdcall con_cls(void);
10
void     __stdcall con_cls(void);
11
void     __stdcall con_write_string(const char* string, unsigned length);
11
void     __stdcall con_write_string(const char* string, unsigned length);
-
 
12
short    __stdcall con_getch2(void);
Line 12... Line 13...
12
 
13
 
Line -... Line 14...
-
 
14
int __gui_mode;
-
 
15
 
-
 
16
static int console_read(const char *path, void *buff,
-
 
17
           size_t offset, size_t count, size_t *done)
-
 
18
{
-
 
19
    char *p = buff;
-
 
20
    int   cnt = 0;
-
 
21
    short c;
-
 
22
    char  ch;
-
 
23
 
-
 
24
//   __asm__ volatile("int3");
-
 
25
 
-
 
26
    do
-
 
27
    {
-
 
28
        c = con_getch2();
-
 
29
        ch = (char)c;
-
 
30
        if(ch != 0)
-
 
31
        {
-
 
32
            p[cnt] = ch != 0x0D ? ch : 0x0A;
-
 
33
            con_write_string(p+cnt, 1);
-
 
34
            cnt++;
-
 
35
        }
-
 
36
    }while(ch != 0x0D);
-
 
37
 
-
 
38
    *done = cnt;
-
 
39
    return 0;
-
 
40
}
13
int __gui_mode;
41
 
14
 
42
 
15
static int console_write(const char *path, const void *buff,
43
static int console_write(const char *path, const void *buff,
16
                 size_t offset, size_t count, size_t *writes)
44
                 size_t offset, size_t count, size_t *writes)
Line 17... Line 45...
17
{
45
{
18
    con_write_string(buff, count);
46
    con_write_string(buff, count);
19
 
47
 
Line 20... Line 48...
20
    *writes = count;
48
    *writes = count;
21
    return count;
49
    return 0;
22
};
50
};
Line 23... Line 51...
23
 
51
 
24
void __init_conio()
52
void __init_conio()
Line -... Line 53...
-
 
53
{
-
 
54
    __io_handle *ioh;
-
 
55
 
-
 
56
    load_libconsole();
25
{
57
    con_init(80, 25, 80, 500, "Console application");
26
    __io_handle *ioh;
58
 
27
 
59
    ioh = &__io_tab[STDIN_FILENO];
28
    load_libconsole();
60
    ioh->mode  = _READ|_ISTTY;