aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto E. Vargas Caballero <k0ga@shike2.com>2014-04-26 09:24:04 +0200
committerRoberto E. Vargas Caballero <k0ga@shike2.com>2014-04-28 18:38:05 +0200
commit43d74ef362b7dc5da3232cdc9412981ea6386df6 (patch)
tree4764b8e5732aebf9bea8e022277635608b44062b
parent3764f38fc805a8846bd18f1d555a10227fd14e29 (diff)
downloadst-43d74ef362b7dc5da3232cdc9412981ea6386df6.tar.gz
st-43d74ef362b7dc5da3232cdc9412981ea6386df6.zip
Create a function for DEC test
Almost of the sequences execute their action in a separate function, which is good because helps to read the full set of sequences faster.
-rw-r--r--st.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/st.c b/st.c
index 9a979ea..2945c1b 100644
--- a/st.c
+++ b/st.c
@@ -394,6 +394,7 @@ static void tsetmode(bool, bool, int *, int);
394static void tfulldirt(void); 394static void tfulldirt(void);
395static void techo(char *, int); 395static void techo(char *, int);
396static bool tcontrolcode(uchar ); 396static bool tcontrolcode(uchar );
397static void tdectest(char );
397static int32_t tdefcolor(int *, int *, int); 398static int32_t tdefcolor(int *, int *, int);
398static void tselcs(void); 399static void tselcs(void);
399static void tdeftran(char); 400static void tdeftran(char);
@@ -2426,6 +2427,19 @@ tcontrolcode(uchar ascii) {
2426} 2427}
2427 2428
2428void 2429void
2430tdectest(char c) {
2431 static char E[UTF_SIZ] = "E";
2432 int x, y;
2433
2434 if(c == '8') { /* DEC screen alignment test. */
2435 for(x = 0; x < term.col; ++x) {
2436 for(y = 0; y < term.row; ++y)
2437 tsetchar(E, &term.c.attr, x, y);
2438 }
2439 }
2440}
2441
2442void
2429tputc(char *c, int len) { 2443tputc(char *c, int len) {
2430 uchar ascii; 2444 uchar ascii;
2431 bool control; 2445 bool control;
@@ -2504,15 +2518,7 @@ tputc(char *c, int len) {
2504 tdeftran(ascii); 2518 tdeftran(ascii);
2505 tselcs(); 2519 tselcs();
2506 } else if(term.esc & ESC_TEST) { 2520 } else if(term.esc & ESC_TEST) {
2507 if(ascii == '8') { /* DEC screen alignment test. */ 2521 tdectest(ascii);
2508 char E[UTF_SIZ] = "E";
2509 int x, y;
2510
2511 for(x = 0; x < term.col; ++x) {
2512 for(y = 0; y < term.row; ++y)
2513 tsetchar(E, &term.c.attr, x, y);
2514 }
2515 }
2516 } else { 2522 } else {
2517 switch(ascii) { 2523 switch(ascii) {
2518 case '[': 2524 case '[':