fpredir.pas 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857
  1. {
  2. $Id$
  3. This file is part of the Free Pascal Integrated Development Environment
  4. Copyright (c) 1998 by Berczi Gabor
  5. Unit to redirect output and error to files
  6. Adapted from code donated to public domain by Schwartz Gabriel 20/03/1993
  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. Unit FPRedir;
  14. Interface
  15. {$R-}
  16. {$ifndef Unix}
  17. {$S-}
  18. {$endif}
  19. {$ifdef TP}
  20. {$define implemented}
  21. {$endif TP}
  22. {$ifdef Go32v2}
  23. {$define implemented}
  24. {$endif}
  25. {$ifdef Win32}
  26. {$define implemented}
  27. {$endif}
  28. {$ifdef Unix}
  29. {$define implemented}
  30. {$endif}
  31. { be sure msdos is not set for FPC compiler }
  32. {$ifdef FPC}
  33. {$UnDef MsDos}
  34. {$endif FPC}
  35. Var
  36. IOStatus : Integer;
  37. RedirErrorOut,RedirErrorIn,
  38. RedirErrorError : Integer;
  39. ExecuteResult : Word;
  40. {------------------------------------------------------------------------------}
  41. procedure InitRedir;
  42. function ExecuteRedir (Const ProgName, ComLine, RedirStdIn, RedirStdOut, RedirStdErr : String) : boolean;
  43. procedure DosExecute(ProgName, ComLine : String);
  44. function ChangeRedirOut(Const Redir : String; AppendToFile : Boolean) : Boolean;
  45. procedure RestoreRedirOut;
  46. procedure DisableRedirOut;
  47. procedure EnableRedirOut;
  48. function ChangeRedirIn(Const Redir : String) : Boolean;
  49. procedure RestoreRedirIn;
  50. procedure DisableRedirIn;
  51. procedure EnableRedirIn;
  52. function ChangeRedirError(Const Redir : String; AppendToFile : Boolean) : Boolean;
  53. procedure RestoreRedirError;
  54. procedure DisableRedirError;
  55. procedure EnableRedirError;
  56. procedure RedirDisableAll;
  57. procedure RedirEnableAll;
  58. {$ifdef win32}
  59. procedure Win32ShowMouse;
  60. {$endif win32}
  61. Implementation
  62. Uses
  63. {$ifdef go32v2}
  64. go32,
  65. {$endif go32v2}
  66. {$ifdef win32}
  67. windows,
  68. {$endif win32}
  69. {$ifdef Unix}
  70. {$ifdef VER1_0}
  71. linux,
  72. {$else}
  73. unix,
  74. {$endif}
  75. {$endif Unix}
  76. dos;
  77. var
  78. FIN,FOUT,FERR : ^File;
  79. RedirChangedOut,
  80. RedirChangedIn : Boolean;
  81. RedirChangedError : Boolean;
  82. InRedirDisabled,OutRedirDisabled,ErrorRedirDisabled : Boolean;
  83. {*****************************************************************************
  84. Dos
  85. *****************************************************************************}
  86. {$ifdef implemented}
  87. {$ifdef TP}
  88. {$ifndef win32}
  89. const
  90. UnusedHandle = -1;
  91. StdInputHandle = 0;
  92. StdOutputHandle = 1;
  93. StdErrorHandle = 2;
  94. {$endif win32}
  95. Type
  96. PtrRec = packed record
  97. Ofs, Seg : Word;
  98. end;
  99. PHandles = ^THandles;
  100. THandles = Array [Byte] of Byte;
  101. PWord = ^Word;
  102. Var
  103. MinBlockSize : Word;
  104. MyBlockSize : Word;
  105. Handles : PHandles;
  106. PrefSeg : Word;
  107. OldHandleOut,OldHandleIn,OldHandleError : Byte;
  108. {$endif TP}
  109. var
  110. TempHOut, TempHIn,TempHError : longint;
  111. { For Unix the following functions exist
  112. Function Dup(oldfile:longint;var newfile:longint):Boolean;
  113. Function Dup2(oldfile,newfile:longint):Boolean;
  114. Function fdClose(fd:longint):boolean;
  115. }
  116. {$ifdef go32v2}
  117. function dup(fh : longint;var nh : longint) : boolean;
  118. var
  119. Regs : Registers;
  120. begin
  121. Regs.ah:=$45;
  122. Regs.bx:=fh;
  123. MsDos (Regs);
  124. Dup:=true;
  125. If (Regs.Flags and fCarry)=0 then
  126. nh:=Regs.Ax
  127. else
  128. Dup:=false;
  129. end;
  130. function dup2(fh,nh : longint) : boolean;
  131. var
  132. Regs : Registers;
  133. begin
  134. Dup2:=true;
  135. If fh=nh then
  136. exit;
  137. Regs.ah:=$46;
  138. Regs.bx:=fh;
  139. Regs.cx:=nh;
  140. MsDos (Regs);
  141. If (Regs.Flags and fCarry)<>0 then
  142. Dup2:=false;
  143. end;
  144. Function FdClose (Handle : Longint) : boolean;
  145. var Regs: registers;
  146. begin
  147. Regs.Eax := $3e00;
  148. Regs.Ebx := Handle;
  149. MsDos(Regs);
  150. FdClose:=(Regs.Flags and fCarry)=0;
  151. end;
  152. {$endif def go32v2}
  153. {$ifdef win32}
  154. procedure Win32ShowMouse;
  155. begin
  156. ExecuteRedir(GetEnv('COMSPEC'),'/C rem echo This dummy call gets the mouse to become visible'
  157. ,'','nul','');
  158. end;
  159. Function FdClose (Handle : Longint) : boolean;
  160. begin
  161. { Do we need this ?? }
  162. FdClose:=true;
  163. end;
  164. {$endif}
  165. {$ifdef TP}
  166. Function FdClose (Handle : Longint) : boolean;
  167. begin
  168. { if executed as under GO32 this hangs the DOS-prompt }
  169. FdClose:=true;
  170. end;
  171. {$endif}
  172. {$I-}
  173. function FileExist(const FileName : PathStr) : Boolean;
  174. var
  175. f : file;
  176. Attr : word;
  177. begin
  178. Assign(f, FileName);
  179. GetFAttr(f, Attr);
  180. FileExist := DosError = 0;
  181. end;
  182. {............................................................................}
  183. function ChangeRedirOut(Const Redir : String; AppendToFile : Boolean) : Boolean;
  184. begin
  185. ChangeRedirOut:=False;
  186. If Redir = '' then Exit;
  187. Assign (FOUT^, Redir);
  188. If AppendToFile and FileExist(Redir) then
  189. Begin
  190. Reset(FOUT^,1);
  191. Seek(FOUT^,FileSize(FOUT^));
  192. End else Rewrite (FOUT^);
  193. RedirErrorOut:=IOResult;
  194. IOStatus:=RedirErrorOut;
  195. If IOStatus <> 0 then Exit;
  196. {$ifndef FPC}
  197. Handles:=Ptr (prefseg, PWord (Ptr (prefseg, $34))^);
  198. OldHandleOut:=Handles^[StdOutputHandle];
  199. Handles^[StdOutputHandle]:=Handles^[FileRec (FOUT^).Handle];
  200. ChangeRedirOut:=True;
  201. OutRedirDisabled:=False;
  202. {$else}
  203. {$ifdef win32}
  204. if SetStdHandle(Std_Output_Handle,FileRec(FOUT^).Handle) then
  205. {$else not win32}
  206. if dup(StdOutputHandle,TempHOut) and
  207. dup2(FileRec(FOUT^).Handle,StdOutputHandle) then
  208. {$endif not win32}
  209. begin
  210. ChangeRedirOut:=True;
  211. OutRedirDisabled:=False;
  212. end;
  213. {$endif def FPC}
  214. RedirChangedOut:=True;
  215. end;
  216. function ChangeRedirIn(Const Redir : String) : Boolean;
  217. begin
  218. ChangeRedirIn:=False;
  219. If Redir = '' then Exit;
  220. Assign (FIN^, Redir);
  221. Reset(FIN^,1);
  222. RedirErrorIn:=IOResult;
  223. IOStatus:=RedirErrorIn;
  224. If IOStatus <> 0 then Exit;
  225. {$ifndef FPC}
  226. Handles:=Ptr (prefseg, PWord (Ptr (prefseg, $34))^);
  227. OldHandleIn:=Handles^[StdInputHandle];
  228. Handles^[StdInputHandle]:=Handles^[FileRec (FIN^).Handle];
  229. ChangeRedirIn:=True;
  230. InRedirDisabled:=False;
  231. {$else}
  232. {$ifdef win32}
  233. if SetStdHandle(Std_Input_Handle,FileRec(FIN^).Handle) then
  234. {$else not win32}
  235. if dup(StdInputHandle,TempHIn) and
  236. dup2(FileRec(FIN^).Handle,StdInputHandle) then
  237. {$endif not win32}
  238. begin
  239. ChangeRedirIn:=True;
  240. InRedirDisabled:=False;
  241. end;
  242. {$endif def FPC}
  243. RedirChangedIn:=True;
  244. end;
  245. function ChangeRedirError(Const Redir : String; AppendToFile : Boolean) : Boolean;
  246. begin
  247. ChangeRedirError:=False;
  248. If Redir = '' then Exit;
  249. Assign (FERR^, Redir);
  250. If AppendToFile and FileExist(Redir) then
  251. Begin
  252. Reset(FERR^,1);
  253. Seek(FERR^,FileSize(FERR^));
  254. End else Rewrite (FERR^);
  255. RedirErrorError:=IOResult;
  256. IOStatus:=RedirErrorError;
  257. If IOStatus <> 0 then Exit;
  258. {$ifndef FPC}
  259. Handles:=Ptr (prefseg, PWord (Ptr (prefseg, $34))^);
  260. OldHandleError:=Handles^[StdErrorHandle];
  261. Handles^[StdErrorHandle]:=Handles^[FileRec (FERR^).Handle];
  262. ChangeRedirError:=True;
  263. ErrorRedirDisabled:=False;
  264. {$else}
  265. {$ifdef win32}
  266. if SetStdHandle(Std_Error_Handle,FileRec(FERR^).Handle) then
  267. {$else not win32}
  268. if dup(StdErrorHandle,TempHError) and
  269. dup2(FileRec(FERR^).Handle,StdErrorHandle) then
  270. {$endif not win32}
  271. begin
  272. ChangeRedirError:=True;
  273. ErrorRedirDisabled:=False;
  274. end;
  275. {$endif}
  276. RedirChangedError:=True;
  277. end;
  278. {$IfDef MsDos}
  279. {Set HeapEnd Pointer to Current Used Heapsize}
  280. Procedure SmallHeap;assembler;
  281. asm
  282. mov bx,word ptr HeapPtr
  283. shr bx,4
  284. inc bx
  285. add bx,word ptr HeapPtr+2
  286. mov ax,PrefixSeg
  287. sub bx,ax
  288. mov es,ax
  289. mov ah,4ah
  290. int 21h
  291. end;
  292. {Set HeapEnd Pointer to Full Heapsize}
  293. Procedure FullHeap;assembler;
  294. asm
  295. mov bx,word ptr HeapEnd
  296. shr bx,4
  297. inc bx
  298. add bx,word ptr HeapEnd+2
  299. mov ax,PrefixSeg
  300. sub bx,ax
  301. mov es,ax
  302. mov ah,4ah
  303. int 21h
  304. end;
  305. {$EndIf MsDos}
  306. procedure RestoreRedirOut;
  307. begin
  308. If not RedirChangedOut then Exit;
  309. {$ifndef FPC}
  310. Handles^[StdOutputHandle]:=OldHandleOut;
  311. OldHandleOut:=StdOutputHandle;
  312. {$else}
  313. {$ifdef win32}
  314. SetStdHandle(Std_Output_Handle,StdOutputHandle);
  315. {$else not win32}
  316. dup2(TempHOut,StdOutputHandle);
  317. {$endif not win32}
  318. {$endif FPC}
  319. Close (FOUT^);
  320. fdClose(TempHOut);
  321. RedirChangedOut:=false;
  322. end;
  323. {............................................................................}
  324. procedure RestoreRedirIn;
  325. begin
  326. If not RedirChangedIn then Exit;
  327. {$ifndef FPC}
  328. Handles^[StdInputHandle]:=OldHandleIn;
  329. OldHandleIn:=StdInputHandle;
  330. {$else}
  331. {$ifdef win32}
  332. SetStdHandle(Std_Input_Handle,StdInputHandle);
  333. {$else not win32}
  334. dup2(TempHIn,StdInputHandle);
  335. {$endif not win32}
  336. {$endif}
  337. Close (FIn^);
  338. fdClose(TempHIn);
  339. RedirChangedIn:=false;
  340. end;
  341. {............................................................................}
  342. procedure DisableRedirIn;
  343. begin
  344. If not RedirChangedIn then Exit;
  345. If InRedirDisabled then Exit;
  346. {$ifndef FPC}
  347. Handles^[StdInputHandle]:=OldHandleIn;
  348. {$else}
  349. {$ifdef win32}
  350. SetStdHandle(Std_Input_Handle,StdInputHandle);
  351. {$else not win32}
  352. dup2(TempHIn,StdInputHandle);
  353. {$endif not win32}
  354. {$endif}
  355. InRedirDisabled:=True;
  356. end;
  357. {............................................................................}
  358. procedure EnableRedirIn;
  359. begin
  360. If not RedirChangedIn then Exit;
  361. If not InRedirDisabled then Exit;
  362. {$ifndef FPC}
  363. Handles:=Ptr (prefseg, PWord (Ptr (prefseg, $34))^);
  364. Handles^[StdInputHandle]:=Handles^[FileRec (FIn^).Handle];
  365. {$else}
  366. {$ifdef win32}
  367. SetStdHandle(Std_Input_Handle,FileRec(FIn^).Handle);
  368. {$else not win32}
  369. dup2(FileRec(FIn^).Handle,StdInputHandle);
  370. {$endif not win32}
  371. {$endif}
  372. InRedirDisabled:=False;
  373. end;
  374. {............................................................................}
  375. procedure DisableRedirOut;
  376. begin
  377. If not RedirChangedOut then Exit;
  378. If OutRedirDisabled then Exit;
  379. {$ifndef FPC}
  380. Handles^[StdOutputHandle]:=OldHandleOut;
  381. {$else}
  382. {$ifdef win32}
  383. SetStdHandle(Std_Output_Handle,StdOutputHandle);
  384. {$else not win32}
  385. dup2(TempHOut,StdOutputHandle);
  386. {$endif not win32}
  387. {$endif}
  388. OutRedirDisabled:=True;
  389. end;
  390. {............................................................................}
  391. procedure EnableRedirOut;
  392. begin
  393. If not RedirChangedOut then Exit;
  394. If not OutRedirDisabled then Exit;
  395. {$ifndef FPC}
  396. Handles:=Ptr (prefseg, PWord (Ptr (prefseg, $34))^);
  397. Handles^[StdOutputHandle]:=Handles^[FileRec (FOut^).Handle];
  398. {$else}
  399. {$ifdef win32}
  400. SetStdHandle(Std_Output_Handle,FileRec(FOut^).Handle);
  401. {$else not win32}
  402. dup2(FileRec(FOut^).Handle,StdOutputHandle);
  403. {$endif not win32}
  404. {$endif}
  405. OutRedirDisabled:=False;
  406. end;
  407. {............................................................................}
  408. procedure RestoreRedirError;
  409. begin
  410. If not RedirChangedError then Exit;
  411. {$ifndef FPC}
  412. Handles^[StdErrorHandle]:=OldHandleError;
  413. OldHandleError:=StdErrorHandle;
  414. {$else}
  415. {$ifdef win32}
  416. SetStdHandle(Std_Error_Handle,StdErrorHandle);
  417. {$else not win32}
  418. dup2(TempHError,StdErrorHandle);
  419. {$endif not win32}
  420. {$endif}
  421. Close (FERR^);
  422. fdClose(TempHError);
  423. RedirChangedError:=false;
  424. end;
  425. {............................................................................}
  426. procedure DisableRedirError;
  427. begin
  428. If not RedirChangedError then Exit;
  429. If ErrorRedirDisabled then Exit;
  430. {$ifndef FPC}
  431. Handles^[StdErrorHandle]:=OldHandleError;
  432. {$else}
  433. {$ifdef win32}
  434. SetStdHandle(Std_Error_Handle,StdErrorHandle);
  435. {$else not win32}
  436. dup2(TempHError,StdErrorHandle);
  437. {$endif not win32}
  438. {$endif}
  439. ErrorRedirDisabled:=True;
  440. end;
  441. {............................................................................}
  442. procedure EnableRedirError;
  443. begin
  444. If not RedirChangedError then Exit;
  445. If not ErrorRedirDisabled then Exit;
  446. {$ifndef FPC}
  447. Handles:=Ptr (prefseg, PWord (Ptr (prefseg, $34))^);
  448. Handles^[StdErrorHandle]:=Handles^[FileRec (FErr^).Handle];
  449. {$else}
  450. {$ifdef win32}
  451. SetStdHandle(Std_Error_Handle,FileRec(FErr^).Handle);
  452. {$else not win32}
  453. dup2(FileRec(FERR^).Handle,StdErrorHandle);
  454. {$endif not win32}
  455. {$endif}
  456. ErrorRedirDisabled:=False;
  457. end;
  458. {............................................................................}
  459. function ExecuteRedir (Const ProgName, ComLine, RedirStdIn, RedirStdOut, RedirStdErr : String) : boolean;
  460. Begin
  461. RedirErrorOut:=0; RedirErrorIn:=0; RedirErrorError:=0;
  462. ExecuteResult:=0;
  463. IOStatus:=0;
  464. if RedirStdIn<>'' then
  465. ChangeRedirIn(RedirStdIn);
  466. if RedirStdOut<>'' then
  467. ChangeRedirOut(RedirStdOut,false);
  468. if RedirStdErr<>'stderr' then
  469. ChangeRedirError(RedirStdErr,false);
  470. DosExecute(ProgName,ComLine);
  471. RestoreRedirOut;
  472. RestoreRedirIn;
  473. RestoreRedirError;
  474. ExecuteRedir:=(IOStatus=0) and (RedirErrorOut=0) and
  475. (RedirErrorIn=0) and (RedirErrorError=0) and
  476. (ExecuteResult=0);
  477. End;
  478. {............................................................................}
  479. procedure RedirDisableAll;
  480. begin
  481. If RedirChangedIn and not InRedirDisabled then
  482. DisableRedirIn;
  483. If RedirChangedOut and not OutRedirDisabled then
  484. DisableRedirOut;
  485. If RedirChangedError and not ErrorRedirDisabled then
  486. DisableRedirError;
  487. end;
  488. {............................................................................}
  489. procedure RedirEnableAll;
  490. begin
  491. If RedirChangedIn and InRedirDisabled then
  492. EnableRedirIn;
  493. If RedirChangedOut and OutRedirDisabled then
  494. EnableRedirOut;
  495. If RedirChangedError and ErrorRedirDisabled then
  496. EnableRedirError;
  497. end;
  498. procedure InitRedir;
  499. begin
  500. {$ifndef FPC}
  501. PrefSeg:=PrefixSeg;
  502. {$endif FPC}
  503. end;
  504. {$else not implemented}
  505. {*****************************************************************************
  506. Fake
  507. *****************************************************************************}
  508. function ExecuteRedir (Const ProgName, ComLine, RedirStdIn, RedirStdOut, RedirStdErr : String) : boolean;
  509. begin
  510. ExecuteRedir:=false;
  511. end;
  512. function ChangeRedirOut(Const Redir : String; AppendToFile : Boolean) : Boolean;
  513. begin
  514. ChangeRedirOut:=false;
  515. end;
  516. procedure RestoreRedirOut;
  517. begin
  518. end;
  519. procedure DisableRedirOut;
  520. begin
  521. end;
  522. procedure EnableRedirOut;
  523. begin
  524. end;
  525. function ChangeRedirIn(Const Redir : String) : Boolean;
  526. begin
  527. ChangeRedirIn:=false;
  528. end;
  529. procedure RestoreRedirIn;
  530. begin
  531. end;
  532. procedure DisableRedirIn;
  533. begin
  534. end;
  535. procedure EnableRedirIn;
  536. begin
  537. end;
  538. function ChangeRedirError(Const Redir : String; AppendToFile : Boolean) : Boolean;
  539. begin
  540. ChangeRedirError:=false;
  541. end;
  542. procedure RestoreRedirError;
  543. begin
  544. end;
  545. procedure DisableRedirError;
  546. begin
  547. end;
  548. procedure EnableRedirError;
  549. begin
  550. end;
  551. procedure RedirDisableAll;
  552. begin
  553. end;
  554. procedure RedirEnableAll;
  555. begin
  556. end;
  557. procedure InitRedir;
  558. begin
  559. end;
  560. {$endif not implemented}
  561. {............................................................................}
  562. procedure DosExecute(ProgName, ComLine : String);
  563. {$ifdef win32}
  564. var
  565. StoreInherit : BOOL;
  566. {$endif win32}
  567. Begin
  568. {$IfDef MsDos}
  569. SmallHeap;
  570. {$EndIf MsDos}
  571. SwapVectors;
  572. { Must use shell() for linux for the wildcard expansion (PFV) }
  573. {$ifdef Unix}
  574. IOStatus:=0;
  575. ExecuteResult:=Shell(Progname+' '+Comline);
  576. { Signal that causes the stop of the shell }
  577. IOStatus:=ExecuteResult and $7F;
  578. { Exit Code seems to be in the second byte,
  579. is this also true for BSD ??
  580. $80 bit is a CoreFlag apparently }
  581. ExecuteResult:=(ExecuteResult and $ff00) shr 8;
  582. {$else}
  583. {$ifdef win32}
  584. StoreInherit:=ExecInheritsHandles;
  585. ExecInheritsHandles:=true;
  586. {$endif win32}
  587. DosError:=0;
  588. Dos.Exec (ProgName, ComLine);
  589. {$ifdef win32}
  590. ExecInheritsHandles:=StoreInherit;
  591. {$endif win32}
  592. IOStatus:=DosError;
  593. ExecuteResult:=DosExitCode;
  594. {$endif}
  595. SwapVectors;
  596. {$IfDef MsDos}
  597. Fullheap;
  598. {$EndIf MsDos}
  599. End;
  600. {*****************************************************************************
  601. Initialize
  602. *****************************************************************************}
  603. var oldexit : pointer;
  604. procedure RedirExit; {$ifndef FPC}far;{$endif}
  605. begin
  606. exitproc:=oldexit;
  607. Dispose(FIn); Dispose(FOut); Dispose(FErr);
  608. end;
  609. Begin
  610. oldexit:=exitproc;
  611. exitproc:=@RedirExit;
  612. New(FIn); New(FOut); New(FErr);
  613. End.
  614. {
  615. $Log$
  616. Revision 1.1 2001-08-04 11:30:23 peter
  617. * ide works now with both compiler versions
  618. Revision 1.1.2.3 2001/03/14 17:57:08 pierre
  619. * fix invisible mouse problem for win32 on win9X
  620. Revision 1.1.2.2 2000/11/14 09:40:35 marco
  621. * Third batch renamefest
  622. Revision 1.1.2.1 2000/10/04 13:29:59 pierre
  623. * Get ExitCode for DosExecute in linux
  624. Revision 1.1 2000/07/13 09:48:35 michael
  625. + Initial import
  626. Revision 1.25 2000/05/17 10:19:53 pierre
  627. * Reset DosError to zero !
  628. Revision 1.24 1999/11/10 17:10:59 pierre
  629. + DosExecute to interface
  630. Revision 1.23 1999/09/22 13:03:27 pierre
  631. * Win32 ExecInheritsHandles typo problem
  632. Revision 1.22 1999/09/22 09:03:58 peter
  633. * typo fixed for win32
  634. Revision 1.21 1999/09/21 11:28:22 pierre
  635. + Redir for win32
  636. Revision 1.20 1999/08/05 16:54:36 peter
  637. * win32 fixes
  638. Revision 1.19 1999/08/03 20:22:36 peter
  639. + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
  640. + Desktop saving should work now
  641. - History saved
  642. - Clipboard content saved
  643. - Desktop saved
  644. - Symbol info saved
  645. * syntax-highlight bug fixed, which compared special keywords case sensitive
  646. (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
  647. * with 'whole words only' set, the editor didn't found occourences of the
  648. searched text, if the text appeared previously in the same line, but didn't
  649. satisfied the 'whole-word' condition
  650. * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
  651. (ie. the beginning of the selection)
  652. * when started typing in a new line, but not at the start (X=0) of it,
  653. the editor inserted the text one character more to left as it should...
  654. * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
  655. * Shift shouldn't cause so much trouble in TCodeEditor now...
  656. * Syntax highlight had problems recognizing a special symbol if it was
  657. prefixed by another symbol character in the source text
  658. * Auto-save also occours at Dos shell, Tool execution, etc. now...
  659. Revision 1.17 1999/05/01 23:45:07 pierre
  660. * FIn FOut FErr dispsoed at exit
  661. Revision 1.16 1999/04/29 22:57:09 pierre
  662. + added code for temporary disabling of redirection
  663. Revision 1.15 1999/04/07 21:55:52 peter
  664. + object support for browser
  665. * html help fixes
  666. * more desktop saving things
  667. * NODEBUG directive to exclude debugger
  668. Revision 1.14 1999/03/20 00:04:49 pierre
  669. * handle loss fixed
  670. Revision 1.13 1999/03/09 01:34:35 peter
  671. * linux unit
  672. Revision 1.12 1999/03/08 14:58:10 peter
  673. + prompt with dialogs for tools
  674. Revision 1.11 1999/03/01 15:42:01 peter
  675. + Added dummy entries for functions not yet implemented
  676. * MenuBar didn't update itself automatically on command-set changes
  677. * Fixed Debugging/Profiling options dialog
  678. * TCodeEditor converts spaces to tabs at save only if efUseTabChars is set
  679. * efBackSpaceUnindents works correctly
  680. + 'Messages' window implemented
  681. + Added '$CAP MSG()' and '$CAP EDIT' to available tool-macros
  682. + Added TP message-filter support (for ex. you can call GREP thru
  683. GREP2MSG and view the result in the messages window - just like in TP)
  684. * A 'var' was missing from the param-list of THelpFacility.TopicSearch,
  685. so topic search didn't work...
  686. * In FPHELP.PAS there were still context-variables defined as word instead
  687. of THelpCtx
  688. * StdStatusKeys() was missing from the statusdef for help windows
  689. + Topic-title for index-table can be specified when adding a HTML-files
  690. Revision 1.10 1999/02/22 12:46:58 peter
  691. * small fixes for linux and grep
  692. Revision 1.9 1999/02/22 11:12:33 pierre
  693. * dup and dup2 work for go32v2
  694. + also should work for linux (after linux.pp patch)
  695. Revision 1.8 1999/02/22 02:15:18 peter
  696. + default extension for save in the editor
  697. + Separate Text to Find for the grep dialog
  698. * fixed redir crash with tp7
  699. Revision 1.7 1999/02/20 15:18:32 peter
  700. + ctrl-c capture with confirm dialog
  701. + ascii table in the tools menu
  702. + heapviewer
  703. * empty file fixed
  704. * fixed callback routines in fpdebug to have far for tp7
  705. Revision 1.6 1999/02/05 13:51:43 peter
  706. * unit name of FPSwitches -> FPSwitch which is easier to use
  707. * some fixes for tp7 compiling
  708. }