Subversion Repositories Kolibri OS

Rev

Rev 6068 | Rev 6536 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
6068 serge 1
#include <_ansi.h>
2
#include 
3
#include "io.h"
4
 
5
void load_libconsole();
6
void     __stdcall con_init(unsigned w_w, unsigned w_h, unsigned s_w, unsigned s_h, const char* t);
7
void     __stdcall con_exit(char bCloseWindow);
8
unsigned __stdcall con_get_flags(void);
9
unsigned __stdcall con_set_flags(unsigned new_flags);
10
void     __stdcall con_cls(void);
11
void     __stdcall con_write_string(const char* string, unsigned length);
12
 
13
int __gui_mode;
14
 
15
static int console_write(const char *path, const void *buff,
16
                 size_t offset, size_t count, size_t *writes)
17
{
18
    con_write_string(buff, count);
19
 
20
    *writes = count;
21
    return count;
22
};
23
 
6074 serge 24
void __init_conio()
6068 serge 25
{
26
    __io_handle *ioh;
27
 
28
    load_libconsole();
6074 serge 29
    con_init(80, 25, 80, 500, "Console application");
6068 serge 30
 
31
    ioh = &__io_tab[STDOUT_FILENO];
32
    ioh->mode  = _WRITE|_ISTTY;
33
    ioh->write = &console_write;
34
};
35
 
6074 serge 36
void __fini_conio()
6068 serge 37
{
38
    con_exit(0);
39
}
40