sysfile.inc 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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);
  15. begin
  16. end;
  17. procedure do_erase(p : pchar);
  18. begin
  19. end;
  20. procedure do_rename(p1,p2 : pchar);
  21. begin
  22. end;
  23. function do_write(h:thandle;addr:pointer;len : longint) : longint;
  24. var
  25. regs: Registers;
  26. begin
  27. regs.AH := $40;
  28. regs.BX := h;
  29. regs.CX := len;
  30. regs.DS := Seg(addr^);
  31. regs.DX := Ofs(addr^);
  32. MsDos(regs);
  33. if (regs.Flags and fCarry) <> 0 then
  34. begin
  35. GetInOutRes(regs.AX);
  36. exit(0);
  37. end;
  38. do_write := regs.AX;
  39. end;
  40. function do_read(h:thandle;addr:pointer;len : longint) : longint;
  41. var
  42. regs: Registers;
  43. begin
  44. regs.AH := $3F;
  45. regs.BX := h;
  46. regs.CX := len;
  47. regs.DS := Seg(addr^);
  48. regs.DX := Ofs(addr^);
  49. MsDos(regs);
  50. if (regs.Flags and FCarry) <> 0 then
  51. begin
  52. GetInOutRes(regs.AX);
  53. exit(0);
  54. end;
  55. do_read := regs.AX;
  56. end;
  57. function do_filepos(handle : thandle) : longint;
  58. begin
  59. end;
  60. procedure do_seek(handle:thandle;pos : longint);
  61. begin
  62. end;
  63. function do_seekend(handle:thandle):longint;
  64. begin
  65. end;
  66. function do_filesize(handle : thandle) : longint;
  67. begin
  68. end;
  69. { truncate at a given position }
  70. procedure do_truncate (handle:thandle;pos:longint);
  71. begin
  72. end;
  73. procedure do_open(var f;p:pchar;flags:longint);
  74. begin
  75. end;
  76. function do_isdevice(handle:THandle):boolean;
  77. var
  78. regs: Registers;
  79. begin
  80. regs.AX := $4400;
  81. regs.BX := handle;
  82. MsDos(regs);
  83. do_isdevice := (regs.DL and $80) <> 0;
  84. if (regs.Flags and fCarry) <> 0 then
  85. GetInOutRes(regs.AX);
  86. end;