aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnselm R Garbe <garbeam@gmail.com>2009-07-10 16:27:14 +0100
committerAnselm R Garbe <garbeam@gmail.com>2009-07-10 16:27:14 +0100
commitdab8326e6428a5db6b7a6e08f40fa1e5ac77bc6f (patch)
treec239230a8b25687d42db4af626180620e9179850
parentcf65699a29683bff9d50187c18b160e21a538f48 (diff)
downloadst-dab8326e6428a5db6b7a6e08f40fa1e5ac77bc6f.tar.gz
st-dab8326e6428a5db6b7a6e08f40fa1e5ac77bc6f.zip
only compile tdump if DEBUG flag is set
-rw-r--r--st.c44
1 files changed, 20 insertions, 24 deletions
diff --git a/st.c b/st.c
index 559dcda..5f40ddd 100644
--- a/st.c
+++ b/st.c
@@ -43,11 +43,6 @@ enum { SCupdate, SCredraw };
43typedef int Color; 43typedef int Color;
44 44
45typedef struct { 45typedef struct {
46 KeySym k;
47 char s[ESCSIZ];
48} Key;
49
50typedef 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);
125static void tcursor(int); 120static void tcursor(int);
126static void tdeletechar(int); 121static void tdeletechar(int);
127static void tdeleteline(int); 122static void tdeleteline(int);
128static void tdump(void);
129static void tinsertblank(int); 123static void tinsertblank(int);
130static void tinsertblankline(int); 124static void tinsertblankline(int);
131static void tmoveto(int, int); 125static void tmoveto(int, int);
@@ -170,6 +164,26 @@ static int cmdfd;
170static pid_t pid; 164static pid_t pid;
171static int running; 165static int running;
172 166
167#ifdef DEBUG
168void
169tdump(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
173void 187void
174die(const char *errstr, ...) { 188die(const char *errstr, ...) {
175 va_list ap; 189 va_list ap;
@@ -798,24 +812,6 @@ tputs(char *s, int len) {
798} 812}
799 813
800void 814void
801tdump(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
818void
819tresize(int col, int row) { 815tresize(int col, int row) {
820 int i; 816 int i;
821 Line *line; 817 Line *line;