dosh.inc 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 1999-2000 by the Free Pascal development team.
  5. Dos unit for BP7 compatible RTL - Interface declarations
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. Const
  13. {Bitmasks for CPU Flags}
  14. fcarry = $0001;
  15. fparity = $0004;
  16. fauxiliary = $0010;
  17. fzero = $0040;
  18. fsign = $0080;
  19. foverflow = $0800;
  20. {Bitmasks for file attribute}
  21. readonly = $01;
  22. hidden = $02;
  23. sysfile = $04;
  24. volumeid = $08;
  25. directory = $10;
  26. archive = $20;
  27. anyfile = $3F;
  28. {File Status}
  29. fmclosed = $D7B0;
  30. fminput = $D7B1;
  31. fmoutput = $D7B2;
  32. fminout = $D7B3;
  33. Type
  34. { Needed for LFN Support }
  35. ComStr = String[FileNameLen];
  36. PathStr = String[FileNameLen];
  37. DirStr = String[FileNameLen];
  38. NameStr = String[FileNameLen];
  39. ExtStr = String[FileNameLen];
  40. {
  41. filerec.inc contains the definition of the filerec.
  42. textrec.inc contains the definition of the textrec.
  43. It is in a separate file to make it available in other units without
  44. having to use the DOS unit for it.
  45. }
  46. {$i filerec.inc}
  47. {$i textrec.inc}
  48. DateTime = packed record
  49. Year,
  50. Month,
  51. Day,
  52. Hour,
  53. Min,
  54. Sec : word;
  55. End;
  56. {$ifdef HASTHREADVAR}
  57. threadvar
  58. {$else HASTHREADVAR}
  59. var
  60. {$endif HASTHREADVAR}
  61. DosError : integer;
  62. {$ifdef cpui386}
  63. {Interrupt}
  64. Procedure Intr(intno: byte; var regs: registers);
  65. Procedure MSDos(var regs: registers);
  66. {$endif cpui386}
  67. {Info/Date/Time}
  68. Function DosVersion: Word;
  69. Procedure GetDate(var year, month, mday, wday: word);
  70. Procedure GetTime(var hour, minute, second, sec100: word);
  71. procedure SetDate(year,month,day: word);
  72. Procedure SetTime(hour,minute,second,sec100: word);
  73. Procedure UnpackTime(p: longint; var t: datetime);
  74. Procedure PackTime(var t: datetime; var p: longint);
  75. {Exec}
  76. Procedure Exec(const path: pathstr; const comline: comstr);
  77. Function DosExitCode: word;
  78. {Disk}
  79. Function DiskFree(drive: byte) : int64;
  80. Function DiskSize(drive: byte) : int64;
  81. Procedure FindFirst(const path: pathstr; attr: word; var f: searchRec);
  82. Procedure FindNext(var f: searchRec);
  83. Procedure FindClose(Var f: SearchRec);
  84. {File}
  85. Procedure GetFAttr(var f; var attr: word);
  86. Procedure GetFTime(var f; var time: longint);
  87. Function FSearch(path: pathstr; dirlist: string): pathstr;
  88. Function FExpand(const path: pathstr): pathstr;
  89. Procedure FSplit(path: pathstr; var dir: dirstr; var name: namestr; var ext: extstr);
  90. function GetShortName(var p : String) : boolean;
  91. function GetLongName(var p : String) : boolean;
  92. {Environment}
  93. Function EnvCount: longint;
  94. Function EnvStr (Index: longint): string;
  95. Function GetEnv(envvar: string): string;
  96. {Misc}
  97. Procedure SetFAttr(var f; attr: word);
  98. Procedure SetFTime(var f; time: longint);
  99. Procedure GetCBreak(var breakvalue: boolean);
  100. Procedure SetCBreak(breakvalue: boolean);
  101. Procedure GetVerify(var verify: boolean);
  102. Procedure SetVerify(verify: boolean);
  103. {Do Nothing Functions}
  104. Procedure SwapVectors;
  105. Procedure GetIntVec(intno: byte; var vector: pointer);
  106. Procedure SetIntVec(intno: byte; vector: pointer);
  107. Procedure Keep(exitcode: word);
  108. {
  109. $Log$
  110. Revision 1.4 2004-05-03 18:00:24 hajny
  111. * another global var to threadvar change, plus CVS log added
  112. Revision 1.3 2004/02/15 21:34:06 hajny
  113. * overloaded ExecuteProcess added, EnvStr param changed to longint
  114. Revision 1.2 2004/02/09 18:33:26 florian
  115. * intr and msdos for non i386 targets disabled
  116. Revision 1.1 2004/02/09 12:03:16 michael
  117. + Switched to single interface in dosh.inc
  118. }