diff options
| author | Roberto E. Vargas Caballero <k0ga@shike2.com> | 2014-04-26 09:24:04 +0200 |
|---|---|---|
| committer | Roberto E. Vargas Caballero <k0ga@shike2.com> | 2014-04-28 18:38:05 +0200 |
| commit | 43d74ef362b7dc5da3232cdc9412981ea6386df6 (patch) | |
| tree | 4764b8e5732aebf9bea8e022277635608b44062b | |
| parent | 3764f38fc805a8846bd18f1d555a10227fd14e29 (diff) | |
| download | st-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.c | 24 |
1 files changed, 15 insertions, 9 deletions
| @@ -394,6 +394,7 @@ static void tsetmode(bool, bool, int *, int); | |||
| 394 | static void tfulldirt(void); | 394 | static void tfulldirt(void); |
| 395 | static void techo(char *, int); | 395 | static void techo(char *, int); |
| 396 | static bool tcontrolcode(uchar ); | 396 | static bool tcontrolcode(uchar ); |
| 397 | static void tdectest(char ); | ||
| 397 | static int32_t tdefcolor(int *, int *, int); | 398 | static int32_t tdefcolor(int *, int *, int); |
| 398 | static void tselcs(void); | 399 | static void tselcs(void); |
| 399 | static void tdeftran(char); | 400 | static void tdeftran(char); |
| @@ -2426,6 +2427,19 @@ tcontrolcode(uchar ascii) { | |||
| 2426 | } | 2427 | } |
| 2427 | 2428 | ||
| 2428 | void | 2429 | void |
| 2430 | tdectest(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 | |||
| 2442 | void | ||
| 2429 | tputc(char *c, int len) { | 2443 | tputc(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 '[': |
