Subversion Repositories Kolibri OS

Rev

Rev 9716 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9716 Rev 9952
Line -... Line 1...
-
 
1
/*
-
 
2
 * Copyright (C) KolibriOS team 2004-2024. All rights reserved.
-
 
3
 * Distributed under terms of the GNU General Public License
-
 
4
*/
-
 
5
 
1
#include <_ansi.h>
6
#include <_ansi.h>
2
#include 
7
#include 
3
#include 
8
#include 
4
#include "io.h"
9
#include "io.h"
5
#include 
10
#include 
Line 14... Line 19...
14
 
19
 
15
static int console_read(const char *path, void *buff,
20
static int console_read(const char *path, void *buff,
16
           size_t offset, size_t count, size_t *done)
21
           size_t offset, size_t count, size_t *done)
17
{
22
{
18
    char *p = buff;
-
 
19
    /*int   cnt = 0;
-
 
20
    short c;
-
 
21
    char  ch;*/
23
    char *p = buff;
22
    con_gets(p, count+1);
24
    con_gets(p, count+1);
23
    *done = strlen(p);
-
 
24
 
-
 
25
//   __asm__ volatile("int3");
-
 
26
/*
-
 
27
    do
-
 
28
    {
-
 
29
        c = con_getch2();
-
 
30
        printf("%d\n",(char)c);
-
 
31
        ch = (char)c;
-
 
32
        if(ch != 0)
-
 
33
        {
-
 
34
            p[cnt] = ch != 0x0D ? ch : 0x0A;
-
 
35
            con_write_string(p+cnt, 1);
-
 
36
            cnt++;
-
 
37
        }
-
 
38
    }while(ch != 0x0D);
-
 
39
    *done = cnt;
-
 
40
*/
25
    *done = strlen(p);
41
    return 0;
26
    return 0;
Line 42... Line 27...
42
}
27
}
43
 
28
 
44
static int console_write(const char *path, const void *buff,
29
static int console_write(const char *path, const void *buff,
45
                 size_t offset, size_t count, size_t *writes)
30
                 size_t offset, size_t count, size_t *writes)
Line 46... Line 31...
46
{
31
{
47
    con_write_string(buff, count);
32
    con_write_string(buff, count);
48
 
33
 
Line 49... Line 34...
49
    *writes = count;
34
    *writes = count;
50
    return 0;
35
    return 0;
51
};
36
}