File indexing completed on 2024-05-05 05:54:12
0001 /* 0002 0003 This is a tiny test program that can be used to track down 0004 strange effects of the emulation. 0005 0006 Make: 0007 0008 - gcc -o audit audit.c 0009 0010 Usage: 0011 0012 - In TEShell.C let syslog be stdout. 0013 - konsole > ttt 0014 - produce the effect in question. 0015 - run this program. 0016 pressing any key advances the audit 0017 ^C terminates. 0018 0019 You need to make sure that the size of the screen matches 0020 the one being debugged. 0021 0022 This code was written by Lars Doelle <lars.doelle@on-line.de>. 0023 This code is in the public domain. 0024 0025 */ 0026 0027 #include <stdio.h> 0028 #include <termios.h> 0029 #include <unistd.h> 0030 0031 struct termios save; 0032 struct termios curr; 0033 0034 #define HERE fprintf(stderr, "%s(%d): here.\n", __FILE__, __LINE__) 0035 0036 main() 0037 { 0038 int cc; 0039 FILE *sysin = fopen("ttt", "r"); 0040 tcgetattr(0, &save); 0041 tcgetattr(0, &curr); 0042 cfmakeraw(&curr); 0043 tcsetattr(0, TCSANOW, &curr); 0044 cc = fgetc(sysin); 0045 while (cc > 0) { 0046 int tmp; 0047 while (cc > 0) { 0048 fputc(cc, stdout); 0049 cc = fgetc(sysin); 0050 if (cc == 0x1b) 0051 break; 0052 } 0053 tmp = fgetc(stdin); 0054 if (tmp == 3) 0055 break; 0056 } 0057 tcsetattr(0, TCSANOW, &save); 0058 }