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>
This commit is contained in:
Dan Cross 2020-01-10 14:44:21 +00:00
parent 77a0a5b519
commit fa325e9b42
1021 changed files with 5688 additions and 6193 deletions

View File

@ -42,7 +42,7 @@ g% cdsector 3149 | xd -b # 0x0c4d
55 aa - magic
0000020 88 - 88 = bootable
03 - 3 = 2.88MB diskette
03 - 3 = 2.88MB diskette
00 00 - load segment 0 means default 0x7C0
00 - system type (byte 5 of boot image)
00 - unused (0)
@ -58,13 +58,13 @@ g% cdsector `{h2d 0c4e} | xd -b
1+0 records out
0000000 eb 3c 00 00 00 00 00 00 00 00 00 00 02 00 00 00
0000010 00 00 00 00 00 00 00 00 12 00 02 00 00 00 00 00
0000020 00 00 00 00 00 16 1f 66 6a 00 51 50 06 53
0000020 00 00 00 00 00 16 1f 66 6a 00 51 50 06 53
31 c0
FREEBSD
0000000 eb 3c 00 00 00 00 00 00 00 00 00 00 02 00 00 00
0000010 00 00 00 00 00 00 00 00 12 00 02 00 00 00 00 00
0000020 00 00 00 00 00 16 1f 66 6a 00 51 50 06 53
0000020 00 00 00 00 00 16 1f 66 6a 00 51 50 06 53
31 c0
DOS 5
@ -171,7 +171,7 @@ Cupdatebootcat(Cdimg *cd)
Cputc(cd, 0); /* unused */
Cputnl(cd, 1, 2); /* 512-byte sector count for load */
Cputnl(cd, cd->bootdirec->block, 4); /* ptr to disk image */
Cwseek(cd, o);
Cwseek(cd, o);
}
void

View File

@ -125,7 +125,7 @@ opencd(char *file, Cdinfo info)
}
/* lowercase because of isostring */
if(strstr(cd->iso.systemid, "iso9660") == nil
if(strstr(cd->iso.systemid, "iso9660") == nil
&& strstr(cd->iso.systemid, "utf8") == nil) {
werrstr("unknown systemid %s", cd->iso.systemid);
free(cd);
@ -133,7 +133,7 @@ opencd(char *file, Cdinfo info)
close(xfd);
return nil;
}
if(strstr(cd->iso.systemid, "plan 9"))
cd->flags |= CDplan9;
if(strstr(cd->iso.systemid, "iso9660"))
@ -307,7 +307,7 @@ parsedesc(Voldesc *v, Cvoldesc *cv, char *(*string)(uchar*, int))
v->biblio = string(cv->biblio, sizeof cv->biblio);
v->notice = string(cv->notice, sizeof cv->notice);
}
static int
readisodesc(Cdimg *cd, Voldesc *v)
{
@ -629,4 +629,3 @@ Clinelen(Cdimg *cd)
{
return Blinelen(&cd->brd);
}

View File

@ -86,9 +86,9 @@ walkdirec(Direc *d, char *name)
* Add the file ``name'' with attributes d to the
* directory ``root''. Name may contain multiple
* elements; all but the last must exist already.
*
*
* The child lists are kept sorted by utfname.
*/
*/
Direc*
adddirec(Direc *root, char *name, XDir *d)
{
@ -130,7 +130,7 @@ adddirec(Direc *root, char *name, XDir *d)
return nd;
}
/*
/*
* Copy the tree src into dst.
*/
void
@ -219,4 +219,3 @@ dsort(Direc *d, int (*cmp)(const void*, const void*))
for(i=0; i<n; i++)
dsort(&d->child[i], cmp);
}

View File

@ -348,7 +348,7 @@ adddumpdir(Direc *root, ulong now, XDir *dir)
Tm tm;
tm = *localtime(now);
sprint(buf, "%d", tm.year+1900);
if((dyear = walkdirec(root, buf)) == nil) {
dyear = adddirec(root, buf, dir);
@ -406,7 +406,7 @@ hasdump(Cdimg *cd)
}
return 0;
}
Direc
readdumpdirs(Cdimg *cd, XDir *dir, char *(*cvt)(uchar*, int))
{
@ -500,7 +500,7 @@ readdumpconform(Cdimg *cd)
if(tokenize(p, f, 2) != 2 || (f[0][0] != 'D' && f[0][0] != 'F')
|| strlen(f[0]) != 7 || !isalldigit(f[0]+1))
break;
addtx(atom(f[1]), atom(f[0]));
}
}

View File

@ -168,7 +168,7 @@ main(int argc, char **argv)
Cwseek(cd, cd->nextblock*Blocksize);
goto Dofix;
}
dumpname = adddumpdir(&idumproot, now, &dir);
/* note that we assume all names are conforming and thus sorted */
if(cd->flags & CDjoliet) {
@ -192,7 +192,7 @@ main(int argc, char **argv)
findbootimage(cd, &iroot);
Cupdatebootcat(cd);
}
/* create Joliet tree */
if(cd->flags & CDjoliet)
copydirec(&jroot, &iroot);
@ -235,14 +235,14 @@ main(int argc, char **argv)
* Write incremental _conform.map block.
*/
wrconform(cd, cd->nconform, &cblock, &clength);
/* jump here if we're just fixing up the cd */
Dofix:
/*
* Write null dump header block; everything after this will be
* Write null dump header block; everything after this will be
* overwritten at the next dump. Because of this, it needs to be
* reconstructable. We reconstruct the _conform.map and dump trees
* from the header blocks in dump.c, and we reconstruct the path
* from the header blocks in dump.c, and we reconstruct the path
* tables by walking the cd.
*/
newnull = Cputdumpblock(cd);
@ -254,12 +254,12 @@ Dofix:
dir.mode = 0444;
if(cd->flags & (CDconform|CDjoliet)) {
if(!mk9660 && cd->nconform == 0){
block = cblock;
block = cblock;
length = clength;
}else
wrconform(cd, 0, &block, &length);
if(mk9660)
if(mk9660)
{
idumproot = iroot;
jdumproot = jroot;
@ -315,11 +315,11 @@ Dofix:
copybutname(r, &jroot);
}
}
writedumpdirs(cd, &idumproot, Cputisodir);
if(cd->flags & CDjoliet)
writedumpdirs(cd, &jdumproot, Cputjolietdir);
/*
* Patch in new root directory entry.
*/
@ -330,7 +330,7 @@ Dofix:
setvolsize(cd, cd->jolietsvd, cd->nextblock*Blocksize);
}
}
writepathtables(cd);
writepathtables(cd);
if(!mk9660){
/*
@ -341,16 +341,16 @@ Dofix:
if(cd->nulldump && maxsize && Cwoffset(cd) > maxsize){
fprint(2, "too big; writing old tree back\n");
status = "cd too big; aborted";
rmdumpdir(&idumproot, dumpname);
rmdumpdir(&jdumproot, dumpname);
cd->nextblock = cd->nulldump+1;
cd->nulldump = 0;
Cwseek(cd, cd->nextblock*Blocksize);
goto Dofix;
}
/*
* Write old null header block; this commits all our changes.
*/
@ -399,4 +399,3 @@ addprotofile(char *new, char *old, Dir *d, void *a)
free(name);
}

View File

@ -31,7 +31,7 @@ isostring(uchar *buf, int len)
return q;
}
int
int
isisofrog(char c)
{
if(c >= '0' && c <= '9')
@ -85,7 +85,7 @@ isbadiso9660(char *s)
/*
* ISO9660 name comparison
*
*
* The standard algorithm is as follows:
* Take the filenames without extensions, pad the shorter with 0x20s (spaces),
* and do strcmp. If they are equal, go on.
@ -169,7 +169,7 @@ Cputisopvd(Cdimg *cd, Cdinfo info)
strcat(buf, "iso9660");
else
strcat(buf, "utf8");
struprcpy(buf, buf);
Cputs(cd, buf, 32);

View File

@ -89,7 +89,7 @@ struct Voldesc {
ulong mpathloc;
/* root of file tree */
Direc root;
Direc root;
};
/*
@ -116,7 +116,7 @@ struct Cdimg {
ulong bootimageptr;
Direc *bootdirec;
char *bootimage;
Biobuf brd;
Biobuf bwr;
@ -406,7 +406,7 @@ int Cputisodir(Cdimg*, Direc*, int, int, int);
int Cputjolietdir(Cdimg*, Direc*, int, int, int);
void Cputendvd(Cdimg*);
enum {
enum {
Blocksize = 2048,
Ndirblock = 16, /* directory blocks allocated at once */

View File

@ -26,15 +26,15 @@ jolietstring(uchar *buf, int len)
}
/*
* Joliet name validity check
*
* Joliet name validity check
*
* Joliet names have length at most 128 bytes (64 runes),
* and cannot contain '*', '/', ':', ';', '?', or '\'.
*/
int
isjolietfrog(Rune r)
{
return r=='*' || r=='/' || r==':'
return r=='*' || r=='/' || r==':'
|| r==';' || r=='?' || r=='\\';
}
@ -58,7 +58,7 @@ isbadjoliet(char *s)
* The standard algorithm is the ISO9660 algorithm but
* on the encoded Runes. Runes are encoded in big endian
* format, so we can just use runecmp.
*
*
* Padding is with zeros, but that still doesn't affect us.
*/
@ -135,4 +135,3 @@ Cputjolietsvd(Cdimg *cd, Cdinfo info)
Cputc(cd, 1); /* file structure version */
Cpadblock(cd);
}

View File

@ -9,7 +9,7 @@
* Add the requisite path tables to the CD image.
* They get put on the end once everything else is done.
* We use the path table itself as a queue in the breadth-first
* traversal of the tree.
* traversal of the tree.
*
* The only problem with this is that the path table does not
* store the lengths of the directories. So we keep an explicit

View File

@ -36,4 +36,3 @@ runecmp(Rune *s, Rune *t)
s++, t++;
return *s - *t;
}

View File

@ -43,11 +43,11 @@ setcelen(Cdimg *cd, ulong woffset, ulong len)
* Rock Ridge data is put into little blockettes, which can be
* at most 256 bytes including a one-byte length. Some number
* of blockettes get packed together into a normal 2048-byte block.
* Blockettes cannot cross block boundaries.
* Blockettes cannot cross block boundaries.
*
* A Cbuf is a blockette buffer. Len contains
* A Cbuf is a blockette buffer. Len contains
* the length of the buffer written so far, and we can
* write up to 254-28.
* write up to 254-28.
*
* We only have one active Cbuf at a time; cdimg.rrcontin is the byte
* offset of the beginning of that Cbuf.
@ -94,7 +94,7 @@ ensurespace(Cdimg *cd, int n, Cbuf *co, Cbuf *cn, int dowrite)
/*
* the current blockette is full; update cd->rrcontin and then
* write a CE record to finish it. Unfortunately we need to
* write a CE record to finish it. Unfortunately we need to
* figure out which block will be next before we write the CE.
*/
end = Cwoffset(cd)+28;
@ -134,13 +134,13 @@ ensurespace(Cdimg *cd, int n, Cbuf *co, Cbuf *cn, int dowrite)
return cn;
}
/*
* Put down the name, but we might need to break it
* into chunks so that each chunk fits in 254-28-5 bytes.
* What a crock.
*
* The new Plan 9 format uses strings of this form too,
* The new Plan 9 format uses strings of this form too,
* since they're already there.
*/
Cbuf*
@ -211,7 +211,7 @@ Cputsysuse(Cdimg *cd, Direc *d, int dot, int dowrite, int initlen)
what |= RR_SL;
m = CputsuspRR(cd, what, 0);
cp = ensurespace(cd, m, cp, &cn, dowrite);
cp = ensurespace(cd, m, cp, &cn, dowrite);
CputsuspRR(cd, what, dowrite);
if(what & RR_PX) {
@ -235,7 +235,7 @@ Cputsysuse(Cdimg *cd, Direc *d, int dot, int dowrite, int initlen)
/*
* Put down the symbolic link. This is even more of a crock.
* Not only are the individual elements potentially split,
* Not only are the individual elements potentially split,
* but the whole path itself can be split across SL blocks.
* To keep the code simple as possible (really), we write
* only one element per SL block, wasting 6 bytes per element.
@ -382,7 +382,7 @@ CputsuspSP(Cdimg *cd, int dowrite)
{
assert(cd!=0);
if(dowrite) {
if(dowrite) {
chat("writing SUSP SP record\n");
Cputc(cd, 'S'); /* SP field marker */
Cputc(cd, 'P');
@ -406,7 +406,7 @@ CputsuspST(Cdimg *cd, int dowrite)
Cputc(cd, 'S'); /* ST field marker */
Cputc(cd, 'T');
Cputc(cd, 4); /* Length */
Cputc(cd, 1); /* Version */
Cputc(cd, 1); /* Version */
}
return 4;
}
@ -484,7 +484,7 @@ CputrripPX(Cdimg *cd, Direc *d, int dot, int dowrite)
Cputc(cd, 'X');
Cputc(cd, 36); /* Length */
Cputc(cd, 1); /* Version */
Cputn(cd, mode(d, dot), 4); /* POSIX File mode */
Cputn(cd, nlink(d), 4); /* POSIX st_nlink */
Cputn(cd, d?d->uidno:0, 4); /* POSIX st_uid */
@ -514,7 +514,7 @@ CputrripTF(Cdimg *cd, Direc *d, int type, int dowrite)
Cputc(cd, 5+7*length); /* Length */
Cputc(cd, 1); /* Version */
Cputc(cd, type); /* Flags (types) */
if (type & TFcreation)
Cputdate(cd, d?d->ctime:0);
if (type & TFmodify)
@ -523,7 +523,7 @@ CputrripTF(Cdimg *cd, Direc *d, int type, int dowrite)
Cputdate(cd, d?d->atime:0);
if (type & TFattributes)
Cputdate(cd, d?d->ctime:0);
/* if (type & TFbackup) */
/* Cputdate(cd, 0); */
/* if (type & TFexpiration) */
@ -566,7 +566,7 @@ static long
mode(Direc *d, int dot)
{
long mode;
if (!d)
return 0;
@ -582,13 +582,13 @@ mode(Direc *d, int dot)
mode = S_IFDIR | (0755);
mode &= POSIXMODEMASK;
/* Botch: not all POSIX types supported yet */
assert(mode & (S_IFDIR|S_IFREG));
chat("writing PX record mode field %ulo with dot %d and name \"%s\"\n", mode, dot, d->name);
chat("writing PX record mode field %ulo with dot %d and name \"%s\"\n", mode, dot, d->name);
return mode;
return mode;
}
static long
@ -610,4 +610,3 @@ nlink(Direc *d) /* Trump up the nlink field for POSIX compliance */
return n;
}

View File

@ -39,7 +39,7 @@ atom(char *str)
{
uint h;
Stringtab *tab;
h = hash(str) % nelem(stab);
for(tab=stab[h]; tab; tab=tab->link)
if(strcmp(str, tab->str) == 0)

View File

@ -90,7 +90,7 @@ writefiles(Dump *d, Cdimg *cd, Direc *direc)
assert(start != 0);
Cwseek(cd, start*Blocksize);
s = md5(nil, 0, nil, nil);
length = 0;
while((n = Bread(b, buf, sizeof buf)) > 0) {
@ -123,7 +123,7 @@ writefiles(Dump *d, Cdimg *cd, Direc *direc)
}
/*
* Write a directory tree. We work from the leaves,
* Write a directory tree. We work from the leaves,
* and patch the dotdot pointers afterward.
*/
static void

View File

@ -14,7 +14,7 @@
* tarring up a Plan 9 distribution CD, we now use 16 128kb
* buffers. This works for ISO9660 because data is required
* to be laid out contiguously; effectively we're doing agressive
* readahead. Because the buffers are so big and the typical
* readahead. Because the buffers are so big and the typical
* disk accesses so concentrated, it's okay that we have so few
* of them.
*

View File

@ -138,13 +138,13 @@ main(int argc, char **argv)
open("/dev/null", OWRITE);
if(pipe(pipefd) < 0)
panic(1, "pipe");
if(post9pservice(pipefd[0], srvname, mtpt) < 0)
sysfatal("post9pservice: %r");
close(pipefd[0]);
}
srvfd = pipefd[1];
switch(rfork(RFNOWAIT|RFNOTEG|RFFDG|RFPROC)){
case -1:
panic(1, "fork");

View File

@ -167,4 +167,3 @@ clean(Xfile *f)
f->qid = (Qid){0,0,0};
return f;
}

View File

@ -94,7 +94,7 @@ threadmain(int argc, char **argv)
threadexitsall(0);
}
}
usage();
usage();
}
CFsys*
@ -168,7 +168,7 @@ xread(int argc, char **argv)
fsclose(fid);
if(n < 0)
sysfatal("read error: %r");
threadexitsall(0);
threadexitsall(0);
}
void
@ -192,7 +192,7 @@ xreadfd(int argc, char **argv)
sysfatal("write error: %r");
if(n < 0)
sysfatal("read error: %r");
threadexitsall(0);
threadexitsall(0);
}
void
@ -246,7 +246,7 @@ xwrite(int argc, char **argv)
if(n < 0)
sysfatal("read error: %r");
fsclose(fid);
threadexitsall(0);
threadexitsall(0);
}
void
@ -270,7 +270,7 @@ xwritefd(int argc, char **argv)
sysfatal("write error: %r");
if(n < 0)
sysfatal("read error: %r");
threadexitsall(0);
threadexitsall(0);
}
void
@ -331,7 +331,7 @@ xrdwr(int argc, char **argv)
fprint(2, "write: %r\n");
}
fsclose(fid);
threadexitsall(0);
threadexitsall(0);
}
void
@ -346,10 +346,10 @@ xcreate(int argc, char **argv)
default:
usage();
}ARGEND
if(argc == 0)
usage();
for(i=0; i<argc; i++){
fs = xparse(argv[i], &p);
if((fid=fscreate(fs, p, OREAD, 0666)) == nil)
@ -371,10 +371,10 @@ xrm(int argc, char **argv)
default:
usage();
}ARGEND
if(argc == 0)
usage();
for(i=0; i<argc; i++){
fs = xparse(argv[i], &p);
if(fsremove(fs, p) < 0)
@ -389,7 +389,7 @@ rdcon(void *v)
int n;
char buf[4096];
CFid *fid;
fid = v;
for(;;){
n = read(0, buf, sizeof buf);
@ -408,7 +408,7 @@ xcon(int argc, char **argv)
char buf[4096], *r, *w, *e;
int n, nocr;
CFid *fid;
nocr = 1;
ARGBEGIN{
@ -438,12 +438,12 @@ xcon(int argc, char **argv)
threadexitsall(0);
}
fsclose(fid);
threadexitsall(0);
threadexitsall(0);
}
static char *mon[] =
static char *mon[] =
{
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};
@ -454,7 +454,7 @@ timefmt(Fmt *fmt)
ulong u;
static ulong time0;
Tm *tm;
if(time0 == 0)
time0 = time(0);
u = va_arg(fmt->args, ulong);
@ -470,7 +470,7 @@ static int
dircmp(const void *va, const void *vb)
{
Dir *a, *b;
a = (Dir*)va;
b = (Dir*)vb;
return strcmp(a->name, b->name);
@ -480,7 +480,7 @@ static int
timecmp(const void *va, const void *vb)
{
Dir *a, *b;
a = (Dir*)va;
b = (Dir*)vb;
if(a->mtime < b->mtime)
@ -520,12 +520,12 @@ xls(int argc, char **argv)
tflag = 1;
break;
}ARGEND
fmtinstall('D', dirfmt);
fmtinstall('M', dirmodefmt);
quotefmtinstall();
fmtinstall('T', timefmt);
if(argc == 0){
argv = dot;
argc = 1;
@ -600,4 +600,3 @@ xls(int argc, char **argv)
}
threadexitsall(err);
}

View File

@ -55,7 +55,7 @@ errstr2errno(void)
{
char e[ERRMAX];
int i, len;
if(errno != EPLAN9)
return errno;
@ -70,4 +70,3 @@ errstr2errno(void)
return errortab[i].err;
return ERANGE; /* who knows - be blatantly wrong */
}

View File

@ -15,7 +15,7 @@ allocfusemsg(void)
{
FuseMsg *m;
void *vbuf;
lock(&fusemsglock);
if((m = fusemsglist) != nil){
fusemsglist = m->next;
@ -46,7 +46,7 @@ readfusemsg(void)
{
FuseMsg *m;
int n, nn;
m = allocfusemsg();
/*
* The FUSE kernel device apparently guarantees
@ -84,7 +84,7 @@ readfusemsg(void)
sysfatal("readfusemsg: got %d wanted %d",
n, m->hdr->len);
m->hdr->len -= sizeof(*m->hdr);
/*
* Paranoia.
* Make sure lengths are long enough.
@ -125,7 +125,7 @@ readfusemsg(void)
if(((char*)m->tx)[m->hdr->len-1] != 0
|| memchr(m->tx, 0, m->hdr->len-1) == 0)
goto bad;
break;
break;
case FUSE_MKNOD:
if(m->hdr->len <= sizeof(struct fuse_mknod_in)
|| ((char*)m->tx)[m->hdr->len-1] != 0)
@ -219,7 +219,7 @@ readfusemsg(void)
}
/*
* Reply to FUSE request m using additonal
* Reply to FUSE request m using additonal
* argument buffer arg of size narg bytes.
* Perhaps should free the FuseMsg here?
*/
@ -229,7 +229,7 @@ replyfuse(FuseMsg *m, void *arg, int narg)
struct iovec vec[2];
struct fuse_out_header hdr;
int nvec;
hdr.len = sizeof hdr + narg;
hdr.error = 0;
hdr.unique = m->hdr->unique;
@ -255,7 +255,7 @@ void
replyfuseerrno(FuseMsg *m, int e)
{
struct fuse_out_header hdr;
hdr.len = sizeof hdr;
hdr.error = -e; /* FUSE sends negative errnos. */
hdr.unique = m->hdr->unique;
@ -307,12 +307,12 @@ initfuse(char *mtpt)
/*
* Complain if the kernel is too new.
* We could forge ahead, but at least the one time I tried,
* the kernel rejected the newer version by making the
* the kernel rejected the newer version by making the
* writev fail in replyfuse, which is a much more confusing
* error message. In the future, might be nice to try to
* error message. In the future, might be nice to try to
* support older versions that differ only slightly.
*/
if(tx->major < FUSE_KERNEL_VERSION
if(tx->major < FUSE_KERNEL_VERSION
|| (tx->major == FUSE_KERNEL_VERSION && tx->minor < FUSE_KERNEL_MINOR_VERSION))
sysfatal("fuse: too kernel version %d.%d older than program version %d.%d",
tx->major, tx->minor, FUSE_KERNEL_VERSION, FUSE_KERNEL_MINOR_VERSION);
@ -386,7 +386,7 @@ fusefmt(Fmt *fmt)
}
case FUSE_SYMLINK: {
char *old, *new;
old = a;
new = a + strlen(a) + 1;
fmtprint(fmt, "Symlink nodeid %#llux old %#q new %#q",
@ -455,7 +455,7 @@ fusefmt(Fmt *fmt)
case FUSE_RELEASE: {
struct fuse_release_in *tx = a;
fmtprint(fmt, "Release nodeid %#llux fh %#llux flags %#ux",
hdr->nodeid, tx->fh, tx->flags);
hdr->nodeid, tx->fh, tx->flags);
break;
}
case FUSE_FSYNC: {
@ -516,7 +516,7 @@ fusefmt(Fmt *fmt)
case FUSE_RELEASEDIR: {
struct fuse_release_in *tx = a;
fmtprint(fmt, "Releasedir nodeid %#llux fh %#llux flags %#ux",
hdr->nodeid, tx->fh, tx->flags);
hdr->nodeid, tx->fh, tx->flags);
break;
}
case FUSE_FSYNCDIR: {
@ -554,7 +554,7 @@ fusefmt(Fmt *fmt)
case FUSE_LOOKUP: {
/*
* For a negative entry, can send back ENOENT
* or rx->ino == 0.
* or rx->ino == 0.
* In protocol version 7.4 and before, can only use
* the ENOENT method.
* Presumably the benefit of sending rx->ino == 0
@ -571,7 +571,7 @@ fusefmt(Fmt *fmt)
rx->attr_valid+rx->attr_valid_nsec*1e-9);
fmtprint(fmt, " ino %#llux size %lld blocks %lld atime %.20g mtime %.20g ctime %.20g mode %#uo nlink %d uid %d gid %d rdev %#ux",
rx->attr.ino, rx->attr.size, rx->attr.blocks,
rx->attr.atime+rx->attr.atimensec*1e-9,
rx->attr.atime+rx->attr.atimensec*1e-9,
rx->attr.mtime+rx->attr.mtimensec*1e-9,
rx->attr.ctime+rx->attr.ctimensec*1e-9,
rx->attr.mode, rx->attr.nlink, rx->attr.uid,
@ -592,7 +592,7 @@ fusefmt(Fmt *fmt)
rx->attr_valid+rx->attr_valid_nsec*1e-9);
fmtprint(fmt, " ino %#llux size %lld blocks %lld atime %.20g mtime %.20g ctime %.20g mode %#uo nlink %d uid %d gid %d rdev %#ux",
rx->attr.ino, rx->attr.size, rx->attr.blocks,
rx->attr.atime+rx->attr.atimensec*1e-9,
rx->attr.atime+rx->attr.atimensec*1e-9,
rx->attr.mtime+rx->attr.mtimensec*1e-9,
rx->attr.ctime+rx->attr.ctimensec*1e-9,
rx->attr.mode, rx->attr.nlink, rx->attr.uid,
@ -733,7 +733,7 @@ fusefmt(Fmt *fmt)
rx->e.attr_valid+rx->e.attr_valid_nsec*1e-9);
fmtprint(fmt, " ino %#llux size %lld blocks %lld atime %.20g mtime %.20g ctime %.20g mode %#uo nlink %d uid %d gid %d rdev %#ux",
rx->e.attr.ino, rx->e.attr.size, rx->e.attr.blocks,
rx->e.attr.atime+rx->e.attr.atimensec*1e-9,
rx->e.attr.atime+rx->e.attr.atimensec*1e-9,
rx->e.attr.mtime+rx->e.attr.mtimensec*1e-9,
rx->e.attr.ctime+rx->e.attr.ctimensec*1e-9,
rx->e.attr.mode, rx->e.attr.nlink, rx->e.attr.uid,
@ -753,7 +753,7 @@ fusefmt(Fmt *fmt)
/*
* Mounts a fuse file system on mtpt and returns
* a file descriptor for the corresponding fuse
* a file descriptor for the corresponding fuse
* message conversation.
*/
int
@ -762,7 +762,7 @@ mountfuse(char *mtpt)
#if defined(__linux__)
int p[2], pid, fd;
char buf[20];
if(socketpair(AF_UNIX, SOCK_STREAM, 0, p) < 0)
return -1;
pid = fork();
@ -783,11 +783,11 @@ mountfuse(char *mtpt)
#elif defined(__FreeBSD__) && !defined(__APPLE__)
int pid, fd;
char buf[20];
if((fd = open("/dev/fuse", ORDWR)) < 0)
return -1;
snprint(buf, sizeof buf, "%d", fd);
pid = fork();
if(pid < 0)
return -1;
@ -903,7 +903,7 @@ mountfuse(char *mtpt)
_exit(1);
}
return fd;
#else
werrstr("cannot mount fuse on this system");
return -1;

View File

@ -14,7 +14,7 @@
* writing the 9P connection. Thus the many threads in the
* request proc can do 9P interactions without blocking.
*/
#define _GNU_SOURCE 1 /* for O_DIRECTORY on Linux */
#include "a.h"
@ -165,16 +165,16 @@ init9p(char *addr, char *spec)
/*
* FUSE uses nodeids to refer to active "struct inodes"
* (9P's unopened fids). FUSE uses fhs to refer to active
* "struct fuse_files" (9P's opened fids). The choice of
* "struct fuse_files" (9P's opened fids). The choice of
* numbers is up to us except that nodeid 1 is the root directory.
* We use the same number space for both and call the
* We use the same number space for both and call the
* bookkeeping structure a FuseFid.
*
* FUSE requires nodeids to have associated generation
* numbers. If we reuse a nodeid, we have to bump the
* FUSE requires nodeids to have associated generation
* numbers. If we reuse a nodeid, we have to bump the
* generation number to guarantee that the nodeid,gen
* combination is never reused.
*
*
* There are also inode numbers returned in directory reads
* and file attributes, but these do NOT need to match the nodeids.
* We use a combination of qid.path and qid.type as the inode
@ -192,7 +192,7 @@ struct Fusefid
int id;
int gen;
int isnodeid;
/* directory read state */
Dir *d0;
Dir *d;
@ -208,7 +208,7 @@ Fusefid*
allocfusefid(void)
{
Fusefid *f;
if((f = freefusefidlist) == nil){
f = emalloc(sizeof *f);
fusefid = erealloc(fusefid, (nfusefid+1)*sizeof *fusefid);
@ -247,7 +247,7 @@ uvlong
_alloc(CFid *fid, int isnodeid)
{
Fusefid *ff;
ff = allocfusefid();
ff->fid = fid;
ff->isnodeid = isnodeid;
@ -283,7 +283,7 @@ CFid*
_lookupcfid(uvlong id, int isnodeid)
{
Fusefid *ff;
if((ff = lookupfusefid(id, isnodeid)) == nil)
return nil;
return ff->fid;
@ -360,7 +360,7 @@ fuselookup(FuseMsg *m)
CFid *fid, *newfid;
Dir *d;
struct fuse_entry_out out;
name = m->tx;
if((fid = nodeid2fid(m->hdr->nodeid)) == nil){
replyfuseerrno(m, ESTALE);
@ -392,7 +392,7 @@ fuselookup(FuseMsg *m)
/*
* Forget. Reference-counted clunk for nodeids.
* Does not send a reply.
* Each lookup response gives the kernel an additional reference
* Each lookup response gives the kernel an additional reference
* to the returned nodeid. Forget says "drop this many references
* to this nodeid". Our fuselookup, when presented with the same query,
* does not return the same results (it allocates a new nodeid for each
@ -423,7 +423,7 @@ fuseforget(FuseMsg *m)
* Getattr.
* Replies with a fuse_attr_out structure giving the
* attr for the requested nodeid in out.attr.
* Out.attr_valid and out.attr_valid_nsec give
* Out.attr_valid and out.attr_valid_nsec give
* the amount of time that the attributes can
* be cached.
*
@ -479,7 +479,7 @@ fusesetattr(FuseMsg *m)
/*
* Special case: Linux issues a size change to
* truncate a file before opening it OTRUNC.
* Synthetic file servers (e.g., plumber) honor
* Synthetic file servers (e.g., plumber) honor
* open(OTRUNC) but not wstat.
*/
if(in->valid == FATTR_SIZE && in->size == 0){
@ -554,7 +554,7 @@ _fuseopenfid(uvlong nodeid, int isdir, int openmode, int *err)
*err = errstr2errno();
return nil;
}
if(fsfopen(newfid, openmode) < 0){
*err = errstr2errno();
fsclose(newfid);
@ -617,7 +617,7 @@ _fuseopen(FuseMsg *m, int isdir)
return;
}
out.fh = allocfh(fid);
out.open_flags = FOPEN_DIRECT_IO; /* no page cache */
out.open_flags = FOPEN_DIRECT_IO; /* no page cache */
replyfuse(m, &out, sizeof out);
}
@ -696,7 +696,7 @@ fusemkdir(FuseMsg *m)
CFid *fid;
int err;
char *name;
in = m->tx;
name = (char*)(in+1);
if((fid = _fusecreate(m->hdr->nodeid, name, in->mode, 1, OREAD, &out, &err)) == nil){
@ -716,7 +716,7 @@ fusecreate(FuseMsg *m)
CFid *fid;
int err, openmode, flags;
char *name;
in = m->tx;
flags = in->flags;
openmode = in->flags&3;
@ -740,7 +740,7 @@ fusecreate(FuseMsg *m)
}
/*
* Access.
* Access.
* Lib9pclient implements this just as Plan 9 does,
* by opening the file (or not) and then closing it.
*/
@ -760,7 +760,7 @@ fuseaccess(FuseMsg *m)
ORDWR,
ORDWR
};
in = m->tx;
if(in->mask >= nelem(a2o)){
replyfuseerrno(m, EINVAL);
@ -791,7 +791,7 @@ fuserelease(FuseMsg *m)
{
struct fuse_release_in *in;
Fusefid *ff;
in = m->tx;
if((ff = lookupfusefid(in->fh, 0)) != nil)
freefusefid(ff);
@ -864,7 +864,7 @@ fusereadlink(FuseMsg *m)
return;
}
/*
/*
* Readdir.
* Read from file handle in->fh at offset in->offset for size in->size.
* We truncate size to maxwrite just to keep the buffer reasonable.
@ -884,12 +884,12 @@ fusereaddir(FuseMsg *m)
uchar *buf, *p, *ep;
int n;
Fusefid *ff;
in = m->tx;
if((ff = lookupfusefid(in->fh, 0)) == nil){
replyfuseerrno(m, ESTALE);
return;
}
}
if(in->offset == 0){
fsseek(ff->fid, 0, 0);
free(ff->d0);
@ -922,7 +922,7 @@ fusereaddir(FuseMsg *m)
break;
ff->d = ff->d0;
}
out:
out:
replyfuse(m, buf, p - buf);
free(buf);
}
@ -958,7 +958,7 @@ canpack(Dir *d, uvlong off, uchar **pp, uchar *ep)
uchar *p;
struct fuse_dirent *de;
int pad, size;
p = *pp;
size = FUSE_NAME_OFFSET + strlen(d->name);
pad = 0;
@ -981,7 +981,7 @@ canpack(Dir *d, uvlong off, uchar **pp, uchar *ep)
* Write.
* Write from file handle in->fh at offset in->offset for size in->size.
* Don't know what in->write_flags means.
*
*
* Apparently implementations are allowed to buffer these writes
* and wait until Flush is sent, but FUSE docs say flush may be
* called zero, one, or even more times per close. So better do the
@ -996,7 +996,7 @@ fusewrite(FuseMsg *m)
void *a;
CFid *fid;
int n;
in = m->tx;
a = in+1;
if((fid = fh2fid(in->fh)) == nil){
@ -1018,7 +1018,7 @@ fusewrite(FuseMsg *m)
/*
* Flush. Supposed to flush any buffered writes. Don't use this.
*
*
* Flush is a total crock. It gets called on close() of a file descriptor
* associated with this open file. Some open files have multiple file
* descriptors and thus multiple closes of those file descriptors.
@ -1027,7 +1027,7 @@ fusewrite(FuseMsg *m)
* closed explicitly. For those files, Flush is never called.
* Even more amusing, Flush gets called before close() of read-only
* file descriptors too!
*
*
* This is just a bad idea.
*/
void
@ -1044,7 +1044,7 @@ _fuseremove(FuseMsg *m, int isdir)
{
char *name;
CFid *fid, *newfid;
name = m->tx;
if((fid = nodeid2fid(m->hdr->nodeid)) == nil){
replyfuseerrno(m, ESTALE);
@ -1105,7 +1105,7 @@ fuserename(FuseMsg *m)
char *before, *after;
CFid *fid, *newfid;
Dir d;
in = m->tx;
if(in->newdir != m->hdr->nodeid){
replyfuseerrno(m, EXDEV);
@ -1146,7 +1146,7 @@ fusefsync(FuseMsg *m)
struct fuse_fsync_in *in;
CFid *fid;
Dir d;
in = m->tx;
if((fid = fh2fid(in->fh)) == nil){
replyfuseerrno(m, ESTALE);
@ -1181,7 +1181,7 @@ void
fusestatfs(FuseMsg *m)
{
struct fuse_statfs_out out;
memset(&out, 0, sizeof out);
replyfuse(m, &out, sizeof out);
}
@ -1215,7 +1215,7 @@ struct {
{ FUSE_FSYNC, fusefsync },
/*
* FUSE_SETXATTR, FUSE_GETXATTR, FUSE_LISTXATTR, and
* FUSE_REMOVEXATTR are unimplemented.
* FUSE_REMOVEXATTR are unimplemented.
* FUSE will stop sending these requests after getting
* an -ENOSYS reply (see dispatch below).
*/
@ -1237,7 +1237,7 @@ fusethread(void *v)
FuseMsg *m;
m = v;
if((uint)m->hdr->opcode >= nelem(fusehandlers)
if((uint)m->hdr->opcode >= nelem(fusehandlers)
|| !fusehandlers[m->hdr->opcode]){
replyfuseerrno(m, ENOSYS);
return;
@ -1267,7 +1267,7 @@ fusedispatch(void *v)
case FUSE_FORGET:
fusehandlers[m->hdr->opcode](m);
break;
default:
default:
threadcreate(fusethread, m, STACK);
}
}

View File

@ -185,7 +185,7 @@ threadmain(int argc, char **argv)
logging++;
break;
}ARGEND
if(attached && !versioned){
fprint(2, "-A must be used with -M\n");
usage();
@ -258,7 +258,7 @@ mainproc(void *v)
/* if(rootfid) */
/* dorootstat(); */
threadcreate(listenthread, nil, STACK);
threadexits(0);
}
@ -302,7 +302,7 @@ listenthread(void *arg)
c->outqdead = chancreate(sizeof(void*), 0);
if(verbose) fprint(2, "%T incoming call on %s\n", c->dir);
threadcreate(connthread, c, STACK);
}
}
}
void
@ -348,7 +348,7 @@ char*
estrdup(char *s)
{
char *t;
t = emalloc(strlen(s)+1);
strcpy(t, s);
return t;
@ -713,7 +713,7 @@ openfdthread(void *v)
chanfree(c->internal);
c->internal = 0;
free(c);
}
}
int
xopenfd(Msg *m)
@ -868,7 +868,7 @@ outputthread(void *arg)
closeioproc(io);
fprint(2, "%T output eof\n");
threadexitsall(0);
}
}
void
inputthread(void *arg)
@ -1041,7 +1041,7 @@ msgnew(int x)
* Clear data associated with connections, so that
* if all msgs have been msgcleared, the connection
* can be freed. Note that this does *not* free the tpkt
* and rpkt; they are freed in msgput with the msg itself.
* and rpkt; they are freed in msgput with the msg itself.
* The io write thread might still be holding a ref to msg
* even once the connection has finished with it.
*/
@ -1080,7 +1080,7 @@ msgput(Msg *m)
if(m == nil)
return;
if(verbose > 1) fprint(2, "%T msgput 0x%lux %p tag %d/%d ref %d\n",
if(verbose > 1) fprint(2, "%T msgput 0x%lux %p tag %d/%d ref %d\n",
getcallerpc(&m), m, m->tag, m->ctag, m->ref);
assert(m->ref > 0);
if(--m->ref > 0)
@ -1296,7 +1296,7 @@ repack(Fcall *f, uchar **ppkt)
{
uint n, nn;
uchar *pkt;
pkt = *ppkt;
n = GBIT32(pkt);
nn = sizeS2M(f);
@ -1305,7 +1305,7 @@ repack(Fcall *f, uchar **ppkt)
pkt = emalloc(nn);
*ppkt = pkt;
}
n = convS2M(f, pkt, nn);
n = convS2M(f, pkt, nn);
if(n <= BIT16SZ)
sysfatal("convS2M conversion error");
if(n != nn)
@ -1401,13 +1401,13 @@ ioaccept(Ioproc *io, int fd, char *dir)
int
timefmt(Fmt *fmt)
{
static char *mon[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
static char *mon[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
vlong ns;
Tm tm;
ns = nsec();
tm = *localtime(time(0));
return fmtprint(fmt, "%s %2d %02d:%02d:%02d.%03d",
return fmtprint(fmt, "%s %2d %02d:%02d:%02d.%03d",
mon[tm.mon], tm.mday, tm.hour, tm.min, tm.sec,
(int)(ns%1000000000)/1000000);
}

View File

@ -51,13 +51,13 @@ void
threadmain(int argc, char *argv[])
{
char *p;
rfork(RFNOTEG);
font = nil;
_wantfocuschanges = 1;
mainpid = getpid();
messagesize = 8192;
ARGBEGIN{
default:
usage();
@ -80,7 +80,7 @@ threadmain(int argc, char *argv[])
winsize = EARGF(usage());
break;
}ARGEND
if(fontname)
putenv("font", fontname);
@ -92,7 +92,7 @@ threadmain(int argc, char *argv[])
if(maxtab <= 0)
maxtab = 4;
free(p);
startdir = ".";
if(initdraw(derror, fontname, "9term") < 0)
@ -100,7 +100,7 @@ threadmain(int argc, char *argv[])
notify(hangupnote);
noteenable("sys: child");
mousectl = initmouse(nil, screen);
if(mousectl == nil)
error("cannot find mouse");
@ -181,13 +181,13 @@ void
resizethread(void *v)
{
Point p;
USED(v);
for(;;){
p = stringsize(display->defaultfont, "0");
if(p.x && p.y)
updatewinsize(Dy(screen->r)/p.y, (Dx(screen->r)-Scrollwid-2)/p.x,
updatewinsize(Dy(screen->r)/p.y, (Dx(screen->r)-Scrollwid-2)/p.x,
Dx(screen->r), Dy(screen->r));
wresize(w, screen, 0);
flushimage(display, 1);
@ -197,7 +197,7 @@ resizethread(void *v)
sysfatal("can't reattach to window");
}
}
void
mousethread(void *v)
{
@ -229,7 +229,7 @@ mousethread(void *v)
bouncemouse(mouse);
}
}
void
wborder(Window *w, int type)
{
@ -405,7 +405,7 @@ rcoutputproc(void *arg)
Conswritemesg cwm;
Rune *r;
Stringpair pair;
i = 0;
cnt = 0;
for(;;){
@ -432,11 +432,11 @@ rcoutputproc(void *arg)
if(nb < cnt)
memmove(data, data+nb, cnt-nb);
cnt -= nb;
nr = label(r, nr);
if(nr == 0)
continue;
recv(w->conswrite, &cwm);
pair.s = r;
pair.ns = nr;
@ -448,7 +448,7 @@ void
winterrupt(Window *w)
{
char rubout[1];
USED(w);
rubout[0] = getintr(sfd);
write(rcfd, rubout, 1);
@ -474,7 +474,7 @@ label(Rune *sr, int n)
{
Rune *sl, *el, *er, *r;
char *p, *dir;
er = sr+n;
for(r=er-1; r>=sr; r--)
if(*r == '\007')
@ -527,7 +527,7 @@ rcinputproc(void *arg)
recv(w->consread, &crm);
c1 = crm.c1;
c2 = crm.c2;
pair.s = data;
pair.ns = sizeof data;
send(c1, &pair);
@ -547,7 +547,7 @@ void
rioputsnarf(void)
{
char *s;
s = smprint("%.*S", nsnarf, snarf);
if(s){
putsnarf(s);
@ -648,7 +648,7 @@ textproc(void *arg)
for(x=0; x<p-buf; x+=n)
if((n = write(fd, buf+x, (p-x)-buf)) <= 0)
goto break2;
if(i >= end)
break;
p = buf;
@ -664,4 +664,3 @@ textproc(void *arg)
break2:
close(fd);
}

View File

@ -84,4 +84,3 @@ getintr(int fd)
return 0x7F;
return ttmode.c_cc[VINTR];
}

View File

@ -20,7 +20,7 @@ static char *abc =
"abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"0123456789";
static char *_123 =
static char *_123 =
"0123456789"
"abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ";
@ -111,4 +111,3 @@ getintr(int fd)
return 0x7F;
return ttmode.c_cc[VINTR];
}

View File

@ -91,8 +91,8 @@ struct Mouseinfo
ulong counter; /* serial no. of last mouse event we received */
ulong lastcounter; /* serial no. of last mouse event sent to client */
int lastb; /* last button state we received */
uchar qfull; /* filled the queue; no more recording until client comes back */
};
uchar qfull; /* filled the queue; no more recording until client comes back */
};
struct Window
{

View File

@ -48,121 +48,121 @@ Cursor sightcursor = {
Cursor whitearrow = {
{0, 0},
{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFC,
0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF8, 0xFF, 0xFC,
0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFC,
{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFC,
0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF8, 0xFF, 0xFC,
0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFC,
0xF3, 0xF8, 0xF1, 0xF0, 0xE0, 0xE0, 0xC0, 0x40, },
{0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x06, 0xC0, 0x1C,
0xC0, 0x30, 0xC0, 0x30, 0xC0, 0x38, 0xC0, 0x1C,
0xC0, 0x0E, 0xC0, 0x07, 0xCE, 0x0E, 0xDF, 0x1C,
{0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x06, 0xC0, 0x1C,
0xC0, 0x30, 0xC0, 0x30, 0xC0, 0x38, 0xC0, 0x1C,
0xC0, 0x0E, 0xC0, 0x07, 0xCE, 0x0E, 0xDF, 0x1C,
0xD3, 0xB8, 0xF1, 0xF0, 0xE0, 0xE0, 0xC0, 0x40, }
};
Cursor query = {
{-7,-7},
{0x0f, 0xf0, 0x1f, 0xf8, 0x3f, 0xfc, 0x7f, 0xfe,
0x7c, 0x7e, 0x78, 0x7e, 0x00, 0xfc, 0x01, 0xf8,
0x03, 0xf0, 0x07, 0xe0, 0x07, 0xc0, 0x07, 0xc0,
{0x0f, 0xf0, 0x1f, 0xf8, 0x3f, 0xfc, 0x7f, 0xfe,
0x7c, 0x7e, 0x78, 0x7e, 0x00, 0xfc, 0x01, 0xf8,
0x03, 0xf0, 0x07, 0xe0, 0x07, 0xc0, 0x07, 0xc0,
0x07, 0xc0, 0x07, 0xc0, 0x07, 0xc0, 0x07, 0xc0, },
{0x00, 0x00, 0x0f, 0xf0, 0x1f, 0xf8, 0x3c, 0x3c,
0x38, 0x1c, 0x00, 0x3c, 0x00, 0x78, 0x00, 0xf0,
0x01, 0xe0, 0x03, 0xc0, 0x03, 0x80, 0x03, 0x80,
{0x00, 0x00, 0x0f, 0xf0, 0x1f, 0xf8, 0x3c, 0x3c,
0x38, 0x1c, 0x00, 0x3c, 0x00, 0x78, 0x00, 0xf0,
0x01, 0xe0, 0x03, 0xc0, 0x03, 0x80, 0x03, 0x80,
0x00, 0x00, 0x03, 0x80, 0x03, 0x80, 0x00, 0x00, }
};
Cursor tl = {
{-4, -4},
{0xfe, 0x00, 0x82, 0x00, 0x8c, 0x00, 0x87, 0xff,
0xa0, 0x01, 0xb0, 0x01, 0xd0, 0x01, 0x11, 0xff,
0x11, 0x00, 0x11, 0x00, 0x11, 0x00, 0x11, 0x00,
{0xfe, 0x00, 0x82, 0x00, 0x8c, 0x00, 0x87, 0xff,
0xa0, 0x01, 0xb0, 0x01, 0xd0, 0x01, 0x11, 0xff,
0x11, 0x00, 0x11, 0x00, 0x11, 0x00, 0x11, 0x00,
0x11, 0x00, 0x11, 0x00, 0x11, 0x00, 0x1f, 0x00, },
{0x00, 0x00, 0x7c, 0x00, 0x70, 0x00, 0x78, 0x00,
0x5f, 0xfe, 0x4f, 0xfe, 0x0f, 0xfe, 0x0e, 0x00,
0x0e, 0x00, 0x0e, 0x00, 0x0e, 0x00, 0x0e, 0x00,
{0x00, 0x00, 0x7c, 0x00, 0x70, 0x00, 0x78, 0x00,
0x5f, 0xfe, 0x4f, 0xfe, 0x0f, 0xfe, 0x0e, 0x00,
0x0e, 0x00, 0x0e, 0x00, 0x0e, 0x00, 0x0e, 0x00,
0x0e, 0x00, 0x0e, 0x00, 0x0e, 0x00, 0x00, 0x00, }
};
Cursor t = {
{-7, -8},
{0x00, 0x00, 0x00, 0x00, 0x03, 0x80, 0x06, 0xc0,
0x1c, 0x70, 0x10, 0x10, 0x0c, 0x60, 0xfc, 0x7f,
0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0xff, 0xff,
{0x00, 0x00, 0x00, 0x00, 0x03, 0x80, 0x06, 0xc0,
0x1c, 0x70, 0x10, 0x10, 0x0c, 0x60, 0xfc, 0x7f,
0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, },
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
0x03, 0x80, 0x0f, 0xe0, 0x03, 0x80, 0x03, 0x80,
0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x00, 0x00,
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
0x03, 0x80, 0x0f, 0xe0, 0x03, 0x80, 0x03, 0x80,
0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }
};
Cursor tr = {
{-11, -4},
{0x00, 0x7f, 0x00, 0x41, 0x00, 0x31, 0xff, 0xe1,
0x80, 0x05, 0x80, 0x0d, 0x80, 0x0b, 0xff, 0x88,
0x00, 0x88, 0x0, 0x88, 0x00, 0x88, 0x00, 0x88,
{0x00, 0x7f, 0x00, 0x41, 0x00, 0x31, 0xff, 0xe1,
0x80, 0x05, 0x80, 0x0d, 0x80, 0x0b, 0xff, 0x88,
0x00, 0x88, 0x0, 0x88, 0x00, 0x88, 0x00, 0x88,
0x00, 0x88, 0x00, 0x88, 0x00, 0x88, 0x00, 0xf8, },
{0x00, 0x00, 0x00, 0x3e, 0x00, 0x0e, 0x00, 0x1e,
0x7f, 0xfa, 0x7f, 0xf2, 0x7f, 0xf0, 0x00, 0x70,
0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70,
{0x00, 0x00, 0x00, 0x3e, 0x00, 0x0e, 0x00, 0x1e,
0x7f, 0xfa, 0x7f, 0xf2, 0x7f, 0xf0, 0x00, 0x70,
0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70,
0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x00, }
};
Cursor r = {
{-8, -7},
{0x07, 0xc0, 0x04, 0x40, 0x04, 0x40, 0x04, 0x58,
0x04, 0x68, 0x04, 0x6c, 0x04, 0x06, 0x04, 0x02,
0x04, 0x06, 0x04, 0x6c, 0x04, 0x68, 0x04, 0x58,
{0x07, 0xc0, 0x04, 0x40, 0x04, 0x40, 0x04, 0x58,
0x04, 0x68, 0x04, 0x6c, 0x04, 0x06, 0x04, 0x02,
0x04, 0x06, 0x04, 0x6c, 0x04, 0x68, 0x04, 0x58,
0x04, 0x40, 0x04, 0x40, 0x04, 0x40, 0x07, 0xc0, },
{0x00, 0x00, 0x03, 0x80, 0x03, 0x80, 0x03, 0x80,
0x03, 0x90, 0x03, 0x90, 0x03, 0xf8, 0x03, 0xfc,
0x03, 0xf8, 0x03, 0x90, 0x03, 0x90, 0x03, 0x80,
{0x00, 0x00, 0x03, 0x80, 0x03, 0x80, 0x03, 0x80,
0x03, 0x90, 0x03, 0x90, 0x03, 0xf8, 0x03, 0xfc,
0x03, 0xf8, 0x03, 0x90, 0x03, 0x90, 0x03, 0x80,
0x03, 0x80, 0x03, 0x80, 0x03, 0x80, 0x00, 0x00, }
};
Cursor br = {
{-11, -11},
{0x00, 0xf8, 0x00, 0x88, 0x00, 0x88, 0x00, 0x88,
0x00, 0x88, 0x00, 0x88, 0x00, 0x88, 0x00, 0x88,
0xff, 0x88, 0x80, 0x0b, 0x80, 0x0d, 0x80, 0x05,
{0x00, 0xf8, 0x00, 0x88, 0x00, 0x88, 0x00, 0x88,
0x00, 0x88, 0x00, 0x88, 0x00, 0x88, 0x00, 0x88,
0xff, 0x88, 0x80, 0x0b, 0x80, 0x0d, 0x80, 0x05,
0xff, 0xe1, 0x00, 0x31, 0x00, 0x41, 0x00, 0x7f, },
{0x00, 0x00, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70,
0x0, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70,
0x00, 0x70, 0x7f, 0xf0, 0x7f, 0xf2, 0x7f, 0xfa,
{0x00, 0x00, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70,
0x0, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70,
0x00, 0x70, 0x7f, 0xf0, 0x7f, 0xf2, 0x7f, 0xfa,
0x00, 0x1e, 0x00, 0x0e, 0x00, 0x3e, 0x00, 0x00, }
};
Cursor b = {
{-7, -7},
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01,
0xfc, 0x7f, 0x0c, 0x60, 0x10, 0x10, 0x1c, 0x70,
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01,
0xfc, 0x7f, 0x0c, 0x60, 0x10, 0x10, 0x1c, 0x70,
0x06, 0xc0, 0x03, 0x80, 0x00, 0x00, 0x00, 0x00, },
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe,
0x03, 0x80, 0x03, 0x80, 0x0f, 0xe0, 0x03, 0x80,
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe,
0x03, 0x80, 0x03, 0x80, 0x0f, 0xe0, 0x03, 0x80,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }
};
Cursor bl = {
{-4, -11},
{0x1f, 0x00, 0x11, 0x00, 0x11, 0x00, 0x11, 0x00,
0x11, 0x00, 0x11, 0x00, 0x11, 0x00, 0x11, 0x00,
0x11, 0xff, 0xd0, 0x01, 0xb0, 0x01, 0xa0, 0x01,
{0x1f, 0x00, 0x11, 0x00, 0x11, 0x00, 0x11, 0x00,
0x11, 0x00, 0x11, 0x00, 0x11, 0x00, 0x11, 0x00,
0x11, 0xff, 0xd0, 0x01, 0xb0, 0x01, 0xa0, 0x01,
0x87, 0xff, 0x8c, 0x00, 0x82, 0x00, 0xfe, 0x00, },
{0x00, 0x00, 0x0e, 0x00, 0x0e, 0x00, 0x0e, 0x00,
0x0e, 0x00, 0x0e, 0x00, 0x0e, 0x00, 0x0e, 0x00,
0x0e, 0x00, 0x0f, 0xfe, 0x4f, 0xfe, 0x5f, 0xfe,
{0x00, 0x00, 0x0e, 0x00, 0x0e, 0x00, 0x0e, 0x00,
0x0e, 0x00, 0x0e, 0x00, 0x0e, 0x00, 0x0e, 0x00,
0x0e, 0x00, 0x0f, 0xfe, 0x4f, 0xfe, 0x5f, 0xfe,
0x78, 0x00, 0x70, 0x00, 0x7c, 0x00, 0x00, 0x0, }
};
Cursor l = {
{-7, -7},
{0x03, 0xe0, 0x02, 0x20, 0x02, 0x20, 0x1a, 0x20,
0x16, 0x20, 0x36, 0x20, 0x60, 0x20, 0x40, 0x20,
0x60, 0x20, 0x36, 0x20, 0x16, 0x20, 0x1a, 0x20,
{0x03, 0xe0, 0x02, 0x20, 0x02, 0x20, 0x1a, 0x20,
0x16, 0x20, 0x36, 0x20, 0x60, 0x20, 0x40, 0x20,
0x60, 0x20, 0x36, 0x20, 0x16, 0x20, 0x1a, 0x20,
0x02, 0x20, 0x02, 0x20, 0x02, 0x20, 0x03, 0xe0, },
{0x00, 0x00, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0,
0x09, 0xc0, 0x09, 0xc0, 0x1f, 0xc0, 0x3f, 0xc0,
0x1f, 0xc0, 0x09, 0xc0, 0x09, 0xc0, 0x01, 0xc0,
{0x00, 0x00, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0,
0x09, 0xc0, 0x09, 0xc0, 0x1f, 0xc0, 0x3f, 0xc0,
0x1f, 0xc0, 0x09, 0xc0, 0x09, 0xc0, 0x01, 0xc0,
0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x00, 0x00, }
};

View File

@ -39,4 +39,3 @@ int intrc(void);
void rioputsnarf(void);
void riogetsnarf(void);

View File

@ -13,7 +13,7 @@ void*
p9malloc(ulong n)
{
void *v;
if(n == 0)
n++;
lock(&malloclock);
@ -38,7 +38,7 @@ void*
p9calloc(ulong a, ulong b)
{
void *v;
if(a*b == 0)
a = b = 1;
@ -53,11 +53,10 @@ void*
p9realloc(void *v, ulong n)
{
void *vv;
lock(&malloclock);
vv = realloc(v, n);
unlock(&malloclock);
print("p9realloc %p %lud => %p; pc %lux\n", v, n, vv, getcallerpc(&v));
return vv;
}

View File

@ -69,15 +69,15 @@ rcstart(int argc, char **argv, int *pfd, int *tfd)
}
/*
* notedisable("sys: window size change");
*
*
* Can't disable because will be inherited by other programs
* like if you run an xterm from the prompt, and then xterm's
* resizes won't get handled right. Sigh.
* resizes won't get handled right. Sigh.
*
* Can't not disable because when we stty below we'll get a
* signal, which will drop us into the thread library note handler,
* which will get all confused because we just forked and thus
* have an unknown pid.
* have an unknown pid.
*
* So disable it internally. ARGH!
*/
@ -145,7 +145,7 @@ echoed(char *p, int n)
if(echo.w+n > sizeof echo.buf)
n = 0;
memmove(echo.buf+echo.w, p, n);
echo.w += n;
echo.w += n;
unlock(&echo.l);
}

View File

@ -146,4 +146,3 @@ runetobyte(Rune *r, int n, int *ip)
*ip = m;
return s;
}

View File

@ -134,7 +134,7 @@ threadmain(int argc, char **argv)
char buf1[128];
CFsys *fs;
char *dump;
dump = onestring(argc, argv);
ARGBEGIN{
@ -215,7 +215,7 @@ threadmain(int argc, char **argv)
fswrite(ctlfd, buf, strlen(buf));
sprint(buf, "scroll");
fswrite(ctlfd, buf, strlen(buf));
updatewinsize(25, 80, 0, 0);
proccreate(stdoutproc, nil, STACK);
stdinproc(nil);
@ -225,7 +225,7 @@ void
error(char *s, ...)
{
va_list arg;
if(s){
va_start(arg, s);
s = vsmprint(s, arg);
@ -378,11 +378,11 @@ stdinproc(void *v)
fprint(2, "shift typing %d... ", e.q1-e.q0);
q.p += e.q1-e.q0;
break;
case 'i':
case 'd': /* tag */
break;
default:
goto Unknown;
}
@ -484,7 +484,7 @@ dropcr(char *p, int n)
{
int i;
char *w, *r, *q;
r = p;
w = p;
for(i=0; i<n; i++) {
@ -538,15 +538,15 @@ stdoutproc(void *v)
n = read(fd1, buf+npart, 8192);
if(n <= 0)
error(nil);
n = echocancel(buf+npart, n);
if(n == 0)
continue;
n = dropcrnl(buf+npart, n);
if(n == 0)
continue;
n = dropcr(buf+npart, n);
if(n == 0)
continue;
@ -581,13 +581,13 @@ stdoutproc(void *v)
buf[n] = 0;
n = label(buf, n);
buf[n] = 0;
// clumsy but effective: notice password
// prompts so we can disable echo.
password = 0;
if(cistrstr(buf, "password") || cistrstr(buf, "passphrase")) {
int i;
i = n;
while(i > 0 && buf[i-1] == ' ')
i--;
@ -743,7 +743,7 @@ void
sendtype(int fd0)
{
int i, n, nr, raw;
raw = israw(fd0);
while(ntypebreak || (raw && ntypeb > 0)){
for(i=0; i<ntypeb; i++)

View File

@ -101,7 +101,7 @@ wsetname(Window *w)
{
int i, n;
char err[ERRMAX];
n = sprint(w->name, "window.%d.%d", w->id, w->namecount++);
for(i='A'; i<='Z'; i++){
if(nameimage(w->i, w->name, 1) > 0)
@ -224,7 +224,7 @@ winctl(void *arg)
crm.c2 = chancreate(sizeof(Stringpair), 0);
cwrm.c1 = chancreate(sizeof(Stringpair), 0);
cwrm.c2 = chancreate(sizeof(Stringpair), 0);
alts[WKey].c = w->ck;
alts[WKey].v = &kbdr;
@ -803,7 +803,7 @@ wbswidth(Window *w, Rune c)
if(r == '\n'){ /* eat at most one more character */
if(q == w->q0 && c != '\r') /* eat the newline */
--q;
break;
break;
}
if(c == 0x17){
eq = isalnum(r);
@ -1382,15 +1382,15 @@ wsetpid(Window *w, int pid, int dolabel)
}
}
static Rune left1[] = {
static Rune left1[] = {
'{', '[', '(', '<', 0xAB,
0x207d, 0x2329, 0x27e6, 0x27e8, 0x27ea,
0xfe59, 0xfe5b, 0xfe5d, 0xff08, 0xff3b, 0xff5b,
0x207d, 0x2329, 0x27e6, 0x27e8, 0x27ea,
0xfe59, 0xfe5b, 0xfe5d, 0xff08, 0xff3b, 0xff5b,
0
};
static Rune right1[] = {
'}', ']', ')', '>', 0xBB,
0x207e, 0x232a, 0x27e7, 0x27e9, 0x27eb,
0x207e, 0x232a, 0x27e7, 0x27e9, 0x27eb,
0xfe5a, 0xfe5c, 0xfe5e, 0xff09, 0xff3d, 0xff5d,
0
};

View File

@ -635,7 +635,7 @@ includepipe(Node *r, Node *args)
if(pipe(pip) < 0)
error("pipe: %r");
pid = fork();
switch(pid) {
case -1:
@ -657,7 +657,7 @@ includepipe(Node *r, Node *args)
close(pip[1]);
pushfd(pip[0]);
isave = interactive;
interactive = 0;
r->store.u.ival = yyparse();
@ -746,7 +746,7 @@ doaccess(Node *r, Node *args)
r->op = OCONST;
r->type = TINT;
r->store.fmt = 'D';
r->store.u.ival = 0;
r->store.u.ival = 0;
if(access(res.store.u.string->string, 4) == 0)
r->store.u.ival = 1;
}
@ -974,7 +974,7 @@ map(Node *r, Node *args)
i = findseg(m, nam, fil);
}
if(i < 0)
error("%s %s is not a map entry", nam, fil);
error("%s %s is not a map entry", nam, fil);
l = l->next;
if(l->type != TINT)
error("map entry not int");
@ -1008,7 +1008,7 @@ map(Node *r, Node *args)
}
}
void
void
flatten(Node **av, Node *n)
{
if(n == 0)
@ -1086,7 +1086,7 @@ strace(Node *r, Node *args)
l = l->next;
}
regs.rw = straceregrw;
tracelist = 0;
if(stacktrace(cormap, &regs, trlist) <= 0)
error("no stack frame");
@ -1482,7 +1482,7 @@ pcfile(Node *r, Node *args)
if(p == 0)
error("pcfile(addr): funny file %s", buf);
*p = '\0';
r->store.u.string = strnode(buf);
r->store.u.string = strnode(buf);
}
void
@ -1507,7 +1507,7 @@ pcline(Node *r, Node *args)
p = strrchr(buf, ':');
if(p == 0)
error("pcline(addr): funny file %s", buf);
r->store.u.ival = atoi(p+1);
r->store.u.ival = atoi(p+1);
}
void

View File

@ -46,9 +46,9 @@ odot(Node *n, Node *r)
error("no tag for (expr).%s", s);
/* Propagate types */
if(t->type)
if(t->type)
r->store.comt = t->type->lt;
addr = res.store.u.ival+t->offset;
if(t->fmt == 'a') {
r->op = OCONST;
@ -56,7 +56,7 @@ odot(Node *n, Node *r)
r->type = TINT;
r->store.u.ival = addr;
}
else
else
indir(cormap, addr, t->fmt, r);
}
@ -74,7 +74,7 @@ buildtype(Node *m, int d)
switch(m->op) {
case OLIST:
buildtype(m->left, d);
buildtype(m->left, d);
buildtype(m->right, d);
break;
@ -90,7 +90,7 @@ buildtype(Node *m, int d)
t->offset = m->store.u.ival;
if(m->left) {
t->type = m->left->sym;
t->fmt = 'a';
t->fmt = 'a';
}
else {
t->type = 0;
@ -101,7 +101,7 @@ buildtype(Node *m, int d)
*tail = t;
tail = &t->next;
}
}
}
void

View File

@ -74,7 +74,7 @@ chklval(Node *lp)
if(lp->op == OCALL){
s = chklval(lp->left);
if(strcmp(s->name, "var") == 0
if(strcmp(s->name, "var") == 0
&& (lp->builtin || s->proc == 0)){
if(lp->right == 0)
error("var(string): arg count");
@ -85,7 +85,7 @@ chklval(Node *lp)
}
}
error("need l-value");
return nil;
return nil;
}
void
@ -177,7 +177,7 @@ oframe(Node *n, Node *res)
lp = n->left;
if(localaddr(cormap, acidregs, p, lp->sym->name, &ival) < 0)
error("colon: %r");
res->store.u.ival = ival;
res->op = OCONST;
res->store.fmt = 'X';
@ -397,7 +397,7 @@ oadd(Node *n, Node *res)
if(r.type == TSTRING) {
res->type = TSTRING;
res->store.fmt = 's';
res->store.u.string = stradd(l.store.u.string, r.store.u.string);
res->store.u.string = stradd(l.store.u.string, r.store.u.string);
break;
}
error("bad rhs for +");
@ -916,7 +916,7 @@ oeinc(Node *n, Node *res)
v->store.u.ival -= fmtsize(v);
else
v->store.u.ival += fmtsize(v);
break;
break;
case TFLOAT:
if(n->op == OEDEC)
v->store.u.fval--;
@ -944,7 +944,7 @@ opinc(Node *n, Node *res)
v->store.u.ival -= fmtsize(v);
else
v->store.u.ival += fmtsize(v);
break;
break;
case TFLOAT:
if(n->op == OPDEC)
v->store.u.fval--;

View File

@ -61,7 +61,7 @@ kinit(void)
initcmap();
for(i = 0; keywds[i].name; i++)
for(i = 0; keywds[i].name; i++)
enter(keywds[i].name, keywds[i].terminal);
}
@ -415,7 +415,7 @@ loop:
return numsym('.');
return '.';
case '(':
case ')':
case '[':
@ -671,7 +671,7 @@ delsym(Lsym *s)
for(q = s->name; *q; q++)
h = h*3 + *q;
h %= Hashsize;
if(hash[h] == s)
hash[h] = s->hash;
else{

View File

@ -54,7 +54,7 @@ build(Node *n)
l = al(res.type);
l->store = res.store;
*tail = l;
tail = &l->next;
tail = &l->next;
}
}

View File

@ -92,7 +92,7 @@ main(int argc, char *argv[])
default:
usage();
}ARGEND
USED(pid);
fmtinstall('Z', Zfmt);
@ -198,7 +198,7 @@ attachfiles(int argc, char **argv)
pid = 0;
interactive = 0;
USED(pid);
if(setjmp(err))
return -1;

View File

@ -29,7 +29,7 @@ sproc(int xpid)
free(correg);
correg = regs;
}else{
/* XXX should only change register set here if cormap already mapped */
/* XXX should only change register set here if cormap already mapped */
if(xpid <= 0)
error("bad pid");
unmapproc(cormap);
@ -245,4 +245,3 @@ getstatus(int pid)
{
return "unknown";
}

View File

@ -40,7 +40,7 @@ unique(char *buf, Symbol *s)
if(l == 0)
l = enter(buf, Tid);
s->aux = l;
return l;
return l;
}
void
@ -122,22 +122,22 @@ addvarsym(Fhdr *fp)
tl->store.u.l = list;
list->store.u.string = strnode(buf);
list->store.fmt = 's';
list->next = al(TINT);
list = list->next;
list->store.fmt = 'c';
list->store.u.ival = s.type;
list->next = al(TINT);
list = list->next;
list->store.fmt = 'X';
list->store.u.ival = v;
list->next = al(TSTRING);
list = list->next;
list->store.fmt = 's';
list->store.u.string = file;
list->next = al(TSTRING);
list = list->next;
list->store.fmt = 's';

View File

@ -9,7 +9,7 @@ enum
Base,
Enum,
Aggr,
Function,
Function,
Pointer,
Array,
Range,
@ -92,4 +92,3 @@ int Bfmt(Fmt*);
#ifdef VARARGCK
#pragma varargck type "B" char*
#endif

View File

@ -183,4 +183,3 @@ ds2acid(Dwarf *d, DwarfSym *s, Biobuf *b, char *fn)
break;
}
}

View File

@ -64,7 +64,7 @@ main(int argc, char **argv)
}
have = 1;
}
if(!have){
Bprint(&b, "// no debugging symbols in %s\n\n", argv[i]);
/* fprint(2, "no debugging symbols in %s\n", argv[i]); */
@ -75,4 +75,3 @@ main(int argc, char **argv)
Bterm(&b);
exits(0);
}

View File

@ -192,7 +192,7 @@ parsenum(char *p, int *n1, int *n2, char **pp)
/*
attr ::= '@' text ';'
text is
text is
'a' integer (alignment)
'p' integer (pointer class)
'P' (packed type)
@ -237,7 +237,7 @@ static Basic baseints[] =
/*13*/ 8, 'f', /* double */
/*14*/ 10, 'f', /* long double */
/*15*/ 4, 'd', /* int32 */
/*16*/ 4, 'd', /* bool32 */
/*16*/ 4, 'd', /* bool32 */
/*17*/ 2, 'f', /* short real */
/*18*/ 4, 'f', /* real */
/*19*/ 4, 'x', /* stringptr */
@ -391,7 +391,7 @@ parsedefn(char *p, Type *t, char **pp)
t->ty = Pointer;
t->sub = parseinfo(p+1, &p);
break;
case 'a': /* array */
case 'a': /* array */
case 'P': /* packed array */
t->ty = Pointer;
tt = newtype();
@ -422,7 +422,7 @@ parsedefn(char *p, Type *t, char **pp)
}
semi(&p);
break;
case 's': /* struct */
case 'u': /* union */
p++;
@ -532,7 +532,7 @@ parsedefn(char *p, Type *t, char **pp)
}
/*
bound ::=
bound ::=
'A' offset (bound is on stack by ref at offset offset from arg list)
| 'T' offset (bound is on stack by val at offset offset from arg list)
| 'a' regnum (bound passed by reference in register)
@ -642,7 +642,7 @@ stabs2acid(Stab *stabs, Biobuf *b)
fno++;
if((f = findftypes(dir, sym.name)) == nil){
static int cannotprint;
if(cannotprint++ == 0)
fprint(2, "cannot find remembered %s\n", sym.name);
continue;
@ -673,7 +673,7 @@ stabs2acid(Stab *stabs, Biobuf *b)
}
if(setjmp(kaboom)){
static int cannotparse;
if(cannotparse++ == 0)
fprint(2, "cannot parse %s\n", name);
continue;
@ -683,7 +683,7 @@ stabs2acid(Stab *stabs, Biobuf *b)
continue;
if(*p != 0){
static int extradesc;
if(extradesc++ == 0)
fprint(2, "extra desc '%s' in '%s'\n", p, desc);
}

View File

@ -95,7 +95,7 @@ typebynum(uint n1, uint n2)
t->n2 = n2;
addhash(t);
return t;
}
}
Type*
newtype(void)
@ -251,10 +251,10 @@ cleanstl(char *name)
{
char *b, *p;
static char buf[65536]; /* These can be huge. */
if(strchr(name, '<') == nil)
return nonempty(name);
b = buf;
for(p = name; *p != 0; p++){
switch(*p){
@ -443,7 +443,7 @@ char*
mkname(char *prefix, char *name)
{
static char buf[65536];
snprint(buf, sizeof buf, "%s%s", prefix, name);
return buf;
}
@ -630,7 +630,7 @@ ttt=ttt->sub;
if(nprint == 0)
Bprint(b, "\t'X' 0 __dummy;\n");
Bprint(b, "};\n\n");
name = nameof(t, 1); /* might have smashed it */
Bprint(b, "defn %B(addr) { %B(addr, \"\"); }\n", name, mkname("indent_", name));
Bprint(b, "defn %B(addr, indent) {\n", mkname("indent_", name));
@ -675,13 +675,13 @@ ttt=ttt->sub;
}
Bprint(b, "};\n\n");
break;
case Enum:
name = nameof(t, 1);
Bprint(b, "// enum %s\n", name);
for(j=0; j<t->n; j++)
Bprint(b, "%B = %ld;\n", fixname(t->tname[j]), t->val[j]);
Bprint(b, "%B = {\n", mkname("vals_", name));
for(j=0; j<t->n; j++)
Bprint(b, "\t%lud,\n", t->val[j]);
@ -738,7 +738,7 @@ printtypes(Biobuf *b)
* only take one type of a given name; acid is going to do this anyway,
* and this will reduce the amount of code we output considerably.
* we could run a DFA equivalence relaxation sort of algorithm
* to find the actual equivalence classes, and then rename types
* to find the actual equivalence classes, and then rename types
* appropriately, but this will do for now.
*/
all = emalloc(n*sizeof(all[0]));

View File

@ -68,7 +68,7 @@ Bfmt(Fmt *fmt)
{
int i;
char *s, *t;
if(!isBfrog['.']){
for(i=0; i<256; i++)
if(i != '_' && i != '$' && i < Runeself && !isalnum(i))

View File

@ -968,69 +968,69 @@ Cursor boxcursor = {
Cursor2 boxcursor2 = {
{-15, -15},
{0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xC0, 0x03, 0xFF,
0xFF, 0xC0, 0x03, 0xFF,
0xFF, 0xC0, 0x03, 0xFF,
0xFF, 0xC0, 0x03, 0xFF,
0xFF, 0xC0, 0x03, 0xFF,
0xFF, 0xC0, 0x03, 0xFF,
0xFF, 0xC0, 0x03, 0xFF,
0xFF, 0xC0, 0x03, 0xFF,
0xFF, 0xC0, 0x03, 0xFF,
0xFF, 0xC0, 0x03, 0xFF,
0xFF, 0xC0, 0x03, 0xFF,
0xFF, 0xC0, 0x03, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
{0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xC0, 0x03, 0xFF,
0xFF, 0xC0, 0x03, 0xFF,
0xFF, 0xC0, 0x03, 0xFF,
0xFF, 0xC0, 0x03, 0xFF,
0xFF, 0xC0, 0x03, 0xFF,
0xFF, 0xC0, 0x03, 0xFF,
0xFF, 0xC0, 0x03, 0xFF,
0xFF, 0xC0, 0x03, 0xFF,
0xFF, 0xC0, 0x03, 0xFF,
0xFF, 0xC0, 0x03, 0xFF,
0xFF, 0xC0, 0x03, 0xFF,
0xFF, 0xC0, 0x03, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF},
{0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x3F, 0xFF, 0xFF, 0xFC,
0x3F, 0xFF, 0xFF, 0xFC,
0x3F, 0xFF, 0xFF, 0xFC,
0x3F, 0xFF, 0xFF, 0xFC,
0x3F, 0xFF, 0xFF, 0xFC,
0x3F, 0xFF, 0xFF, 0xFC,
0x3F, 0x00, 0x00, 0xFC,
0x3F, 0x00, 0x00, 0xFC,
0x3F, 0x00, 0x00, 0xFC,
0x3F, 0x00, 0x00, 0xFC,
0x3F, 0x00, 0x00, 0xFC,
0x3F, 0x00, 0x00, 0xFC,
0x3F, 0x00, 0x00, 0xFC,
0x3F, 0x00, 0x00, 0xFC,
0x3F, 0x00, 0x00, 0xFC,
0x3F, 0x00, 0x00, 0xFC,
0x3F, 0x00, 0x00, 0xFC,
0x3F, 0x00, 0x00, 0xFC,
0x3F, 0x00, 0x00, 0xFC,
0x3F, 0x00, 0x00, 0xFC,
0x3F, 0x00, 0x00, 0xFC,
0x3F, 0x00, 0x00, 0xFC,
0x3F, 0xFF, 0xFF, 0xFC,
0x3F, 0xFF, 0xFF, 0xFC,
0x3F, 0xFF, 0xFF, 0xFC,
0x3F, 0xFF, 0xFF, 0xFC,
0x3F, 0xFF, 0xFF, 0xFC,
0x3F, 0xFF, 0xFF, 0xFC,
0x00, 0x00, 0x00, 0x00,
{0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x3F, 0xFF, 0xFF, 0xFC,
0x3F, 0xFF, 0xFF, 0xFC,
0x3F, 0xFF, 0xFF, 0xFC,
0x3F, 0xFF, 0xFF, 0xFC,
0x3F, 0xFF, 0xFF, 0xFC,
0x3F, 0xFF, 0xFF, 0xFC,
0x3F, 0x00, 0x00, 0xFC,
0x3F, 0x00, 0x00, 0xFC,
0x3F, 0x00, 0x00, 0xFC,
0x3F, 0x00, 0x00, 0xFC,
0x3F, 0x00, 0x00, 0xFC,
0x3F, 0x00, 0x00, 0xFC,
0x3F, 0x00, 0x00, 0xFC,
0x3F, 0x00, 0x00, 0xFC,
0x3F, 0x00, 0x00, 0xFC,
0x3F, 0x00, 0x00, 0xFC,
0x3F, 0x00, 0x00, 0xFC,
0x3F, 0x00, 0x00, 0xFC,
0x3F, 0x00, 0x00, 0xFC,
0x3F, 0x00, 0x00, 0xFC,
0x3F, 0x00, 0x00, 0xFC,
0x3F, 0x00, 0x00, 0xFC,
0x3F, 0xFF, 0xFF, 0xFC,
0x3F, 0xFF, 0xFF, 0xFC,
0x3F, 0xFF, 0xFF, 0xFC,
0x3F, 0xFF, 0xFF, 0xFC,
0x3F, 0xFF, 0xFF, 0xFC,
0x3F, 0xFF, 0xFF, 0xFC,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00}
};
@ -1047,7 +1047,7 @@ iconinit(void)
tagcols[BORD] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DPurpleblue);
tagcols[TEXT] = display->black;
tagcols[HTEXT] = display->black;
/* Yellow */
textcols[BACK] = allocimagemix(display, DPaleyellow, DWhite);
textcols[HIGH] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DDarkyellow);
@ -1055,7 +1055,7 @@ iconinit(void)
textcols[TEXT] = display->black;
textcols[HTEXT] = display->black;
}
r = Rect(0, 0, Scrollwid+ButtonBorder, font->height+1);
if(button && eqrect(r, button->r))
return;
@ -1169,4 +1169,3 @@ timefmt(Fmt *f)
return fmtprint(f, "%04d/%02d/%02d %02d:%02d:%02d",
tm->year+1900, tm->mon+1, tm->mday, tm->hour, tm->min, tm->sec);
}

View File

@ -89,19 +89,19 @@ coladd(Column *c, Window *w, Window *clone, int y)
/*
* figure out where to split v to make room for w
*/
/* new window stops where next window begins */
if(i < c->nw)
ymax = c->w[i]->r.min.y-Border;
else
ymax = c->r.max.y;
/* new window must start after v's tag ends */
y = max(y, v->tagtop.max.y+Border);
/* new window must start early enough to end before ymax */
y = min(y, ymax - minht);
/* if y is too small, too many windows in column */
if(y < v->tagtop.max.y+Border)
buggered = 1;
@ -118,7 +118,7 @@ coladd(Column *c, Window *w, Window *clone, int y)
r1.min.y = winresize(v, r1, FALSE, FALSE);
r1.max.y = r1.min.y+Border;
draw(screen, r1, display->black, nil, ZP);
/*
* leave r with w's coordinates
*/
@ -142,7 +142,7 @@ coladd(Column *c, Window *w, Window *clone, int y)
c->nw++;
c->w[i] = w;
c->safe = TRUE;
/* if there were too many windows, redraw the whole column */
if(buggered)
colresize(c, c->r);

View File

@ -633,8 +633,8 @@ runpipe(Text *t, int cmd, Rune *cr, int ncr, int state)
/*
* The editoutlk exists only so that we can tell when
* the editout file has been closed. It can get closed *after*
* the process exits because, since the process cannot be
* connected directly to editout (no 9P kernel support),
* the process exits because, since the process cannot be
* connected directly to editout (no 9P kernel support),
* the process is actually connected to a pipe to another
* process (arranged via 9pserve) that reads from the pipe
* and then writes the data in the pipe to editout using
@ -704,7 +704,7 @@ printposn(Text *t, int mode)
if (t != nil && t->file != nil && t->file->name != nil)
warning(nil, "%.*S:", t->file->nname, t->file->name);
switch(mode) {
case PosnChars:
warning(nil, "#%d", addr.r.q0);
@ -712,7 +712,7 @@ printposn(Text *t, int mode)
warning(nil, ",#%d", addr.r.q1);
warning(nil, "\n");
return;
default:
case PosnLine:
l1 = 1+nlcount(t, 0, addr.r.q0, nil);

View File

@ -515,7 +515,7 @@ parsecmd(int nest)
if(nextc() == 'g')
cmd.flag = getch();
}
}
}
}
@ -613,7 +613,7 @@ simpleaddr(void)
addr.num = getnum(1);
break;
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
case '5': case '6': case '7': case '8': case '9':
addr.num = getnum(1);
addr.type='l';
break;

View File

@ -243,7 +243,7 @@ elogapply(File *f)
* but using coordinates relative to the unmodified buffer. As we apply the log,
* we have to update the coordinates to be relative to the modified buffer.
* Textinsert and textdelete will do this for us; our only work is to apply the
* convention that an insertion at t->q0==t->q1 is intended to select the
* convention that an insertion at t->q0==t->q1 is intended to select the
* inserted text.
*/
@ -337,7 +337,7 @@ elogapply(File *f)
}
fbuffree(buf);
elogterm(f);
/*
* Bad addresses will cause bufload to crash, so double check.
* If changes were out of order, we expect problems so don't complain further.

View File

@ -463,7 +463,7 @@ fsyswalk(Xfid *x, Fid *f)
qunlock(&row.lk);
dir = dirtabw;
goto Accept;
Regular:
if(strcmp(x->fcall.wname[i], "new") == 0){
if(w)

View File

@ -20,7 +20,7 @@ struct Log
Rendez r;
vlong start; // msg[0] corresponds to 'start' in the global sequence of events
// queued events (nev=entries in ev, mev=capacity of p)
char **ev;
int nev;
@ -30,7 +30,7 @@ struct Log
Fid **f;
int nf;
int mf;
// active (blocked) reads waiting for events
Xfid **read;
int nread;
@ -43,7 +43,7 @@ void
xfidlogopen(Xfid *x)
{
qlock(&eventlog.lk);
if(eventlog.nf >= eventlog.mf) {
if(eventlog.nf >= eventlog.mf) {
eventlog.mf = eventlog.mf*2;
if(eventlog.mf == 0)
eventlog.mf = 8;
@ -78,20 +78,20 @@ xfidlogread(Xfid *x)
Fcall fc;
qlock(&eventlog.lk);
if(eventlog.nread >= eventlog.mread) {
if(eventlog.nread >= eventlog.mread) {
eventlog.mread = eventlog.mread*2;
if(eventlog.mread == 0)
eventlog.mread = 8;
eventlog.read = erealloc(eventlog.read, eventlog.mread*sizeof eventlog.read[0]);
}
eventlog.read[eventlog.nread++] = x;
if(eventlog.r.l == nil)
eventlog.r.l = &eventlog.lk;
x->flushed = FALSE;
while(x->f->logoff >= eventlog.start+eventlog.nev && !x->flushed)
rsleep(&eventlog.r);
for(i=0; i<eventlog.nread; i++) {
if(eventlog.read[i] == x) {
eventlog.read[i] = eventlog.read[--eventlog.nread];
@ -112,7 +112,7 @@ xfidlogread(Xfid *x)
fc.data = p;
fc.count = strlen(p);
respond(x, &fc, nil);
free(p);
free(p);
}
void
@ -177,7 +177,7 @@ xfidlog(Window *w, char *op)
eventlog.start += n;
memmove(eventlog.ev, eventlog.ev+n, eventlog.nev*sizeof eventlog.ev[0]);
}
// Otherwise grow.
if(eventlog.nev >= eventlog.mev) {
eventlog.mev = eventlog.mev*2;

View File

@ -178,4 +178,3 @@ extern int shortmenu;
extern CFsys *mailfs;
extern CFsys *acmefs;

View File

@ -67,7 +67,7 @@ char*
readbody(char *type, char *dir, int *np)
{
char *body;
body = readfile(dir, "body", np);
if(body != nil && strcmp(type, "text/html") == 0)
return formathtml(body, np);

View File

@ -558,16 +558,16 @@ mainctl(void *v)
Unknown:
print("unknown message %c%c\n", e->c1, e->c2);
break;
case 'E': /* write to body; can't affect us */
break;
case 'F': /* generated by our actions; ignore */
break;
case 'K': /* type away; we don't care */
break;
case 'M':
switch(e->c2){
case 'x':
@ -597,7 +597,7 @@ mainctl(void *v)
if(na)
free(s);
break;
case 'l':
case 'L':
buf = nil;
@ -628,17 +628,16 @@ mainctl(void *v)
winwriteevent(w, e);
free(buf);
break;
case 'I': /* modify away; we don't care */
case 'D':
case 'd':
case 'i':
break;
default:
goto Unknown;
}
}
}
}

View File

@ -85,7 +85,7 @@ mkaddrs(char *t, char **colon)
int i, nf, inquote;
char **f, *s;
Fmt fmt;
inquote = 0;
nf = 2;
for(s=t; *s; s++){
@ -127,7 +127,7 @@ loadinfo(Message *m, char *dir)
data = readfile(dir, "info", &n);
if(data == nil)
return 0;
p = data;
while((s = line(p, &p)) != nil && *s != 0){
t = strchr(s, ' ');
@ -282,7 +282,7 @@ mesgadd(Message *mbox, char *dir, Dir *d, char *digest)
if (m->level != 1){
m->recursed = 1;
readmbox(m, dir, m->name);
readmbox(m, dir, m->name);
}
return 1;
}
@ -351,7 +351,7 @@ readfile(char *dir, char *name, int *np)
fsseek(fid, 0, 0);
free(d);
d = fsdirfstat(fid);
}
}
free(file);
len = 0;
if(d != nil)
@ -400,13 +400,13 @@ info(Message *m, int ind, int ogf)
i = estrdup(s);
return i;
}
}
i = estrdup("");
i = eappend(i, "\t", p);
i = egrow(i, "\t", stripdate(m->date));
if(ind == 0){
if(strcmp(m->type, "text")!=0 && strncmp(m->type, "text/", 5)!=0 &&
if(strcmp(m->type, "text")!=0 && strncmp(m->type, "text/", 5)!=0 &&
strncmp(m->type, "multipart/", 10)!=0)
i = egrow(i, "\t(", estrstrdup(m->type, ")"));
}else if(strncmp(m->type, "multipart/", 10) != 0)
@ -647,7 +647,7 @@ mesgsave(Message *m, char *s, int save)
}
return 1;
}
t = estrstrdup(mbox.name, m->name);
raw = readfile(t, "raw", &n);
unixheader = readfile(t, "unixheader", &k);
@ -1160,7 +1160,7 @@ tokenizec(char *str, char **args, int max, char *splitc)
if(max <= 0)
return 0;
/* if(strchr(str, ',') || strchr(str, '"') || strchr(str, '<') || strchr(str, '(')) */
/* splitc = ","; */
for(na=0; *str != '\0';str++){

View File

@ -78,7 +78,7 @@ mkreply(Message *m, char *label, char *to, Plumbattr *attr, char *quotetext)
Plumbattr *a;
quotereply = (label[0] == 'Q');
if(quotereply && m && m->replywinid > 0){
snprint(buf, sizeof buf, "%d/body", m->replywinid);
if((fd = fsopen(acmefs, buf, OWRITE)) != nil){
@ -88,7 +88,7 @@ mkreply(Message *m, char *label, char *to, Plumbattr *attr, char *quotetext)
return;
}
}
r = emalloc(sizeof(Message));
r->isreply = 1;
if(m != nil)
@ -212,7 +212,7 @@ execproc(void *v)
q[0] = e->q[0];
q[1] = e->q[1];
prog = e->prog; /* known not to be malloc'ed */
fd[0] = dup(p[0], -1);
if(q[0])
fd[1] = dup(q[1], -1);
@ -224,7 +224,7 @@ execproc(void *v)
free(e->argv);
chanfree(e->sync);
free(e);
threadexec(nil, fd, prog, argv);
close(fd[0]);
close(fd[1]);

View File

@ -104,4 +104,3 @@ ctlprint(CFid *fd, char *fmt, ...)
if(n <= 0)
error("control file write error: %r");
}

View File

@ -196,7 +196,7 @@ wingeter(Window *w, char *buf, int *nb)
while(!fullrune(buf, n))
buf[n++] = wingetec(w);
chartorune(&r, buf);
}
}
*nb = n;
return r;
}

View File

@ -388,7 +388,7 @@ textinsert(Text *t, uint q0, Rune *r, uint n, int tofile)
textscrdraw(u);
}
}
}
if(q0 < t->iq1)
t->iq1 += n;
@ -549,7 +549,7 @@ textbswidth(Text *t, Rune c)
if(r == '\n'){ /* eat at most one more character */
if(q == t->q0) /* eat the newline */
--q;
break;
break;
}
if(c == 0x17){
eq = isalnum(r);
@ -771,7 +771,7 @@ texttype(Text *t, Rune r)
case Kcmd+'Z': /* %-shift-Z: redo */
typecommit(t);
undo(t, nil, nil, FALSE, 0, nil, 0);
return;
return;
Tagdown:
/* expand tag to show all text */
@ -780,7 +780,7 @@ texttype(Text *t, Rune r)
winresize(t->w, t->w->r, FALSE, TRUE);
}
return;
Tagup:
/* shrink tag to single line */
if(t->w->tagexpand){
@ -1192,7 +1192,7 @@ void
textsetselect(Text *t, uint q0, uint q1)
{
int p0, p1, ticked;
/* t->fr.p0 and t->fr.p1 are always right; t->q0 and t->q1 may be off */
t->q0 = q0;
t->q1 = q1;
@ -1345,7 +1345,7 @@ textselect23(Text *t, uint *q0, uint *q1, Image *high, int mask)
{
uint p0, p1;
int buts;
p0 = xselect(&t->fr, mousectl, high, &p1);
buts = mousectl->m.buttons;
if((buts & mask) == 0){
@ -1412,7 +1412,7 @@ textdoubleclick(Text *t, uint *q0, uint *q1)
if(textclickhtmlmatch(t, q0, q1))
return;
for(i=0; left[i]!=nil; i++){
q = *q0;
l = left[i];
@ -1444,7 +1444,7 @@ textdoubleclick(Text *t, uint *q0, uint *q1)
return;
}
}
/* try filling out word to right */
while(*q1<t->file->b.nc && isalnum(textreadc(t, *q1)))
(*q1)++;
@ -1518,7 +1518,7 @@ static int
ishtmlend(Text *t, uint q, uint *q0)
{
int c, c1, c2;
if(q < 2)
return 0;
if(textreadc(t, --q) != '>')
@ -1546,7 +1546,7 @@ textclickhtmlmatch(Text *t, uint *q0, uint *q1)
{
int depth, n;
uint q, nq;
q = *q0;
// after opening tag? scan forward for closing tag
if(ishtmlend(t, q, nil) == 1) {
@ -1583,7 +1583,7 @@ textclickhtmlmatch(Text *t, uint *q0, uint *q1)
q--;
}
}
return 0;
}

View File

@ -132,7 +132,7 @@ errorwin(Mntdir *md, int owner)
}
/*
* Incoming window should be locked.
* Incoming window should be locked.
* It will be unlocked and returned window
* will be locked in its place.
*/
@ -189,7 +189,7 @@ void
addwarningtext(Mntdir *md, Rune *r, int nr)
{
Warning *warn;
for(warn = warnings; warn; warn=warn->next){
if(warn->md == md){
bufinsert(&warn->buf, warn->buf.nc, r, nr);

View File

@ -97,7 +97,7 @@ windrawbutton(Window *w)
{
Image *b;
Rectangle br;
b = button;
if(!w->isdir && !w->isscratch && (w->body.file->mod || w->body.ncache))
b = modbutton;
@ -112,7 +112,7 @@ delrunepos(Window *w)
{
int n;
Rune rune;
for(n=0; n<w->tag.file->b.nc; n++) {
bufread(&w->tag.file->b, n, &rune, 1);
if(rune == ' ')
@ -128,7 +128,7 @@ void
movetodel(Window *w)
{
int n;
n = delrunepos(w);
if(n < 0)
return;
@ -153,7 +153,7 @@ wintaglines(Window *w, Rectangle r)
textresize(&w->tag, r, TRUE);
w->tag.fr.noredraw = 0;
w->tagsafe = FALSE;
if(!w->tagexpand) {
/* use just as many lines as needed to show the Del */
n = delrunepos(w);
@ -162,7 +162,7 @@ wintaglines(Window *w, Rectangle r)
p = subpt(frptofchar(&w->tag.fr, n), w->tag.fr.r.min);
return 1 + p.y / w->tag.fr.font->height;
}
/* can't use more than we have */
if(w->tag.fr.nlines >= w->tag.fr.maxlines)
return w->tag.fr.maxlines;
@ -224,7 +224,7 @@ winresize(Window *w, Rectangle r, int safe, int keepextra)
moveto(mousectl, p);
}
}
/* If needed, resize & redraw body. */
r1 = r;
r1.min.y = y;
@ -293,7 +293,7 @@ winunlock(Window *w)
void
winmousebut(Window *w)
{
moveto(mousectl, addpt(w->tag.scrollr.min,
moveto(mousectl, addpt(w->tag.scrollr.min,
divpt(Pt(Dx(w->tag.scrollr), font->height), 2)));
}
@ -673,7 +673,7 @@ winctlprint(Window *w, char *buf, int fonts)
sprint(buf, "%11d %11d %11d %11d %11d ", w->id, w->tag.file->b.nc,
w->body.file->b.nc, w->isdir, w->dirty);
if(fonts)
return smprint("%s%11d %q %11d ", buf, Dx(w->body.fr.r),
return smprint("%s%11d %q %11d ", buf, Dx(w->body.fr.r),
w->body.reffont->f->name, w->body.fr.maxtab);
return buf;
}

View File

@ -17,7 +17,7 @@ cosadd(int n, ...)
int i;
double sum, a1, a2;
va_list arg;
sum = 0;
cp = cacp;
va_start(arg, n);

View File

@ -35,7 +35,7 @@ main(int argc, char **argv)
sysfatal("%r");
s = smprint("key %A p=%lB q=%lB alpha=%lB key=%lB\n",
a,
a,
key->pub.p, key->pub.q, key->pub.alpha, key->pub.key);
if(s == nil)
sysfatal("smprint: %r");

View File

@ -18,7 +18,7 @@ main(int argc, char **argv)
DSApriv *k;
char *comment;
uchar buf[8192], *p;
fmtinstall('B', mpfmt);
fmtinstall('[', encodefmt);
comment = "";

View File

@ -43,6 +43,6 @@ main(int argc, char **argv)
if(write(1, s, strlen(s)) != strlen(s))
sysfatal("write: %r");
exits(nil);
}

View File

@ -30,10 +30,10 @@ threadmain(int argc, char **argv)
uchar digest[SHA1dlen];
AuthRpc *rpc;
Fmt fmt;
fmtinstall('[', encodefmt);
fmtinstall('H', encodefmt);
verify = 0;
id = "";
ARGBEGIN{
@ -46,7 +46,7 @@ threadmain(int argc, char **argv)
default:
usage();
}ARGEND
if(argc != 1)
usage();
key = argv[0];
@ -68,7 +68,7 @@ threadmain(int argc, char **argv)
auth_freerpc(rpc);
threadexits("rpc");
}
print("+%s\n", id);
Binit(&b, 0, OREAD);
@ -96,7 +96,7 @@ keytomp(Attr *a, char *name)
{
char *p;
mpint *m;
p = _strfindattr(a, name);
if(p == nil)
sysfatal("missing key attribute %s", name);
@ -117,7 +117,7 @@ doVerify(void)
Attr *a;
DSAsig dsig;
DSApub dkey;
a = _parseattr(key);
if(a == nil)
sysfatal("invalid key");
@ -159,7 +159,7 @@ end:
if(dsaverify(&dkey, &dsig, betomp(digest, sizeof digest, nil)) < 0)
sysfatal("signature failed to verify: %r");
write(1, text, strlen(text));
threadexitsall(0);
}
@ -169,7 +169,7 @@ getline(int *np)
{
char *p;
int n;
if((p = Brdline(&b, '\n')) == nil)
return nil;
n = Blinelen(&b);

View File

@ -10,7 +10,7 @@
* S -> C: ok
*
* Note that this is the protocol between factotum and the local
* program, not between the two factotums. The information
* program, not between the two factotums. The information
* exchanged here is wrapped in the APOP protocol by the local
* programs.
*
@ -42,7 +42,7 @@ apopclient(Conv *c)
Attr *attr;
DigestState *ds;
Key *k;
chal = nil;
k = nil;
res = nil;
@ -328,7 +328,7 @@ apopresp(ServerState *s, char *user, char *resp)
}
static Role
apoproles[] =
apoproles[] =
{
"client", apopclient,
"server", apopserver,
@ -350,4 +350,3 @@ Proto cram = {
apopcheck,
nil
};

View File

@ -53,7 +53,7 @@ addattrs(Attr *a, Attr *b)
break;
}
}
return a;
return a;
}
void
@ -201,7 +201,7 @@ matchattr(Attr *pat, Attr *a0, Attr *a1)
break;
}
}
return 1;
return 1;
}
Attr*

View File

@ -1,6 +1,6 @@
/*
* CHAP, MSCHAP
*
*
* The client does not authenticate the server, hence no CAI
*
* Protocol:
@ -51,7 +51,7 @@ nthash(uchar hash[MShashlen], char *passwd)
{
uchar buf[512];
int i;
for(i=0; *passwd && i<sizeof(buf); passwd++) {
buf[i++] = *passwd;
buf[i++] = 0;
@ -96,7 +96,7 @@ mschalresp(uchar resp[MSresplen], uchar hash[MShashlen], uchar chal[MSchallen])
{
int i;
uchar buf[21];
memset(buf, 0, sizeof(buf));
memcpy(buf, hash, MShashlen);
@ -404,7 +404,7 @@ chapresp(ServerState *s, char *user, char *resp)
}
static Role
chaproles[] =
chaproles[] =
{
"client", chapclient,
"server", chapserver,
@ -424,5 +424,3 @@ Proto mschap = {
"user? !password?",
chapcheck
};

View File

@ -268,4 +268,3 @@ convbadkey(Conv *c, Key *k, char *msg, Attr *a)
return -1;
return 0;
}

View File

@ -168,7 +168,7 @@ main(int argc, char **argv)
/* start up a process to pass along notes */
lclnoteproc(data);
/*
/*
* Wait for the other end to execute and start our file service
* of /mnt/term
*/
@ -246,7 +246,7 @@ old9p(int fd)
close(fd);
close(p[0]);
}
return p[1];
return p[1];
}
/* Invoked with stdin, stdout and stderr connected to the network connection */
@ -392,7 +392,7 @@ readstr(int fd, char *str, int len)
while(len) {
n = read(fd, str, 1);
if(n < 0)
if(n < 0)
return -1;
if(*str == '\0')
return 0;
@ -659,7 +659,7 @@ rmtnoteproc(void)
syslog(0, "cpu", "cpu -R: can't open %s", rmtnotefile);
_exits(0);
}
for(;;){
n = read(fd, buf, sizeof(buf)-1);
if(n <= 0){

View File

@ -57,7 +57,7 @@ struct Conv
Req *req; /* 9P call to read response */
Channel *keywait; /* wait here for key confirmation */
};
struct Key

View File

@ -3,7 +3,7 @@
/*
* DSA signing and verification
*
*
* Sign:
* start p=xxx q=xxx alpha=xxx key=xxx
* write msg
@ -14,10 +14,10 @@
* write msg
* write signature(msg)
* read ok or fail
*
*
* all numbers are hexadecimal bigints parsable with strtomp.
*/
static int
xdsasign(Conv *c)
{
@ -58,7 +58,7 @@ xdsasign(Conv *c)
}
/*
* convert to canonical form (lower case)
* convert to canonical form (lower case)
* for use in attribute matches.
*/
static void
@ -78,11 +78,11 @@ readdsapriv(Key *k)
priv = dsaprivalloc();
if((a=strfindattr(k->attr, "p"))==nil
if((a=strfindattr(k->attr, "p"))==nil
|| (priv->pub.p=strtomp(a, nil, 16, nil))==nil)
goto Error;
strlwr(a);
if((a=strfindattr(k->attr, "q"))==nil
if((a=strfindattr(k->attr, "q"))==nil
|| (priv->pub.q=strtomp(a, nil, 16, nil))==nil)
goto Error;
strlwr(a);
@ -90,15 +90,15 @@ readdsapriv(Key *k)
werrstr("dsa: p or q not prime");
goto Error;
}
if((a=strfindattr(k->attr, "alpha"))==nil
if((a=strfindattr(k->attr, "alpha"))==nil
|| (priv->pub.alpha=strtomp(a, nil, 16, nil))==nil)
goto Error;
strlwr(a);
if((a=strfindattr(k->attr, "key"))==nil
if((a=strfindattr(k->attr, "key"))==nil
|| (priv->pub.key=strtomp(a, nil, 16, nil))==nil)
goto Error;
strlwr(a);
if((a=strfindattr(k->privattr, "!secret"))==nil
if((a=strfindattr(k->privattr, "!secret"))==nil
|| (priv->secret=strtomp(a, nil, 16, nil))==nil)
goto Error;
strlwr(a);
@ -113,7 +113,7 @@ static int
dsacheck(Key *k)
{
static int first = 1;
if(first){
fmtinstall('B', mpfmt);
first = 0;
@ -134,7 +134,7 @@ dsaclose(Key *k)
}
static Role
dsaroles[] =
dsaroles[] =
{
"sign", xdsasign,
0
@ -147,4 +147,3 @@ Proto dsa = {
dsacheck,
dsaclose
};

View File

@ -65,7 +65,7 @@ rootdirgen(int n, Dir *dir, void *v)
if(n > 0)
return -1;
fillstat(dir, factname, QTDIR, Qfactotum, DMDIR|0555);
return 0;
}
@ -224,7 +224,7 @@ convlist(int i, char *a, uint nn)
memmove(a, buf, n);
return n;
}
static void
fskickreply(Conv *c)
{
@ -250,7 +250,7 @@ fskickreply(Conv *c)
respond(r, nil);
c->nreply = 0;
}
/*
* Some of the file system work happens in the fs proc, but
* fsopen, fsread, fswrite, fsdestroyfid, and fsflush happen in
@ -305,7 +305,7 @@ fsopen(Req *r)
c->kickreply = fskickreply;
r->fid->aux = c;
}
respond(r, nil);
}
@ -538,4 +538,3 @@ fsinit0(void)
fs.destroyfid = fssendclunk;
fs.start = fsstart;
}

View File

@ -2,7 +2,7 @@
* HTTPDIGEST - MD5 challenge/response authentication (RFC 2617)
*
* Client protocol:
* write challenge: nonce method uri
* write challenge: nonce method uri
* read response: 2*MD5dlen hex digits
*
* Server protocol:
@ -22,10 +22,10 @@ hdclient(Conv *c)
char *realm, *passwd, *user, *f[4], *s, resp[MD5dlen*2+1];
int ret;
Key *k;
ret = -1;
s = nil;
c->state = "keylookup";
k = keyfetch(c, "%A", c->attr);
if(k == nil)
@ -45,7 +45,7 @@ hdclient(Conv *c)
digest(user, realm, passwd, f[0], f[1], f[2], resp);
convwrite(c, resp, strlen(resp));
ret = 0;
out:
free(s);
keyclose(k);
@ -103,7 +103,7 @@ digest(char *user, char *realm, char *passwd,
strtolower(dig);
}
static Role hdroles[] =
static Role hdroles[] =
{
"client", hdclient,
0

View File

@ -161,7 +161,7 @@ keyreplace(Conv *c, Key *k, char *fmt, ...)
sysfatal("out of memory");
va_end(arg);
/* replace prompted values with prompts */
/* replace prompted values with prompts */
a = copyattr(k->attr);
bp = parseattr(k->proto->keyprompt);
for(b=bp; b; b=b->next){
@ -204,7 +204,7 @@ keyevict(Conv *c, Key *k, char *fmt, ...)
sysfatal("out of memory");
va_end(arg);
/* replace prompted values with prompts */
/* replace prompted values with prompts */
a = copyattr(k->attr);
bp = parseattr(k->proto->keyprompt);
for(b=bp; b; b=b->next){

View File

@ -118,4 +118,3 @@ flog(char *fmt, ...)
lbvappend(&logbuf, fmt, arg);
va_end(arg);
}

View File

@ -142,7 +142,7 @@ sendkey(Attr *attr)
int rv;
char buf[8192];
CFid *fid;
fid = nsopen("factotum", nil, "ctl", OWRITE);
if(fid == nil)
sysfatal("opening factotum/ctl: %r");

View File

@ -9,7 +9,7 @@
* C->S: proto dom NUL
* [negotiated proto continues]
*/
extern Proto p9sk1, p9sk2, p9cr;
static Proto* okproto[] =
@ -111,7 +111,7 @@ p9anyserver(Conv *c)
}
ret = 0;
out:
free(s);
freeattr(attr);
@ -222,7 +222,7 @@ found:
/* f[i] is the chosen protocol, q the chosen domain */
attr = addattr(attr, "proto=%q dom=%q", f[i], q);
c->state = "write choice";
/* have a key: go for it */
choice = estrappend(nil, "%q %q", f[i], q);
if(convwrite(c, choice, strlen(choice)+1) < 0){
@ -258,7 +258,7 @@ out:
}
static Role
p9anyroles[] =
p9anyroles[] =
{
"client", p9anyclient,
"server", p9anyserver,
@ -269,4 +269,3 @@ Proto p9any = {
"p9any",
p9anyroles
};

View File

@ -9,7 +9,7 @@
* S -> C: ok or bad
*
* Note that this is the protocol between factotum and the local
* program, not between the two factotums. The information
* program, not between the two factotums. The information
* exchanged here is wrapped in other protocols by the local
* programs.
*/
@ -317,7 +317,7 @@ p9crresp(ServerState *s, uchar *resp, int resplen)
static int
p9response(char *pw, uchar *chal, uchar *resp)
{
{
char key[DESKEYLEN];
uchar buf[8];
ulong x;
@ -338,7 +338,7 @@ static int
vncresponse(char *pw, uchar *chal, uchar *resp)
{
DESstate des;
memmove(resp, chal, MAXCHAL);
setupDESstate(&des, 0, nil); // XXX put key in for 0
desECBencrypt(resp, MAXCHAL, &des);

View File

@ -93,7 +93,7 @@ p9skclient(Conv *c)
k = keyfetch(c, "%A", a);
if(k == nil)
goto out;
/* relay ticket request to auth server, get tickets */
strcpy(tr.hostid, strfindattr(k->attr, "user"));
if(speakfor)
@ -329,7 +329,7 @@ p9sk1close(Key *k)
}
static Role
p9sk1roles[] =
p9sk1roles[] =
{
"client", p9skclient,
"server", p9skserver,
@ -337,7 +337,7 @@ p9sk1roles[] =
};
static Role
p9sk2roles[] =
p9sk2roles[] =
{
"client", p9skclient,
"server", p9skserver,
@ -356,4 +356,3 @@ Proto p9sk2 = {
"p9sk2",
p9sk2roles
};

View File

@ -15,12 +15,12 @@ static int
passproto(Conv *c)
{
Key *k;
k = keyfetch(c, "%A", c->attr);
if(k == nil)
return -1;
c->state = "write";
convprint(c, "%q %q",
convprint(c, "%q %q",
strfindattr(k->attr, "user"),
strfindattr(k->privattr, "!password"));
return 0;

View File

@ -12,7 +12,7 @@
*
* We sign hashes of messages instead of the messages
* themselves.
*
*
* The hashes are encoded in ASN.1 DER to identify
* the signature type, and then prefixed with 0x01 PAD 0x00
* where PAD is as many 0xFF bytes as desired.
@ -138,7 +138,7 @@ mptoberjust(mpint *b, uchar *buf, uint len)
#define O3(x) \
(((x)>>14)&0x7F)|0x80, \
(((x)>>7)&0x7F)|0x80, \
((x)&0x7F)
((x)&0x7F)
uchar oidsha1[] = { O0(1, 3), 14, 3, 2, 26 };
uchar oidmd2[] = { O0(1, 2), O2(840), O3(113549), 2, 2 };
uchar oidmd5[] = { O0(1, 2), O2(840), O3(113549), 2, 5 };
@ -174,11 +174,11 @@ mkasn1(uchar *asn1, DigestAlg *alg, uchar *d, uint dlen)
sysfatal("bad alg in mkasn1");
return -1;
}
p = asn1;
*p++ = 0x30; /* sequence */
p++;
*p++ = 0x30; /* another sequence */
p++;
@ -186,12 +186,12 @@ mkasn1(uchar *asn1, DigestAlg *alg, uchar *d, uint dlen)
*p++ = olen;
memmove(p, obj, olen);
p += olen;
*p++ = 0x05; /* null */
*p++ = 0;
asn1[3] = p - (asn1+4); /* end of inner sequence */
*p++ = 0x04; /* octet string */
*p++ = dlen;
memmove(p, d, dlen);
@ -200,4 +200,3 @@ mkasn1(uchar *asn1, DigestAlg *alg, uchar *d, uint dlen)
asn1[1] = p - (asn1+2); /* end of outer sequence */
return p-asn1;
}

View File

@ -32,7 +32,7 @@
* done [haveai] - authentication is done [haveai: you can get an ai with authinfo]
*/
char *rpcname[] =
char *rpcname[] =
{
"unknown",
"authinfo",
@ -196,7 +196,7 @@ rpcexec(Conv *c)
rpcrespond(c, "error conversation not successful");
else{
/* make up an auth info using the attr */
p = convAI2M((uchar*)c->reply+3, sizeof c->reply-3,
p = convAI2M((uchar*)c->reply+3, sizeof c->reply-3,
strfindattr(c->attr, "cuid"),
strfindattr(c->attr, "suid"),
strfindattr(c->attr, "cap"),
@ -341,4 +341,3 @@ convAI2M(uchar *p, int n, char *cuid, char *suid, char *cap, char *hex)
werrstr("authinfo too big");
return p;
}

View File

@ -3,7 +3,7 @@
/*
* RSA authentication.
*
*
* Encrypt/Decrypt:
* start n=xxx ek=xxx
* write msg
@ -13,7 +13,7 @@
* start n=xxx ek=xxx
* write hash(msg)
* read signature(hash(msg))
*
*
* Verify:
* start n=xxx ek=xxx
* write hash(msg)
@ -44,14 +44,14 @@ xrsadecrypt(Conv *c)
if(k == nil)
goto out;
key = k->priv;
/* make sure have private half if needed */
role = strfindattr(c->attr, "role");
if(strcmp(role, "decrypt") == 0 && !key->c2){
werrstr("missing private half of key -- cannot decrypt");
goto out;
}
/* read text */
c->state = "read";
if((n=convreadm(c, &txt)) < 0)
@ -60,7 +60,7 @@ xrsadecrypt(Conv *c)
convprint(c, "data too short");
goto out;
}
/* encrypt/decrypt */
m = betomp((uchar*)txt, n, nil);
if(m == nil)
@ -72,7 +72,7 @@ xrsadecrypt(Conv *c)
if(mm == nil)
goto out;
n = mptobe(mm, (uchar*)buf, sizeof buf, nil);
/* send response */
c->state = "write";
convwrite(c, buf, n);
@ -98,7 +98,7 @@ xrsasign(Conv *c)
char *sig2;
ret = -1;
/* fetch key */
c->state = "keylookup";
k = keylookup("%A", c->attr);
@ -112,7 +112,7 @@ xrsasign(Conv *c)
werrstr("missing private half of key -- cannot sign");
goto out;
}
/* get hash type from key */
hash = strfindattr(k->attr, "hash");
if(hash == nil)
@ -144,7 +144,7 @@ xrsasign(Conv *c)
/* read signature */
if((n = convreadm(c, &sig2)) < 0)
goto out;
/* verify */
if(rsaverify(&key->pub, hashfn, digest, dlen, (uchar*)sig2, n) == 0)
convprint(c, "ok");
@ -160,7 +160,7 @@ out:
}
/*
* convert to canonical form (lower case)
* convert to canonical form (lower case)
* for use in attribute matches.
*/
static void
@ -180,22 +180,22 @@ readrsapriv(Key *k)
priv = rsaprivalloc();
if((a=strfindattr(k->attr, "ek"))==nil
if((a=strfindattr(k->attr, "ek"))==nil
|| (priv->pub.ek=strtomp(a, nil, 16, nil))==nil)
goto Error;
strlwr(a);
if((a=strfindattr(k->attr, "n"))==nil
if((a=strfindattr(k->attr, "n"))==nil
|| (priv->pub.n=strtomp(a, nil, 16, nil))==nil)
goto Error;
strlwr(a);
if(k->privattr == nil) /* only public half */
return priv;
if((a=strfindattr(k->privattr, "!p"))==nil
if((a=strfindattr(k->privattr, "!p"))==nil
|| (priv->p=strtomp(a, nil, 16, nil))==nil)
goto Error;
strlwr(a);
if((a=strfindattr(k->privattr, "!q"))==nil
if((a=strfindattr(k->privattr, "!q"))==nil
|| (priv->q=strtomp(a, nil, 16, nil))==nil)
goto Error;
strlwr(a);
@ -203,19 +203,19 @@ readrsapriv(Key *k)
werrstr("rsa: p or q not prime");
goto Error;
}
if((a=strfindattr(k->privattr, "!kp"))==nil
if((a=strfindattr(k->privattr, "!kp"))==nil
|| (priv->kp=strtomp(a, nil, 16, nil))==nil)
goto Error;
strlwr(a);
if((a=strfindattr(k->privattr, "!kq"))==nil
if((a=strfindattr(k->privattr, "!kq"))==nil
|| (priv->kq=strtomp(a, nil, 16, nil))==nil)
goto Error;
strlwr(a);
if((a=strfindattr(k->privattr, "!c2"))==nil
if((a=strfindattr(k->privattr, "!c2"))==nil
|| (priv->c2=strtomp(a, nil, 16, nil))==nil)
goto Error;
strlwr(a);
if((a=strfindattr(k->privattr, "!dk"))==nil
if((a=strfindattr(k->privattr, "!dk"))==nil
|| (priv->dk=strtomp(a, nil, 16, nil))==nil)
goto Error;
strlwr(a);
@ -230,7 +230,7 @@ static int
rsacheck(Key *k)
{
static int first = 1;
if(first){
fmtinstall('B', mpfmt);
first = 0;
@ -251,7 +251,7 @@ rsaclose(Key *k)
}
static Role
rsaroles[] =
rsaroles[] =
{
"sign", xrsasign,
"verify", xrsasign, /* public operation */

View File

@ -659,4 +659,3 @@ Out:
free(sta);
return rv;
}

View File

@ -7,4 +7,3 @@
#include <thread.h>
#include <fcall.h>
#include <9p.h>

View File

@ -50,5 +50,3 @@ estrappend(char *s, char *fmt, ...)
free(t);
return s;
}

View File

@ -11,11 +11,11 @@ wepclient(Conv *c)
char *dev, buf[128], *p, *kp;
Key *k;
int ret, fd, cfd;
fd = cfd = -1;
ret = -1;
dev = nil;
if((k = keylookup("%A !key1?", c->attr)) == nil
&& (k = keylookup("%A !key2?", c->attr)) == nil
&& (k = keylookup("%A !key3?", c->attr)) == nil){
@ -73,7 +73,7 @@ static Role weproles[] = {
0
};
Proto wep =
Proto wep =
{
"wep",
weproles,

View File

@ -9,7 +9,7 @@ xioproc(void)
{
Ioproc *c;
int i;
for(i=0; i<ncache; i++){
if(c = cache[i]){
cache[i] = nil;
@ -162,4 +162,3 @@ xioasgetticket(int fd, char *trbuf, char *tbuf)
n = 0;
return n;
}

View File

@ -41,7 +41,7 @@ void
readln(char *prompt, char *buf, int nbuf, int secret)
{
char *p;
p = readcons(prompt, nil, secret);
if(p == nil)
sysfatal("user terminated input");

View File

@ -30,5 +30,3 @@ main(int argc, char **argv)
write(1, buf, n);
print("\n");
}

View File

@ -109,27 +109,27 @@ getkey(int argc, char **argv, int needprivate, Attr **pa)
}
if((key->kp = strtomp(p, &p, 16, nil)) == nil || *p != 0){
fprint(2, "warning: bad !kp\n");
regen = 1;
regen = 1;
goto regen;
}
if((p = _strfindattr(a, "!kq")) == nil){
fprint(2, "warning: no !kq\n");
regen = 1;
regen = 1;
goto regen;
}
if((key->kq = strtomp(p, &p, 16, nil)) == nil || *p != 0){
fprint(2, "warning: bad !kq\n");
regen = 1;
regen = 1;
goto regen;
}
if((p = _strfindattr(a, "!c2")) == nil){
fprint(2, "warning: no !c2\n");
regen = 1;
regen = 1;
goto regen;
}
if((key->c2 = strtomp(p, &p, 16, nil)) == nil || *p != 0){
fprint(2, "warning: bad !c2\n");
regen = 1;
regen = 1;
goto regen;
}
regen:
@ -285,7 +285,7 @@ uchar*
putmp2(uchar *p, mpint *b)
{
int bits, n;
if(mpcmp(b, mpzero) == 0)
return put4(p, 0);
bits = mpsignif(b);

View File

@ -35,7 +35,7 @@ main(int argc, char **argv)
sysfatal("%r");
s = smprint("key %A size=%d ek=%lB n=%lB\n",
a,
a,
mpsignif(key->pub.n), key->pub.ek, key->pub.n);
if(s == nil)
sysfatal("smprint: %r");

View File

@ -19,7 +19,7 @@ main(int argc, char **argv)
{
RSApriv *k;
char *comment;
fmtinstall('B', mpfmt);
fmtinstall('[', encodefmt);
comment = "";
@ -42,7 +42,7 @@ main(int argc, char **argv)
if(ssh2){
uchar buf[8192], *p;
p = buf;
p = put4(p, 7);
p = putn(p, "ssh-rsa", 7);

View File

@ -35,7 +35,7 @@ main(int argc, char **argv)
sysfatal("%r");
s = smprint("key %A size=%d ek=%lB !dk=%lB n=%lB !p=%lB !q=%lB !kp=%lB !kq=%lB !c2=%lB\n",
a,
a,
mpsignif(key->pub.n), key->pub.ek,
key->dk, key->pub.n, key->p, key->q,
key->kp, key->kq, key->c2);

View File

@ -55,6 +55,6 @@ main(int argc, char **argv)
if(write(1, s, strlen(s)) != strlen(s))
sysfatal("write: %r");
exits(nil);
}

View File

@ -211,4 +211,3 @@ readstr(SConn *conn, char *s)
}
return n;
}

Some files were not shown because too many files have changed in this diff Show More