|
@@ -9,7 +9,7 @@ erealloc(void *p, uint n)
|
|
|
{
|
|
|
p = realloc(p, n);
|
|
|
if(p == nil)
|
|
|
- threadprint(2, "realloc failed: %r");
|
|
|
+ fprint(2, "realloc failed: %r");
|
|
|
return p;
|
|
|
}
|
|
|
|
|
@@ -20,7 +20,7 @@ wnew(Win *w)
|
|
|
|
|
|
w->ctl = open("/mnt/acme/new/ctl", ORDWR);
|
|
|
if(w->ctl<0 || read(w->ctl, buf, 12)!=12)
|
|
|
- threadprint (2, "can't open window ctl file: %r");
|
|
|
+ fprint (2, "can't open window ctl file: %r");
|
|
|
ctlwrite(w, "noscroll\n");
|
|
|
w->winid = atoi(buf);
|
|
|
w->event = openfile(w, "event");
|
|
@@ -38,7 +38,7 @@ openfile(Win *w, char *f)
|
|
|
sprint(buf, "/mnt/acme/%d/%s", w->winid, f);
|
|
|
fd = open(buf, ORDWR|OCEXEC);
|
|
|
if(fd < 0)
|
|
|
- threadprint (2,"can't open window %s file: %r", f);
|
|
|
+ fprint (2,"can't open window %s file: %r", f);
|
|
|
return fd;
|
|
|
}
|
|
|
|
|
@@ -50,7 +50,7 @@ openbody(Win *w, int mode)
|
|
|
sprint(buf, "/mnt/acme/%d/body", w->winid);
|
|
|
w->body = Bopen(buf, mode|OCEXEC);
|
|
|
if(w->body == nil)
|
|
|
- threadprint(2,"can't open window body file: %r");
|
|
|
+ fprint(2,"can't open window body file: %r");
|
|
|
}
|
|
|
|
|
|
void
|
|
@@ -59,7 +59,7 @@ wwritebody(Win *w, char *s, int n)
|
|
|
if(w->body == nil)
|
|
|
openbody(w, OWRITE);
|
|
|
if(Bwrite(w->body, s, n) != n)
|
|
|
- threadprint(2,"write error to window: %r");
|
|
|
+ fprint(2,"write error to window: %r");
|
|
|
Bflush(w->body);
|
|
|
}
|
|
|
|
|
@@ -71,11 +71,11 @@ wreplace(Win *w, char *addr, char *repl, int nrepl)
|
|
|
if(w->data < 0)
|
|
|
w->data = openfile(w, "data");
|
|
|
if(write(w->addr, addr, strlen(addr)) < 0){
|
|
|
- threadprint(2, "mail: warning: badd address %s:%r\n", addr);
|
|
|
+ fprint(2, "mail: warning: badd address %s:%r\n", addr);
|
|
|
return;
|
|
|
}
|
|
|
if(write(w->data, repl, nrepl) != nrepl)
|
|
|
- threadprint(2, "writing data: %r");
|
|
|
+ fprint(2, "writing data: %r");
|
|
|
}
|
|
|
|
|
|
static int
|
|
@@ -104,10 +104,10 @@ wread(Win *w, uint q0, uint q1, char *data)
|
|
|
while(m < q1){
|
|
|
n = sprint(buf, "#%d", m);
|
|
|
if(write(w->addr, buf, n) != n)
|
|
|
- threadprint(2,"writing addr: %r");
|
|
|
+ fprint(2,"writing addr: %r");
|
|
|
n = read(w->data, buf, sizeof buf);
|
|
|
if(n <= 0)
|
|
|
- threadprint(2,"reading data: %r");
|
|
|
+ fprint(2,"reading data: %r");
|
|
|
nr = nrunes(buf, n);
|
|
|
while(m+nr >q1){
|
|
|
do; while(n>0 && (buf[--n]&0xC0)==0x80);
|
|
@@ -128,7 +128,7 @@ wselect(Win *w, char *addr)
|
|
|
if(w->addr < 0)
|
|
|
w->addr = openfile(w, "addr");
|
|
|
if(write(w->addr, addr, strlen(addr)) < 0)
|
|
|
- threadprint(2,"writing addr");
|
|
|
+ fprint(2,"writing addr");
|
|
|
ctlwrite(w, "dot=addr\n");
|
|
|
}
|
|
|
|
|
@@ -139,7 +139,7 @@ wtagwrite(Win *w, char *s, int n)
|
|
|
|
|
|
fd = openfile(w, "tag");
|
|
|
if(write(fd, s, n) != n)
|
|
|
- threadprint(2,"tag write: %r");
|
|
|
+ fprint(2,"tag write: %r");
|
|
|
close(fd);
|
|
|
}
|
|
|
|
|
@@ -150,7 +150,7 @@ ctlwrite(Win *w, char *s)
|
|
|
|
|
|
n = strlen(s);
|
|
|
if(write(w->ctl, s, n) != n)
|
|
|
- threadprint(2,"write error to ctl file: %r");
|
|
|
+ fprint(2,"write error to ctl file: %r");
|
|
|
}
|
|
|
|
|
|
int
|
|
@@ -206,7 +206,7 @@ getec(Win *w)
|
|
|
if(w->nbuf == 0){
|
|
|
w->nbuf = read(w->event, w->buf, sizeof w->buf);
|
|
|
if(w->nbuf <= 0)
|
|
|
- threadprint(2,"event read error: %r");
|
|
|
+ fprint(2,"event read error: %r");
|
|
|
w->bufp = w->buf;
|
|
|
}
|
|
|
w->nbuf--;
|
|
@@ -222,7 +222,7 @@ geten(Win *w)
|
|
|
while('0'<=(c=getec(w)) && c<='9')
|
|
|
n = n*10+(c-'0');
|
|
|
if(c != ' ')
|
|
|
- threadprint(2, "event number syntax");
|
|
|
+ fprint(2, "event number syntax");
|
|
|
return n;
|
|
|
}
|
|
|
|
|
@@ -258,7 +258,7 @@ wevent(Win *w, Event *e)
|
|
|
e->flag = geten(w);
|
|
|
e->nr = geten(w);
|
|
|
if(e->nr > EVENTSIZE)
|
|
|
- threadprint(2, "wevent: event string too long");
|
|
|
+ fprint(2, "wevent: event string too long");
|
|
|
e->nb = 0;
|
|
|
for(i=0; i<e->nr; i++){
|
|
|
e->r[i] = geter(w, e->b+e->nb, &nb);
|
|
@@ -267,7 +267,7 @@ wevent(Win *w, Event *e)
|
|
|
e->r[e->nr] = 0;
|
|
|
e->b[e->nb] = 0;
|
|
|
if(getec(w) != '\n')
|
|
|
- threadprint(2, "wevent: event syntax 2");
|
|
|
+ fprint(2, "wevent: event syntax 2");
|
|
|
}
|
|
|
|
|
|
void
|
|
@@ -282,7 +282,7 @@ wslave(Win *w, Channel *ce)
|
|
|
void
|
|
|
wwriteevent(Win *w, Event *e)
|
|
|
{
|
|
|
- threadprint(w->event, "%c%c%d %d\n", e->c1, e->c2, e->q0, e->q1);
|
|
|
+ fprint(w->event, "%c%c%d %d\n", e->c1, e->c2, e->q0, e->q1);
|
|
|
}
|
|
|
|
|
|
int
|