diff options
| author | Anselm R Garbe <garbeam@gmail.com> | 2009-07-10 16:27:14 +0100 |
|---|---|---|
| committer | Anselm R Garbe <garbeam@gmail.com> | 2009-07-10 16:27:14 +0100 |
| commit | dab8326e6428a5db6b7a6e08f40fa1e5ac77bc6f (patch) | |
| tree | c239230a8b25687d42db4af626180620e9179850 | |
| parent | cf65699a29683bff9d50187c18b160e21a538f48 (diff) | |
| download | st-dab8326e6428a5db6b7a6e08f40fa1e5ac77bc6f.tar.gz st-dab8326e6428a5db6b7a6e08f40fa1e5ac77bc6f.zip | |
only compile tdump if DEBUG flag is set
| -rw-r--r-- | st.c | 44 |
1 files changed, 20 insertions, 24 deletions
| @@ -43,11 +43,6 @@ enum { SCupdate, SCredraw }; | |||
| 43 | typedef int Color; | 43 | typedef int Color; |
| 44 | 44 | ||
| 45 | typedef struct { | 45 | typedef struct { |
| 46 | KeySym k; | ||
| 47 | char s[ESCSIZ]; | ||
| 48 | } Key; | ||
| 49 | |||
| 50 | typedef struct { | ||
| 51 | char c; /* character code */ | 46 | char c; /* character code */ |
| 52 | char mode; /* attribute flags */ | 47 | char mode; /* attribute flags */ |
| 53 | Color fg; /* foreground */ | 48 | Color fg; /* foreground */ |
| @@ -125,7 +120,6 @@ static void tcpos(int); | |||
| 125 | static void tcursor(int); | 120 | static void tcursor(int); |
| 126 | static void tdeletechar(int); | 121 | static void tdeletechar(int); |
| 127 | static void tdeleteline(int); | 122 | static void tdeleteline(int); |
| 128 | static void tdump(void); | ||
| 129 | static void tinsertblank(int); | 123 | static void tinsertblank(int); |
| 130 | static void tinsertblankline(int); | 124 | static void tinsertblankline(int); |
| 131 | static void tmoveto(int, int); | 125 | static void tmoveto(int, int); |
| @@ -170,6 +164,26 @@ static int cmdfd; | |||
| 170 | static pid_t pid; | 164 | static pid_t pid; |
| 171 | static int running; | 165 | static int running; |
| 172 | 166 | ||
| 167 | #ifdef DEBUG | ||
| 168 | void | ||
| 169 | tdump(void) { | ||
| 170 | int row, col; | ||
| 171 | Glyph c; | ||
| 172 | |||
| 173 | for(row = 0; row < term.row; row++) { | ||
| 174 | for(col = 0; col < term.col; col++) { | ||
| 175 | if(col == term.c.x && row == term.c.y) | ||
| 176 | putchar('#'); | ||
| 177 | else { | ||
| 178 | c = term.line[row][col]; | ||
| 179 | putchar(c.state & CRset ? c.c : '.'); | ||
| 180 | } | ||
| 181 | } | ||
| 182 | putchar('\n'); | ||
| 183 | } | ||
| 184 | } | ||
| 185 | #endif | ||
| 186 | |||
| 173 | void | 187 | void |
| 174 | die(const char *errstr, ...) { | 188 | die(const char *errstr, ...) { |
| 175 | va_list ap; | 189 | va_list ap; |
| @@ -798,24 +812,6 @@ tputs(char *s, int len) { | |||
| 798 | } | 812 | } |
| 799 | 813 | ||
| 800 | void | 814 | void |
| 801 | tdump(void) { | ||
| 802 | int row, col; | ||
| 803 | Glyph c; | ||
| 804 | |||
| 805 | for(row = 0; row < term.row; row++) { | ||
| 806 | for(col = 0; col < term.col; col++) { | ||
| 807 | if(col == term.c.x && row == term.c.y) | ||
| 808 | putchar('#'); | ||
| 809 | else { | ||
| 810 | c = term.line[row][col]; | ||
| 811 | putchar(c.state & CRset ? c.c : '.'); | ||
| 812 | } | ||
| 813 | } | ||
| 814 | putchar('\n'); | ||
| 815 | } | ||
| 816 | } | ||
| 817 | |||
| 818 | void | ||
| 819 | tresize(int col, int row) { | 815 | tresize(int col, int row) { |
| 820 | int i; | 816 | int i; |
| 821 | Line *line; | 817 | Line *line; |
