PageRenderTime 24ms CodeModel.GetById 8ms RepoModel.GetById 0ms app.codeStats 0ms

/branches/Branch_3_30_Release/xpuu.pas

#
Pascal | 148 lines | 92 code | 13 blank | 43 comment | 13 complexity | 5b5eb4dc5429d7fda97c5a9634cfbc02 MD5 | raw file
Possible License(s): GPL-2.0, BSD-3-Clause
  1. { --------------------------------------------------------------- }
  2. { Dieser Quelltext ist urheberrechtlich geschuetzt. }
  3. { (c) 1991-1999 Peter Mandrella }
  4. { (c) 2000-2002 OpenXP-Team, http://www.openxp.de }
  5. { (c) 2002-2003 OpenXP/16, http://www.openxp16.de }
  6. { See list of contributors in authors.txt }
  7. { }
  8. { CrossPoint ist eine eingetragene Marke von Peter Mandrella. }
  9. { OpenXP ist eine eingetragene Marke von Markus Kaemmerer. }
  10. { }
  11. { Die Nutzungsbedingungen fuer diesen Quelltext finden Sie in der }
  12. { Datei SLIZENZ.TXT oder auf www.crosspoint.de/oldlicense.html. }
  13. { --------------------------------------------------------------- }
  14. { $Id: xpuu.pas 5982 2003-05-01 14:23:10Z mk $ }
  15. { CrossPoint - UUCICO-Interface }
  16. {$I XPDEFINE.INC}
  17. {$O+,F+}
  18. unit xpuu;
  19. interface
  20. uses
  21. xpglobal,
  22. {$IFDEF NCRT }
  23. xpcurses,
  24. {$ELSE }
  25. crt,
  26. {$ENDIF }
  27. dos,typeform,fileio,resource,xp0,xp1;
  28. const uu_ok = 0; { Ergebniscodes von ucico }
  29. uu_parerr = 1;
  30. uu_nologin = 2;
  31. uu_senderr = 3;
  32. uu_recerr = 4;
  33. function uucico(const CommandFile:pathstr; start:longint; var ende:boolean;
  34. var waittime:integer; var sendtime,rectime:longint;
  35. var uulogfile:string):integer;
  36. implementation { ---------------------------------------------------- }
  37. const ConfigFile = 'UUCICO.CFG';
  38. ResultFIle = 'UUCICOR.TMP';
  39. function uucico(const CommandFile:pathstr; start:longint; var ende:boolean;
  40. var waittime:integer; var sendtime,rectime:longint;
  41. var uulogfile:string):integer;
  42. var t : text;
  43. id : string[20];
  44. s0,s : string;
  45. p : byte;
  46. begin
  47. assign(t,ConfigFile);
  48. rewrite(t);
  49. writeln(t,'# ',getres(718));
  50. writeln(t);
  51. with boxpar^,comn[boxpar^.bport] do begin
  52. writeln(t,'Language=',ParLanguage);
  53. writeln(t,'Debug=',iifc(ParDebug,'Y','N'));
  54. writeln(t,'DebugWindow=1 80 4 ',screenlines-2);
  55. writeln(t,'Colors=$',hex(col.colmailer,2),' $',hex(col.colmailerhigh,2),
  56. ' $',hex(col.colmailerhi2,2));
  57. writeln(t,'Server=',boxname);
  58. writeln(t,'Node=',iifs(UUCPname<>'',UUCPname,pointname));
  59. writeln(t,'MaxWinSize=',MaxWinSize);
  60. writeln(t,'MaxPacketSize=',MaxPacketSize);
  61. writeln(t,'VarPacketSize=',iifc(varpacketsize,'Y','N'));
  62. writeln(t,'ForcePacketSize=',iifc(forcepacketsize,'Y','N'));
  63. writeln(t,'Protocols=',uuprotos);
  64. writeln(t,'SizeNegotiation=',iifc(sizenego,'Y','N'));
  65. writeln(t,'FilereqPath=',FilePath);
  66. writeln(t,'C-File=',CommandFile);
  67. writeln(t,'UUlogfile=',uulogfile);
  68. writeln(t,'FOSSIL=',iifc(Fossil,'Y','N'));
  69. writeln(t,'PortNr=',bport);
  70. if not fossil then begin
  71. writeln(t,'PortAdr=',hex(CPort,3));
  72. writeln(t,'IRQ=',CIrq);
  73. writeln(t,'TriggerLevel=',tlevel);
  74. end;
  75. writeln(t,'Baud=',baud);
  76. writeln(t,'IgnoreCD=',iifc(IgCD,'Y','N'));
  77. writeln(t,'IgnoreCTS=',iifc(IgCTS,'Y','N'));
  78. writeln(t,'UseRTS=',iifc(UseRTS,'Y','N'));
  79. writeln(t,'OnlineTime=',start);
  80. if ParOS2<>0 then
  81. writeln(t,'ReleaseTime=',ParOS2);
  82. if maxfsize>0 then
  83. writeln(t,'MaxFileSize=',maxfsize);
  84. close(t);
  85. end;
  86. if exist(ResultFile) then _era(ResultFile);
  87. shell('UUCICO.EXE '+ConfigFile,500,4); { --- uucico.exe }
  88. if not exist(ResultFile) then
  89. uucico:=uu_parerr
  90. else begin
  91. uucico:=uu_recerr;
  92. assign(t,ResultFile);
  93. reset(t);
  94. while not eof(t) do begin
  95. readln(t,s0);
  96. s:=trim(s0);
  97. p:=cpos('=',s);
  98. if (s<>'') and (left(s,1)<>';') and (left(s,1)<>'#') then begin
  99. id:=lstr(trim(left(s,p-1)));
  100. s:=trim(mid(s,p+1));
  101. if id='result' then uucico:=ival(s) else
  102. if id='stopdialing' then ende:=(ustr(s)<>'N') else
  103. if id='waittime' then waittime:=minmax(ival(s),0,maxlongint) else
  104. if id='sendtime' then sendtime:=minmax(ival(s),0,maxlongint) else
  105. if id='rectime' then rectime:=minmax(ival(s),0,maxlongint);
  106. end;
  107. end;
  108. close(t);
  109. _era(resultfile);
  110. end;
  111. end;
  112. end.
  113. {
  114. $Log: xpuu.pas,v $
  115. Revision 1.6.2.2 2003/05/01 14:23:02 mk
  116. - updated copyright headers
  117. Revision 1.6.2.1 2001/08/12 08:46:47 mk
  118. - added const parameters
  119. Revision 1.6 2000/05/02 19:14:03 hd
  120. xpcurses statt crt in den Units
  121. Revision 1.5 2000/04/13 12:48:41 mk
  122. - Anpassungen an Virtual Pascal
  123. - Fehler bei FindFirst behoben
  124. - Bugfixes bei 32 Bit Assembler-Routinen
  125. - Einige unkritische Memory Leaks beseitigt
  126. - Einge Write-Routinen durch Wrt/Wrt2 ersetzt
  127. - fehlende CVS Keywords in einigen Units hinzugefuegt
  128. - ZPR auf VP portiert
  129. - Winxp.ConsoleWrite provisorisch auf DOS/Linux portiert
  130. - Automatische Anpassung der Zeilenzahl an Consolengroesse in Win32
  131. }