mirror of
https://github.com/KDE/konsole.git
synced 2026-01-11 16:48:16 -05:00
added test proggy
svn path=/trunk/kdebase/konsole/; revision=14224
This commit is contained in:
53
tests/audit.c
Normal file
53
tests/audit.c
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
|
||||
This is a tiny test program that can be used to track down
|
||||
strange effects of the emulation.
|
||||
|
||||
Make:
|
||||
|
||||
- gcc -o audit audit.c
|
||||
|
||||
Usage:
|
||||
|
||||
- In TEWidget.C let syslog be stdout.
|
||||
- konsole > ttt
|
||||
- produce the effect in question.
|
||||
- run this program.
|
||||
pressing any key advances the audit
|
||||
^C terminates.
|
||||
|
||||
You need to make sure that the size of the screen matches
|
||||
the one being debugged.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <termios.h>
|
||||
#include <unistd.h>
|
||||
|
||||
struct termios save;
|
||||
struct termios curr;
|
||||
|
||||
#define HERE fprintf(stderr,"%s(%d): here.\n",__FILE__,__LINE__)
|
||||
|
||||
main()
|
||||
{ int cc;
|
||||
FILE* sysin = fopen("ttt","r");
|
||||
tcgetattr(0, &save);
|
||||
tcgetattr(0, &curr);
|
||||
cfmakeraw(&curr);
|
||||
tcsetattr(0, TCSANOW, &curr);
|
||||
cc = fgetc(sysin);
|
||||
while( cc > 0 )
|
||||
{ int tmp;
|
||||
while (cc > 0)
|
||||
{
|
||||
fputc(cc,stdout); cc = fgetc(sysin);
|
||||
if (cc == 0x1b) break;
|
||||
}
|
||||
tmp = fgetc(stdin);
|
||||
if (tmp == 3) break;
|
||||
}
|
||||
tcsetattr(0, TCSANOW, &save);
|
||||
}
|
||||
Reference in New Issue
Block a user