aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/netfiles
diff options
context:
space:
mode:
authorDan Cross <cross@gajendra.net>2020-01-10 14:44:21 +0000
committerDan Cross <cross@gajendra.net>2020-01-10 14:54:30 +0000
commitfa325e9b42b0bdfb48857d1958d9fb7ceac55151 (patch)
tree81d26256d152435135bcb1ae43121979a49f5f2b /src/cmd/netfiles
parent77a0a5b5194d4441c86de097f2aae297cb75e2c2 (diff)
downloadplan9port-fa325e9b42b0bdfb48857d1958d9fb7ceac55151.tar.gz
plan9port-fa325e9b42b0bdfb48857d1958d9fb7ceac55151.tar.bz2
plan9port-fa325e9b42b0bdfb48857d1958d9fb7ceac55151.zip
Trivial changes: whitespace and modes.
Remote whitespace at the ends of lines. Remove blank lines from the ends of files. Change modes on source files so that they are not executable. Signed-off-by: Dan Cross <cross@gajendra.net>
Diffstat (limited to 'src/cmd/netfiles')
-rw-r--r--src/cmd/netfiles/acme.c13
-rw-r--r--src/cmd/netfiles/acme.h2
-rw-r--r--src/cmd/netfiles/main.c37
-rw-r--r--src/cmd/netfiles/wait.c7
4 files changed, 28 insertions, 31 deletions
diff --git a/src/cmd/netfiles/acme.c b/src/cmd/netfiles/acme.c
index ddd39284..0a6b2da8 100644
--- a/src/cmd/netfiles/acme.c
+++ b/src/cmd/netfiles/acme.c
@@ -153,7 +153,7 @@ int
winopenfd(Win *w, char *name, int mode)
{
char buf[100];
-
+
snprint(buf, sizeof buf, "%d/%s", w->id, name);
return fsopenfd(acmefs, buf, mode);
}
@@ -230,7 +230,7 @@ winreadaddr(Win *w, uint *q1)
char buf[40], *p;
uint q0;
int n;
-
+
n = fspread(wfid(w, "addr"), buf, sizeof buf-1, 0);
if(n <= 0)
return -1;
@@ -258,7 +258,7 @@ fsreadm(CFid *fid)
{
char *buf;
int n, tot, m;
-
+
m = 128;
buf = emalloc(m+1);
tot = 0;
@@ -288,7 +288,7 @@ winindex(void)
{
CFid *fid;
char *s;
-
+
mountacme();
if((fid = fsopen(acmefs, "index", OREAD)) == nil)
return nil;
@@ -595,7 +595,7 @@ eventreader(void *v)
Event e[2];
Win *w;
int i;
-
+
w = v;
i = 0;
for(;;){
@@ -623,7 +623,7 @@ wingetname(Win *w)
{
int n;
char *p;
-
+
n = winread(w, "tag", w->name, sizeof w->name-1);
if(n <= 0)
return nil;
@@ -633,4 +633,3 @@ wingetname(Win *w)
*p = 0;
return w->name;
}
-
diff --git a/src/cmd/netfiles/acme.h b/src/cmd/netfiles/acme.h
index 50997e97..c792a9c1 100644
--- a/src/cmd/netfiles/acme.h
+++ b/src/cmd/netfiles/acme.h
@@ -31,7 +31,7 @@ struct Win
Channel *c; /* chan(Event) */
Win *next;
Win *prev;
-
+
/* events */
int nbuf;
char name[1024];
diff --git a/src/cmd/netfiles/main.c b/src/cmd/netfiles/main.c
index 45e19416..baacb984 100644
--- a/src/cmd/netfiles/main.c
+++ b/src/cmd/netfiles/main.c
@@ -1,7 +1,7 @@
/*
* Remote file system editing client.
* Only talks to acme - external programs do all the hard work.
- *
+ *
* If you add a plumbing rule:
# /n/ paths go to simulator in acme
@@ -80,7 +80,7 @@ Arg*
arg(char *file, char *addr, Channel *c)
{
Arg *a;
-
+
a = emalloc(sizeof *a);
a->file = estrdup(file);
a->addr = estrdup(addr);
@@ -92,7 +92,7 @@ Win*
winbyid(int id)
{
Win *w;
-
+
for(w=windows; w; w=w->next)
if(w->id == id)
return w;
@@ -139,7 +139,7 @@ int
lookup(char *s, char **list)
{
int i;
-
+
for(i=0; list[i]; i++)
if(strcmp(list[i], s) == 0)
return i;
@@ -174,7 +174,7 @@ char*
expandarg(Win *w, Event *e)
{
uint q0, q1;
-
+
if(e->c2 == 'l') /* in tag - no choice but to accept acme's expansion */
return estrdup(e->text);
winaddr(w, ",");
@@ -187,7 +187,7 @@ expandarg(Win *w, Event *e)
if(e->oq0 == e->oq1 && e->q0 != e->q1 && !isdot(w, e->q0, e->q1)){
winaddr(w, "#%ud+#1-/[^ \t\\n]*/,#%ud-#1+/[^ \t\\n]*/", e->q0, e->q1);
q0 = winreadaddr(w, &q1);
- cprint("\tre-expand to %d-%d\n", q0, q1);
+ cprint("\tre-expand to %d-%d\n", q0, q1);
}else
winaddr(w, "#%ud,#%ud", e->q0, e->q1);
return winmread(w, "xdata");
@@ -202,7 +202,7 @@ doplumb(void *vm)
char *addr;
Plumbmsg *m;
Win *w;
-
+
m = vm;
if(m->ndata >= 1024){
fprint(2, "insanely long file name (%d bytes) in plumb message (%.32s...)\n",
@@ -210,7 +210,7 @@ doplumb(void *vm)
plumbfree(m);
return;
}
-
+
addr = plumblookup(m->attr, "addr");
w = nametowin(m->data);
if(w == nil)
@@ -230,7 +230,7 @@ plumbthread(void *v)
{
CFid *fid;
Plumbmsg *m;
-
+
threadsetname("plumbthread");
fid = plumbopenfid("netfileedit", OREAD);
if(fid == nil){
@@ -249,7 +249,7 @@ int
parsename(char *name, char **server, char **path)
{
char *p, *nul;
-
+
cleanname(name);
if(strncmp(name, "/n/", 3) != 0 && name[3] == 0)
return -1;
@@ -326,9 +326,9 @@ filethread(void *v)
winname(w, a->file);
winprint(w, "tag", "Get Put Look ");
c = wineventchan(w);
-
+
goto caseGet;
-
+
while((e=recvp(c)) != nil){
if(e->c1!='K')
dprint("acme %E\n", e);
@@ -352,7 +352,7 @@ filethread(void *v)
winaddr(w, ",");
winprint(w, "data", "[reading...]");
winaddr(w, ",");
- cprint("9 netfileget %s%q %q\n",
+ cprint("9 netfileget %s%q %q\n",
strcmp(type, "file") == 0 ? "" : "-d", server, path);
if(strcmp(type, "file")==0)
twait(pipetowin(w, "data", 2, "9 netfileget %q %q", server, path));
@@ -508,7 +508,7 @@ mkwin(char *name)
Arg *a;
Channel *c;
Win *w;
-
+
c = chancreate(sizeof(void*), 0);
a = arg(name, nil, c);
threadcreate(filethread, a, STACK);
@@ -521,12 +521,12 @@ void
loopthread(void *v)
{
QLock lk;
-
+
threadsetname("loopthread");
qlock(&lk);
qlock(&lk);
}
-
+
void
threadmain(int argc, char **argv)
{
@@ -540,7 +540,7 @@ threadmain(int argc, char **argv)
default:
usage();
}ARGEND
-
+
if(argc)
usage();
@@ -551,10 +551,9 @@ threadmain(int argc, char **argv)
fmtinstall('E', eventfmt);
doquote = needsrcquote;
quotefmtinstall();
-
+
twaitinit();
threadcreate(plumbthread, nil, STACK);
threadcreate(loopthread, nil, STACK);
threadexits(nil);
}
-
diff --git a/src/cmd/netfiles/wait.c b/src/cmd/netfiles/wait.c
index 3434ebc8..0d603297 100644
--- a/src/cmd/netfiles/wait.c
+++ b/src/cmd/netfiles/wait.c
@@ -61,7 +61,7 @@ waitthread(void *v)
wq[nwq++] = w;
}
break;
-
+
case 1:
dprint("wait: req for pid %d chan %p\n", r.pid, r.c);
for(i=0; i<nwq; i++){
@@ -89,7 +89,7 @@ twaitfor(int pid)
{
Waitreq r;
Waitmsg *w;
-
+
r.pid = pid;
r.c = chancreate(sizeof(Waitmsg*), 1);
send(twaitchan, &r);
@@ -103,7 +103,7 @@ twait(int pid)
{
int x;
Waitmsg *w;
-
+
w = twaitfor(pid);
x = w->msg[0] != 0 ? -1 : 0;
free(w);
@@ -117,4 +117,3 @@ twaitinit(void)
twaitchan = chancreate(sizeof(Waitreq), 10);
threadcreate(waitthread, nil, 128*1024);
}
-