sysfile.inc 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 2005 by Free Pascal development team
  4. Low level file functions
  5. GBA does not have any drive, so no file handling is needed.
  6. Copyright (c) 2006 by Francesco Lombardi
  7. See the file COPYING.FPC, included in this distribution,
  8. for details about the copyright.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  12. **********************************************************************}
  13. {****************************************************************************
  14. Low level File Routines
  15. All these functions can set InOutRes on errors
  16. ****************************************************************************}
  17. { close a file from the handle value }
  18. procedure do_close(handle : longint);
  19. begin
  20. end;
  21. procedure do_erase(p : pchar; pchangeable: boolean);
  22. begin
  23. if assigned (@rtl_do_erase) then
  24. rtl_do_erase(p);
  25. end;
  26. procedure do_rename(p1,p2 : pchar; p1changeable, p2changeable: boolean);
  27. begin
  28. if assigned (@rtl_do_rename) then
  29. rtl_do_rename(p1, p2);
  30. end;
  31. function do_write(h: longint; addr: pointer; len: longint) : longint;
  32. begin
  33. if assigned (rtl_do_write) then
  34. result := rtl_do_write(h, addr, len)
  35. else
  36. result := -1;
  37. end;
  38. function do_read(h: longint; addr: pointer; len: longint) : longint;
  39. begin
  40. if assigned (rtl_do_read) then
  41. result := rtl_do_read(h, addr, len)
  42. else
  43. result := -1;
  44. end;
  45. function do_filepos(handle: longint) : longint;
  46. begin
  47. if assigned (rtl_do_filepos) then
  48. result := rtl_do_filepos(handle)
  49. else
  50. result := -1;
  51. end;
  52. procedure do_seek(handle, pos: longint);
  53. begin
  54. if assigned (rtl_do_seek) then
  55. rtl_do_seek(handle, pos);
  56. end;
  57. function do_seekend(handle: longint):longint;
  58. begin
  59. if assigned (rtl_do_seekend) then
  60. result := rtl_do_seekend(handle)
  61. else
  62. result := -1;
  63. end;
  64. function do_filesize(handle : longint) : longint;
  65. begin
  66. result := -1;
  67. if assigned (rtl_do_filesize) then
  68. result := rtl_do_filesize(handle);
  69. end;
  70. { truncate at a given position }
  71. procedure do_truncate(handle, pos: longint);
  72. begin
  73. if assigned (rtl_do_truncate) then
  74. rtl_do_truncate(handle, pos);
  75. end;
  76. procedure do_open(var f;p:PFileTextRecChar;flags:longint; pchangeable: boolean);
  77. begin
  78. if assigned (rtl_do_open) then
  79. rtl_do_open(f, p, flags);
  80. end;
  81. function do_isdevice(handle: longint): boolean;
  82. begin
  83. result := false;
  84. if assigned (rtl_do_isdevice) then
  85. result := rtl_do_isdevice(handle);
  86. end;