mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-13 12:49:20 +02:00
+ misising part of r30759 (commit of sysstrh.inc shouldn't have gone in r30759):
slightly modified patch by lelekx to implement plugable file routines for the embedded target, resolves issue #22918 git-svn-id: trunk@30764 -
This commit is contained in:
parent
f2a5672355
commit
8ee9550d22
@ -24,57 +24,92 @@
|
|||||||
{ close a file from the handle value }
|
{ close a file from the handle value }
|
||||||
procedure do_close(handle : longint);
|
procedure do_close(handle : longint);
|
||||||
begin
|
begin
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure do_erase(p : pchar; pchangeable: boolean);
|
procedure do_erase(p : pchar; pchangeable: boolean);
|
||||||
begin
|
begin
|
||||||
|
if assigned (@rtl_do_erase) then
|
||||||
|
rtl_do_erase(p);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure do_rename(p1,p2 : pchar; p1changeable, p2changeable: boolean);
|
procedure do_rename(p1,p2 : pchar; p1changeable, p2changeable: boolean);
|
||||||
begin
|
begin
|
||||||
|
if assigned (@rtl_do_rename) then
|
||||||
|
rtl_do_rename(p1, p2);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function do_write(h: longint; addr: pointer; len: longint) : longint;
|
function do_write(h: longint; addr: pointer; len: longint) : longint;
|
||||||
begin
|
begin
|
||||||
result := -1;
|
if assigned (rtl_do_write) then
|
||||||
|
result := rtl_do_write(h, addr, len)
|
||||||
|
else
|
||||||
|
result := -1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function do_read(h: longint; addr: pointer; len: longint) : longint;
|
function do_read(h: longint; addr: pointer; len: longint) : longint;
|
||||||
begin
|
begin
|
||||||
result := -1;
|
if assigned (rtl_do_read) then
|
||||||
|
result := rtl_do_read(h, addr, len)
|
||||||
|
else
|
||||||
|
result := -1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function do_filepos(handle: longint) : longint;
|
function do_filepos(handle: longint) : longint;
|
||||||
begin
|
begin
|
||||||
result := -1;
|
if assigned (rtl_do_filepos) then
|
||||||
|
result := rtl_do_filepos(handle)
|
||||||
|
else
|
||||||
|
result := -1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure do_seek(handle, pos: longint);
|
procedure do_seek(handle, pos: longint);
|
||||||
begin
|
begin
|
||||||
|
if assigned (rtl_do_seek) then
|
||||||
|
rtl_do_seek(handle, pos);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function do_seekend(handle: longint):longint;
|
function do_seekend(handle: longint):longint;
|
||||||
begin
|
begin
|
||||||
result := -1;
|
if assigned (rtl_do_seekend) then
|
||||||
|
result := rtl_do_seekend(handle)
|
||||||
|
else
|
||||||
|
result := -1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function do_filesize(handle : longint) : longint;
|
function do_filesize(handle : longint) : longint;
|
||||||
begin
|
begin
|
||||||
result := -1;
|
result := -1;
|
||||||
|
if assigned (@rtl_do_filesize) then
|
||||||
|
result := rtl_do_filesize(handle);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
{ truncate at a given position }
|
{ truncate at a given position }
|
||||||
procedure do_truncate(handle, pos: longint);
|
procedure do_truncate(handle, pos: longint);
|
||||||
begin
|
begin
|
||||||
|
if assigned (@rtl_do_truncate) then
|
||||||
|
rtl_do_truncate(handle, pos);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure do_open(var f;p:PFileTextRecChar;flags:longint; pchangeable: boolean);
|
procedure do_open(var f;p:PFileTextRecChar;flags:longint; pchangeable: boolean);
|
||||||
begin
|
begin
|
||||||
|
if assigned (@rtl_do_open) then
|
||||||
|
rtl_do_open(f, p, flags);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function do_isdevice(handle: longint): boolean;
|
function do_isdevice(handle: longint): boolean;
|
||||||
begin
|
begin
|
||||||
result := false;
|
result := false;
|
||||||
|
if assigned (@rtl_do_isdevice) then
|
||||||
|
result := rtl_do_isdevice(handle);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user