sysfile.inc 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 2001 by Free Pascal development team
  4. Low leve file functions
  5. See the file COPYING.FPC, included in this distribution,
  6. for details about the copyright.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. **********************************************************************}
  11. {****************************************************************************
  12. Low level File Routines
  13. ****************************************************************************}
  14. procedure do_close(handle : thandle);inline;
  15. begin
  16. end;
  17. procedure do_erase(p : PAnsiChar; pchangeable: boolean);inline;
  18. begin
  19. end;
  20. procedure do_rename(p1,p2 : PAnsiChar; p1changeable, p2changeable: boolean);inline;
  21. begin
  22. end;
  23. function do_write(h:thandle;addr:pointer;len : longint) : longint;
  24. begin
  25. do_write:=len;
  26. while len>0 do
  27. begin
  28. PrintChar(PAnsiChar(addr)^);
  29. Inc(addr);
  30. Dec(len);
  31. end;
  32. end;
  33. function do_read(h:thandle;addr:pointer;len : longint) : longint;
  34. var
  35. ch: AnsiChar;
  36. begin
  37. do_read:=0;
  38. while len>0 do
  39. begin
  40. ch:=ReadKey;
  41. PrintChar(ch);
  42. PAnsiChar(addr)^:=ch;
  43. Inc(addr);
  44. Inc(do_read);
  45. Dec(len);
  46. if ch=#13 then
  47. break;
  48. end;
  49. end;
  50. function do_filepos(handle : thandle) : longint;inline;
  51. begin
  52. end;
  53. procedure do_seek(handle:thandle;pos : longint);inline;
  54. begin
  55. end;
  56. function do_seekend(handle:thandle):longint;inline;
  57. begin
  58. end;
  59. function do_filesize(handle : thandle) : longint;inline;
  60. begin
  61. end;
  62. { truncate at a given position }
  63. procedure do_truncate (handle:thandle;pos:longint);inline;
  64. begin
  65. end;
  66. procedure do_open(var f;p:PAnsiChar;flags:longint; pchangeable: boolean);inline;
  67. {
  68. filerec and textrec have both handle and mode as the first items so
  69. they could use the same routine for opening/creating.
  70. when (flags and $100) the file will be append
  71. when (flags and $1000) the file will be truncate/rewritten
  72. when (flags and $10000) there is no check for close (needed for textfiles)
  73. }
  74. begin
  75. end;
  76. function do_isdevice(handle:THandle):boolean;inline;
  77. begin
  78. do_isdevice:=true;
  79. end;