Subversion Repositories Kolibri OS

Rev

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

Rev 6647 Rev 7597
Line 1... Line 1...
1
(*
1
(*
2
    Copyright 2016 Anton Krotov
2
    Copyright 2016, 2018 Anton Krotov
Line 3... Line 3...
3
 
3
 
4
    This program is free software: you can redistribute it and/or modify
4
    This program is free software: you can redistribute it and/or modify
5
    it under the terms of the GNU Lesser General Public License as published by
5
    it under the terms of the GNU Lesser General Public License as published by
6
    the Free Software Foundation, either version 3 of the License, or
6
    the Free Software Foundation, either version 3 of the License, or
Line 64... Line 64...
64
END open;
64
END open;
Line 65... Line 65...
65
 
65
 
66
PROCEDURE main;
66
PROCEDURE main;
Line 67... Line 67...
67
VAR Lib: INTEGER;
67
VAR Lib: INTEGER;
68
 
68
 
69
  PROCEDURE GetProc(v: INTEGER; name: ARRAY OF CHAR);
69
  PROCEDURE GetProc(Lib, v: INTEGER; name: ARRAY OF CHAR);
70
  VAR a: INTEGER;
70
  VAR a: INTEGER;
71
  BEGIN
71
  BEGIN
72
    a := KOSAPI.GetProcAdr(name, Lib);
72
    a := KOSAPI.GetProcAdr(name, Lib);
73
    ASSERT(a # 0);
73
    ASSERT(a # 0);
Line 74... Line 74...
74
    sys.PUT(v, a)
74
    sys.PUT(v, a)
75
  END GetProc;
75
  END GetProc;
76
 
76
 
77
BEGIN
77
BEGIN
78
  Lib := KOSAPI.LoadLib("/rd/1/lib/Console.obj");
78
  Lib := KOSAPI.LoadLib("/rd/1/lib/Console.obj");
79
  ASSERT(Lib # 0);
79
  ASSERT(Lib # 0);
80
  GetProc(sys.ADR(version),	      "version");
80
  GetProc(Lib, sys.ADR(version),           "version");
81
  GetProc(sys.ADR(init),	      "con_init");
81
  GetProc(Lib, sys.ADR(init),              "con_init");
82
  GetProc(sys.ADR(exit),	      "con_exit");
82
  GetProc(Lib, sys.ADR(exit),              "con_exit");
83
  GetProc(sys.ADR(write_asciiz),      "con_write_asciiz");
83
  GetProc(Lib, sys.ADR(write_asciiz),      "con_write_asciiz");
84
  GetProc(sys.ADR(write_string),      "con_write_string");
84
  GetProc(Lib, sys.ADR(write_string),      "con_write_string");
85
  GetProc(sys.ADR(get_flags),	      "con_get_flags");
85
  GetProc(Lib, sys.ADR(get_flags),         "con_get_flags");
86
  GetProc(sys.ADR(set_flags),	      "con_set_flags");
86
  GetProc(Lib, sys.ADR(set_flags),         "con_set_flags");
87
  GetProc(sys.ADR(get_font_height),   "con_get_font_height");
87
  GetProc(Lib, sys.ADR(get_font_height),   "con_get_font_height");
88
  GetProc(sys.ADR(get_cursor_height), "con_get_cursor_height");
88
  GetProc(Lib, sys.ADR(get_cursor_height), "con_get_cursor_height");
89
  GetProc(sys.ADR(set_cursor_height), "con_set_cursor_height");
89
  GetProc(Lib, sys.ADR(set_cursor_height), "con_set_cursor_height");
90
  GetProc(sys.ADR(getch),	      "con_getch");
90
  GetProc(Lib, sys.ADR(getch),             "con_getch");
91
  GetProc(sys.ADR(getch2),	      "con_getch2");
91
  GetProc(Lib, sys.ADR(getch2),            "con_getch2");
92
  GetProc(sys.ADR(kbhit),	      "con_kbhit");
92
  GetProc(Lib, sys.ADR(kbhit),             "con_kbhit");
93
  GetProc(sys.ADR(gets),	      "con_gets");
93
  GetProc(Lib, sys.ADR(gets),              "con_gets");
94
  GetProc(sys.ADR(gets2),	      "con_gets2");
94
  GetProc(Lib, sys.ADR(gets2),             "con_gets2");
95
  GetProc(sys.ADR(cls), 	      "con_cls");
95
  GetProc(Lib, sys.ADR(cls),               "con_cls");
96
  GetProc(sys.ADR(get_cursor_pos),    "con_get_cursor_pos");
96
  GetProc(Lib, sys.ADR(get_cursor_pos),    "con_get_cursor_pos");
Line 97... Line 97...
97
  GetProc(sys.ADR(set_cursor_pos),    "con_set_cursor_pos");
97
  GetProc(Lib, sys.ADR(set_cursor_pos),    "con_set_cursor_pos");
98
  GetProc(sys.ADR(set_title),	      "con_set_title");
98
  GetProc(Lib, sys.ADR(set_title),         "con_set_title");
99
END main;
99
END main;
100
 
100