Xinqi Bao's Git
projects
/
st.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
Create a function for DEC test
[st.git]
/
st.c
diff --git
a/st.c
b/st.c
index
9a979ea
..
2945c1b
100644
(file)
--- a/
st.c
+++ b/
st.c
@@
-394,6
+394,7
@@
static void tsetmode(bool, bool, int *, int);
static void tfulldirt(void);
static void techo(char *, int);
static bool tcontrolcode(uchar );
static void tfulldirt(void);
static void techo(char *, int);
static bool tcontrolcode(uchar );
+static void tdectest(char );
static int32_t tdefcolor(int *, int *, int);
static void tselcs(void);
static void tdeftran(char);
static int32_t tdefcolor(int *, int *, int);
static void tselcs(void);
static void tdeftran(char);
@@
-2425,6
+2426,19
@@
tcontrolcode(uchar ascii) {
return 1;
}
return 1;
}
+void
+tdectest(char c) {
+ static char E[UTF_SIZ] = "E";
+ int x, y;
+
+ if(c == '8') { /* DEC screen alignment test. */
+ for(x = 0; x < term.col; ++x) {
+ for(y = 0; y < term.row; ++y)
+ tsetchar(E, &term.c.attr, x, y);
+ }
+ }
+}
+
void
tputc(char *c, int len) {
uchar ascii;
void
tputc(char *c, int len) {
uchar ascii;
@@
-2504,15
+2518,7
@@
tputc(char *c, int len) {
tdeftran(ascii);
tselcs();
} else if(term.esc & ESC_TEST) {
tdeftran(ascii);
tselcs();
} else if(term.esc & ESC_TEST) {
- if(ascii == '8') { /* DEC screen alignment test. */
- char E[UTF_SIZ] = "E";
- int x, y;
-
- for(x = 0; x < term.col; ++x) {
- for(y = 0; y < term.row; ++y)
- tsetchar(E, &term.c.attr, x, y);
- }
- }
+ tdectest(ascii);
} else {
switch(ascii) {
case '[':
} else {
switch(ascii) {
case '[':