~ubuntu-branches/ubuntu/dapper/fpc/dapper

« back to all changes in this revision

Viewing changes to docs/linuxex/ex55.pp

  • Committer: Bazaar Package Importer
  • Author(s): Carlos Laviola
  • Date: 2005-05-30 11:59:10 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050530115910-x5pbzm4qqta4i94h
Tags: 2.0.0-2
debian/fp-compiler.postinst.in: forgot to reapply the patch that
correctly creates the slave link to pc(1).  (Closes: #310907)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Program Example55;
2
 
 
3
 
uses TermIO;
4
 
 
5
 
{ Program to demonstrate the TCGetAttr/TCSetAttr/CFMakeRaw functions. }
6
 
 
7
 
procedure ShowTermios(var tios:Termios);
8
 
begin
9
 
  WriteLn('Input Flags  : $',hexstr(tios.c_iflag,8)+#13);
10
 
  WriteLn('Output Flags : $',hexstr(tios.c_oflag,8));
11
 
  WriteLn('Line Flags   : $',hexstr(tios.c_lflag,8));
12
 
  WriteLn('Control Flags: $',hexstr(tios.c_cflag,8));
13
 
end;
14
 
 
15
 
var
16
 
  oldios,
17
 
  tios : Termios;
18
 
begin
19
 
  WriteLn('Old attributes:');
20
 
  TCGetAttr(1,tios);
21
 
  ShowTermios(tios);
22
 
  oldios:=tios;
23
 
  Writeln('Setting raw terminal mode');  
24
 
  CFMakeRaw(tios);
25
 
  TCSetAttr(1,TCSANOW,tios);
26
 
  WriteLn('Current attributes:');
27
 
  TCGetAttr(1,tios);
28
 
  ShowTermios(tios);
29
 
  TCSetAttr(1,TCSANOW,oldios);
30
 
end.