ex55.pp 707 B

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