summaryrefslogtreecommitdiff
path: root/rtl/zxspectrum/sysfile.inc
blob: e7c5e912dd73b82491475913ea5b7105877b9b8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
{
    This file is part of the Free Pascal run time library.
    Copyright (c) 2001 by Free Pascal development team

    Low leve file functions

    See the file COPYING.FPC, included in this distribution,
    for details about the copyright.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

 **********************************************************************}


{****************************************************************************
                        Low level File Routines
 ****************************************************************************}

procedure do_close(handle : thandle);inline;
begin
end;


procedure do_erase(p : pchar; pchangeable: boolean);inline;
begin
end;


procedure do_rename(p1,p2 : pchar; p1changeable, p2changeable: boolean);inline;
begin
end;


function do_write(h:thandle;addr:pointer;len : longint) : longint;
begin
  do_write:=len;
  while len>0 do
  begin
    PrintChar(PChar(addr)^);
    Inc(addr);
    Dec(len);
  end;
end;


function do_read(h:thandle;addr:pointer;len : longint) : longint;
var
  ch: Char;
begin
  do_read:=0;
  while len>0 do
  begin
    ch:=ReadKey;
    PrintChar(ch);
    PChar(addr)^:=ch;
    Inc(addr);
    Inc(do_read);
    Dec(len);
    if ch=#13 then
      break;
  end;
end;


function do_filepos(handle : thandle) : longint;inline;
begin
end;


procedure do_seek(handle:thandle;pos : longint);inline;
begin
end;



function do_seekend(handle:thandle):longint;inline;
begin
end;


function do_filesize(handle : thandle) : longint;inline;
begin
end;


{ truncate at a given position }
procedure do_truncate (handle:thandle;pos:longint);inline;
begin
end;

procedure do_open(var f;p:pchar;flags:longint; pchangeable: boolean);inline;
{
  filerec and textrec have both handle and mode as the first items so
  they could use the same routine for opening/creating.
  when (flags and $100)   the file will be append
  when (flags and $1000)  the file will be truncate/rewritten
  when (flags and $10000) there is no check for close (needed for textfiles)
}
begin
end;


function do_isdevice(handle:THandle):boolean;inline;
begin
  do_isdevice:=true;
end;