14 |
|
#include "copyright.h" |
15 |
|
|
16 |
|
#include <stdio.h> |
17 |
– |
|
17 |
|
#include <stdlib.h> |
18 |
< |
|
18 |
> |
#include <string.h> |
19 |
|
#include <X11/Xlib.h> |
20 |
|
|
21 |
|
#include "x11twind.h" |
22 |
|
|
24 |
– |
#ifndef BSD |
25 |
– |
#define bzero(d,n) (void)memset(d,0,n) |
26 |
– |
#endif |
27 |
– |
|
23 |
|
#define checkcurs(t) if ((t)->cursor) togglecurs(t) |
24 |
|
|
25 |
|
#define restorecurs checkcurs |
88 |
|
int c; |
89 |
|
register TEXTWIND *t; |
90 |
|
{ |
91 |
+ |
char ch[2]; |
92 |
+ |
|
93 |
|
checkcurs(t); |
94 |
|
switch (c) { |
95 |
|
case '\n': |
110 |
|
default: |
111 |
|
if (t->c >= t->nc) |
112 |
|
xt_putc('\n', t); |
113 |
+ |
ch[0] = c; ch[1] = '\0'; |
114 |
|
XDrawImageString(t->dpy, t->w, t->gc, LEFTMAR+t->c*Width(t->f), |
115 |
< |
YStart(t->f)+t->r*Height(t->f), &c, 1); |
115 |
> |
YStart(t->f)+t->r*Height(t->f), ch, 1); |
116 |
|
t->lp[t->r][t->c++] = c; |
117 |
|
break; |
118 |
|
} |
157 |
|
XClearArea(t->dpy, t->w, LEFTMAR, (t->nr-1)*Height(t->f), |
158 |
|
t->nc*Width(t->f), Height(t->f),(Bool) 0); |
159 |
|
|
160 |
< |
bzero(cp, t->nc); |
160 |
> |
memset(cp, '\0', t->nc); |
161 |
|
restorecurs(t); /* should we reposition cursor? */ |
162 |
|
} |
163 |
|
|
184 |
|
/* clear new line */ |
185 |
|
XClearArea(t->dpy, t->w, LEFTMAR, r*Height(t->f), |
186 |
|
t->nc*Width(t->f), Height(t->f), (Bool) 0); |
187 |
< |
bzero(cp, t->nc); |
187 |
> |
memset(cp, '\0', t->nc); |
188 |
|
restorecurs(t); /* should we reposition cursor? */ |
189 |
|
} |
190 |
|
|
213 |
|
|
214 |
|
XClearWindow(t->dpy, t->w); |
215 |
|
for (i = 0; i < t->nr; i++) |
216 |
< |
bzero(t->lp[i], t->nc); |
216 |
> |
memset(t->lp[i], '\0', t->nc); |
217 |
|
t->r = t->c = 0; |
218 |
|
restorecurs(t); |
219 |
|
} |