diff options
563 files changed, 3985 insertions, 3978 deletions
diff --git a/lib/csu/i386/c++rt0.c b/lib/csu/i386/c++rt0.c index 44da43849482..df859071e516 100644 --- a/lib/csu/i386/c++rt0.c +++ b/lib/csu/i386/c++rt0.c @@ -27,7 +27,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: c++rt0.c,v 1.2 1994/01/29 01:58:31 jtc Exp $ + * $Id: c++rt0.c,v 1.1 1994/03/09 17:12:59 nate Exp $ */ /* @@ -46,7 +46,7 @@ __dtors(void) { unsigned long i = (unsigned long) __DTOR_LIST__[0]; void (**p)(void) = __DTOR_LIST__ + i; - + while (i--) (**p--)(); } diff --git a/lib/libc/db/btree/bt_close.c b/lib/libc/db/btree/bt_close.c index 66d8fc158174..6269bd5c8ac0 100644 --- a/lib/libc/db/btree/bt_close.c +++ b/lib/libc/db/btree/bt_close.c @@ -157,7 +157,7 @@ __bt_sync(dbp, flags) goto ecrsr; mpool_put(t->bt_mp, h, MPOOL_DIRTY); } - + if ((status = mpool_sync(t->bt_mp)) == RET_SUCCESS) CLR(t, B_MODIFIED); diff --git a/lib/libc/db/btree/bt_open.c b/lib/libc/db/btree/bt_open.c index ec79cf75fbd2..f156745f9700 100644 --- a/lib/libc/db/btree/bt_open.c +++ b/lib/libc/db/btree/bt_open.c @@ -196,7 +196,7 @@ __bt_open(fname, flags, mode, openinfo, dflags) default: goto einval; } - + if ((t->bt_fd = open(fname, flags, mode)) < 0) goto err; diff --git a/lib/libc/db/hash/hash.h b/lib/libc/db/hash/hash.h index cfbedaa0ac99..1c80f83c69d5 100644 --- a/lib/libc/db/hash/hash.h +++ b/lib/libc/db/hash/hash.h @@ -185,7 +185,7 @@ typedef struct htab { /* Memory resident data structure */ * so it starts on this page and continues on the next. * The format of the page is: * KEY_OFF PARTIAL_KEY OVFL_PAGENO OVFLPAGE - * + * * KEY_OFF -- offset of the beginning of the key * PARTIAL_KEY -- 1 * OVFL_PAGENO - page number of the next overflow page @@ -220,7 +220,7 @@ typedef struct htab { /* Memory resident data structure */ * OVFL_PAGENO - page number of the next overflow page * OVFLPAGE -- 0 * - * FULL_KEY_DATA + * FULL_KEY_DATA * This must be the first key/data pair on the page. * There are two cases: * diff --git a/lib/libc/db/hash/hash_page.c b/lib/libc/db/hash/hash_page.c index 2b2f57264b06..7b018cbea45c 100644 --- a/lib/libc/db/hash/hash_page.c +++ b/lib/libc/db/hash/hash_page.c @@ -688,7 +688,7 @@ overflow_page(hashp) in_use_bits = free_bit; else in_use_bits = (hashp->BSIZE << BYTE_SHIFT) - 1; - + if (i == first_page) { bit = hashp->LAST_FREED & ((hashp->BSIZE << BYTE_SHIFT) - 1); diff --git a/lib/libc/db/mpool/mpool.c b/lib/libc/db/mpool/mpool.c index 72627bddade3..562c7f5e98fc 100644 --- a/lib/libc/db/mpool/mpool.c +++ b/lib/libc/db/mpool/mpool.c @@ -94,7 +94,7 @@ mpool_open(key, fd, pagesize, maxcache) mp->free.cnext = mp->free.cprev = (BKT *)&mp->free; mp->lru.cnext = mp->lru.cprev = (BKT *)&mp->lru; for (entry = 0; entry < HASHSIZE; ++entry) - mp->hashtable[entry].hnext = mp->hashtable[entry].hprev = + mp->hashtable[entry].hnext = mp->hashtable[entry].hprev = mp->hashtable[entry].cnext = mp->hashtable[entry].cprev = (BKT *)&mp->hashtable[entry]; mp->curcache = 0; @@ -106,8 +106,8 @@ mpool_open(key, fd, pagesize, maxcache) mp->pgin = mp->pgout = NULL; #ifdef STATISTICS - mp->cachehit = mp->cachemiss = mp->pagealloc = mp->pageflush = - mp->pageget = mp->pagenew = mp->pageput = mp->pageread = + mp->cachehit = mp->cachemiss = mp->pagealloc = mp->pageflush = + mp->pageget = mp->pagenew = mp->pageput = mp->pageread = mp->pagewrite = 0; #endif return (mp); @@ -132,7 +132,7 @@ mpool_filter(mp, pgin, pgout, pgcookie) mp->pgout = pgout; mp->pgcookie = pgcookie; } - + /* * MPOOL_NEW -- get a new page * @@ -335,7 +335,7 @@ mpool_sync(mp) * mp: mpool cookie * * Returns: - * NULL on failure and a pointer to the BKT on success + * NULL on failure and a pointer to the BKT on success */ static BKT * mpool_bkt(mp) @@ -478,7 +478,7 @@ mpool_stat(mp) mp->pagealloc, mp->pageflush); if (mp->cachehit + mp->cachemiss) (void)fprintf(stderr, - "%.0f%% cache hit rate (%lu hits, %lu misses)\n", + "%.0f%% cache hit rate (%lu hits, %lu misses)\n", ((double)mp->cachehit / (mp->cachehit + mp->cachemiss)) * 100, mp->cachehit, mp->cachemiss); (void)fprintf(stderr, "%lu page reads, %lu page writes\n", @@ -497,7 +497,7 @@ mpool_stat(mp) cnt = 0; } else sep = ", "; - + } (void)fprintf(stderr, "\n"); } diff --git a/lib/libc/db/recno/rec_put.c b/lib/libc/db/recno/rec_put.c index 8c3bae573f38..590d45b4f919 100644 --- a/lib/libc/db/recno/rec_put.c +++ b/lib/libc/db/recno/rec_put.c @@ -143,7 +143,7 @@ einval: errno = EINVAL; if (flags == R_SETCURSOR) t->bt_rcursor = nrec; - + SET(t, R_MODIFIED); return (__rec_ret(t, NULL, nrec, key, NULL)); } diff --git a/lib/libc/db/recno/rec_search.c b/lib/libc/db/recno/rec_search.c index 5d5df3c7fefd..a1feff8a4173 100644 --- a/lib/libc/db/recno/rec_search.c +++ b/lib/libc/db/recno/rec_search.c @@ -93,7 +93,7 @@ __rec_search(t, recno, op) if (__bt_push(t, pg, index - 1) == RET_ERROR) return (NULL); - + pg = r->pgno; switch (op) { case SDELETE: diff --git a/lib/libc/db/recno/rec_seq.c b/lib/libc/db/recno/rec_seq.c index bc66d1c4987e..56f78e764c51 100644 --- a/lib/libc/db/recno/rec_seq.c +++ b/lib/libc/db/recno/rec_seq.c @@ -107,7 +107,7 @@ __rec_seq(dbp, key, data, flags) einval: errno = EINVAL; return (RET_ERROR); } - + if (t->bt_nrecs == 0 || nrec > t->bt_nrecs) { if (!ISSET(t, R_EOF | R_INMEM) && (status = t->bt_irec(t, nrec)) != RET_SUCCESS) diff --git a/lib/libc/db/test/btree.tests/main.c b/lib/libc/db/test/btree.tests/main.c index f26e193562b3..39c1da0519ce 100644 --- a/lib/libc/db/test/btree.tests/main.c +++ b/lib/libc/db/test/btree.tests/main.c @@ -629,7 +629,7 @@ load(db, argv) key.size = sizeof(recno_t); data.data = lp; data.size = len + 1; - } else { + } else { key.data = lp; key.size = len + 1; for (p = lp + len - 1, t = buf; p >= lp; *t++ = *p--); diff --git a/lib/libc/db/test/dbtest.c b/lib/libc/db/test/dbtest.c index b8f97dc1ba78..c526415a7a09 100644 --- a/lib/libc/db/test/dbtest.c +++ b/lib/libc/db/test/dbtest.c @@ -337,7 +337,7 @@ get(dbp, kp) /* NOTREACHED */ case 1: (void)write(ofd, NOSUCHKEY, sizeof(NOSUCHKEY) - 1); - (void)fprintf(stderr, "%d: %.*s: %s\n", + (void)fprintf(stderr, "%d: %.*s: %s\n", lineno, kp->size, kp->data, NOSUCHKEY); break; } @@ -443,7 +443,7 @@ dump(dbp, rev) } done: return; } - + u_int setflags(s) char *s; @@ -476,7 +476,7 @@ setflags(s) err("line %lu: %s: unknown flag", lineno, s); /* NOTREACHED */ } - + DBTYPE dbtype(s) char *s; @@ -506,7 +506,7 @@ setinfo(type, s) *eq++ = '\0'; if (!isdigit(*eq)) err("%s: structure set statement must be a number", s); - + switch(type) { case DB_BTREE: if (!strcmp("flags", s)) { diff --git a/lib/libc/db/test/hash.tests/driver2.c b/lib/libc/db/test/hash.tests/driver2.c index 2008a2899c3b..896820c7fcae 100644 --- a/lib/libc/db/test/hash.tests/driver2.c +++ b/lib/libc/db/test/hash.tests/driver2.c @@ -110,5 +110,5 @@ main(argc, argv) exit(0); } - + diff --git a/lib/libc/db/test/hash.tests/tcreat3.c b/lib/libc/db/test/hash.tests/tcreat3.c index bd125ac6ee7a..31211c537d19 100644 --- a/lib/libc/db/test/hash.tests/tcreat3.c +++ b/lib/libc/db/test/hash.tests/tcreat3.c @@ -97,7 +97,7 @@ char **argv; fprintf(stderr, "cannot enter: key %s\n", item.data); exit(1); - } + } } (dbp->close)(dbp); diff --git a/lib/libc/db/test/hash.tests/tdel.c b/lib/libc/db/test/hash.tests/tdel.c index ed3f90ad7f2e..fb994318c5ea 100644 --- a/lib/libc/db/test/hash.tests/tdel.c +++ b/lib/libc/db/test/hash.tests/tdel.c @@ -99,7 +99,7 @@ char **argv; fprintf(stderr, "cannot enter: key %s\n", item.data); exit(1); - } + } } if ( --argc ) { @@ -113,7 +113,7 @@ char **argv; if (stat) { fprintf ( stderr, "Error retrieving %s\n", key.data ); exit(1); - } + } } fclose(fp); } diff --git a/lib/libc/db/test/hash.tests/thash4.c b/lib/libc/db/test/hash.tests/thash4.c index 9e344cb83323..952dccbd5bbd 100644 --- a/lib/libc/db/test/hash.tests/thash4.c +++ b/lib/libc/db/test/hash.tests/thash4.c @@ -86,8 +86,8 @@ char **argv; key.data = wp1; item.data = wp2; - while ( fgets(wp1, 8192, stdin) && - fgets(wp2, 8192, stdin) && + while ( fgets(wp1, 8192, stdin) && + fgets(wp2, 8192, stdin) && i++ < MAXWORDS) { /* * put info in structure, and structure in the item @@ -103,14 +103,14 @@ char **argv; item.data); fprintf(stderr, "\terrno: %d\n", errno); exit(1); - } + } } if ( --argc ) { fp = fopen ( argv[0], "r"); i = 0; - while ( fgets(wp1, 256, fp) && - fgets(wp2, 8192, fp) && + while ( fgets(wp1, 256, fp) && + fgets(wp2, 8192, fp) && i++ < MAXWORDS) { key.size = strlen(wp1); diff --git a/lib/libc/db/test/hash.tests/tseq.c b/lib/libc/db/test/hash.tests/tseq.c index f45700e5c007..f41c172fa5b0 100644 --- a/lib/libc/db/test/hash.tests/tseq.c +++ b/lib/libc/db/test/hash.tests/tseq.c @@ -72,7 +72,7 @@ char **argv; /* * put info in structure, and structure in the item */ - for ( stat = (dbp->seq) (dbp, &res, &item, 1 ); + for ( stat = (dbp->seq) (dbp, &res, &item, 1 ); stat == 0; stat = (dbp->seq) (dbp, &res, &item, 0 ) ) { diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc index bad41ef998bf..69a434d85daa 100644 --- a/lib/libc/gen/Makefile.inc +++ b/lib/libc/gen/Makefile.inc @@ -1,5 +1,5 @@ # From: @(#)Makefile.inc 8.3 (Berkeley) 4/16/94 -# $Id: Makefile.inc,v 1.14 1994/11/13 20:47:41 phk Exp $ +# $Id: Makefile.inc,v 1.15 1994/12/18 14:06:38 guido Exp $ # machine-independent gen sources .PATH: ${.CURDIR}/${MACHINE}/gen ${.CURDIR}/gen @@ -56,7 +56,7 @@ MAN3+= gen/alarm.3 gen/clock.3 gen/confstr.3 gen/config_open.3 \ gen/uname.3 gen/unvis.3 gen/usleep.3 gen/utime.3 gen/valloc.3 gen/vis.3 MLINKS+=config_open.3 config_next.3 config_open.3 config_close.3 \ - config_open.3 config_skip.3 + config_open.3 config_skip.3 MLINKS+=crypt.3 encrypt.3 crypt.3 setkey.3 MLINKS+=directory.3 closedir.3 directory.3 dirfd.3 directory.3 opendir.3 \ directory.3 readdir.3 directory.3 rewinddir.3 directory.3 seekdir.3 \ diff --git a/lib/libc/gen/__xuname.c b/lib/libc/gen/__xuname.c index 1511c1f957fe..63f29566660b 100644 --- a/lib/libc/gen/__xuname.c +++ b/lib/libc/gen/__xuname.c @@ -34,7 +34,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char sccsid[] = "From: @(#)uname.c 8.1 (Berkeley) 1/4/94";*/ static const char rcsid[] = - "$Id$"; + "$Id: uname.c,v 1.2 1994/10/13 20:31:19 wollman Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -58,7 +58,7 @@ uname(name) len = sizeof(name->sysname); oerrno = errno; if (sysctl(mib, 2, &name->sysname, &len, NULL, 0) == -1) { - if(errno == ENOMEM) + if(errno == ENOMEM) errno = oerrno; else rval = -1; @@ -69,7 +69,7 @@ uname(name) len = sizeof(name->nodename); oerrno = errno; if (sysctl(mib, 2, &name->nodename, &len, NULL, 0) == -1) { - if(errno == ENOMEM) + if(errno == ENOMEM) errno = oerrno; else rval = -1; @@ -80,7 +80,7 @@ uname(name) len = sizeof(name->release); oerrno = errno; if (sysctl(mib, 2, &name->release, &len, NULL, 0) == -1) { - if(errno == ENOMEM) + if(errno == ENOMEM) errno = oerrno; else rval = -1; diff --git a/lib/libc/gen/config.c b/lib/libc/gen/config.c index 6ea292b78b13..ffe276697990 100644 --- a/lib/libc/gen/config.c +++ b/lib/libc/gen/config.c @@ -6,12 +6,12 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $Id$ + * $Id: config.c,v 1.1 1994/11/13 20:47:43 phk Exp $ * */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$Id: config.c,v 1.1 1994/01/14 12:24:39 jkh Exp $"; +static char rcsid[] = "$Id: config.c,v 1.1 1994/11/13 20:47:43 phk Exp $"; #endif /* LIBC_SCCS and not lint */ /* @@ -21,7 +21,7 @@ static char rcsid[] = "$Id: config.c,v 1.1 1994/01/14 12:24:39 jkh Exp $"; * Will open the named file, read it into a private malloc'ed area, * and close the file again. * All lines where the first !isspace() char is '#' are deleted. - * If contlines are non-zero lines where the first char is isspace() + * If contlines are non-zero lines where the first char is isspace() * will be joined to the preceeding line. * In case of trouble the name of the offending system call will be * returned. On success NULL is returned. @@ -93,8 +93,8 @@ config_open(const char *filename, int contlines) /* * /^[ \t]*#[^\n]*$/d - * - * Delete all lines where the first !isspace() char is '#' + * + * Delete all lines where the first !isspace() char is '#' */ ptr = file_buf; diff --git a/lib/libc/gen/crypt.c b/lib/libc/gen/crypt.c index 1aad9c6e2ae9..1ffb7366a760 100644 --- a/lib/libc/gen/crypt.c +++ b/lib/libc/gen/crypt.c @@ -36,7 +36,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /* from static char sccsid[] = "@(#)crypt.c 5.11 (Berkeley) 6/25/91"; */ -static char rcsid[] = "$Header: /a/cvs/386BSD/src/lib/libc/gen/crypt.c,v 1.6 1993/08/29 22:03:56 nate Exp $"; +static char rcsid[] = "$Header: /home/ncvs/src/lib/libc/gen/crypt.c,v 1.2 1994/08/22 20:38:00 csgr Exp $"; #endif /* LIBC_SCCS and not lint */ #include <unistd.h> @@ -44,7 +44,7 @@ static char rcsid[] = "$Header: /a/cvs/386BSD/src/lib/libc/gen/crypt.c,v 1.6 199 /* * UNIX password, and DES, encryption. - * + * * since this is non-exportable, this is just a dummy. if you want real * encryption, make sure you've got libcrypt.a around. */ diff --git a/lib/libc/gen/fnmatch.c b/lib/libc/gen/fnmatch.c index dc7f151194e3..0c2ca13d16d6 100644 --- a/lib/libc/gen/fnmatch.c +++ b/lib/libc/gen/fnmatch.c @@ -149,13 +149,13 @@ rangematch(pattern, test, flags) */ if (negate = (*pattern == '!' || *pattern == '^')) ++pattern; - + for (ok = 0; (c = *pattern++) != ']';) { if (c == '\\' && !(flags & FNM_NOESCAPE)) c = *pattern++; if (c == EOS) return (NULL); - if (*pattern == '-' + if (*pattern == '-' && (c2 = *(pattern+1)) != EOS && c2 != ']') { pattern += 2; if (c2 == '\\' && !(flags & FNM_NOESCAPE)) diff --git a/lib/libc/gen/fts-compat.c b/lib/libc/gen/fts-compat.c index 97a7048fa9d6..3915b008b953 100644 --- a/lib/libc/gen/fts-compat.c +++ b/lib/libc/gen/fts-compat.c @@ -313,7 +313,7 @@ fts_read(sp) } p->fts_info = FTS_DP; return (p); - } + } /* Rebuild if only read the names and now traversing. */ if (sp->fts_child && sp->fts_options & FTS_NAMEONLY) { @@ -508,7 +508,7 @@ fts_children(sp, instr) if (instr == FTS_NAMEONLY) { sp->fts_options |= FTS_NAMEONLY; instr = BNAMES; - } else + } else instr = BCHILD; /* @@ -680,7 +680,7 @@ mem1: saved_errno = errno; p->fts_accpath = cur->fts_accpath; } else if (nlinks == 0 #ifdef DT_DIR - || nlinks > 0 && + || nlinks > 0 && dp->d_type != DT_DIR && dp->d_type != DT_UNKNOWN #endif ) { @@ -774,7 +774,7 @@ fts_stat(sp, p, follow) /* If user needs stat info, stat buffer already allocated. */ sbp = ISSET(FTS_NOSTAT) ? &sb : p->fts_statp; - + /* * If doing a logical walk, or application requested FTS_FOLLOW, do * a stat(2). If that fails, check for a non-existent symlink. If @@ -786,7 +786,7 @@ fts_stat(sp, p, follow) if (!lstat(p->fts_accpath, sbp)) { errno = 0; return (FTS_SLNONE); - } + } p->fts_errno = saved_errno; goto err; } @@ -919,7 +919,7 @@ fts_lfree(head) * Allow essentially unlimited paths; find, rm, ls should all work on any tree. * Most systems will allow creation of paths much longer than MAXPATHLEN, even * though the kernel won't resolve them. Add the size (not just what's needed) - * plus 256 bytes so don't realloc the path 2 bytes at a time. + * plus 256 bytes so don't realloc the path 2 bytes at a time. */ static int fts_palloc(sp, more) diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c index 97a7048fa9d6..3915b008b953 100644 --- a/lib/libc/gen/fts.c +++ b/lib/libc/gen/fts.c @@ -313,7 +313,7 @@ fts_read(sp) } p->fts_info = FTS_DP; return (p); - } + } /* Rebuild if only read the names and now traversing. */ if (sp->fts_child && sp->fts_options & FTS_NAMEONLY) { @@ -508,7 +508,7 @@ fts_children(sp, instr) if (instr == FTS_NAMEONLY) { sp->fts_options |= FTS_NAMEONLY; instr = BNAMES; - } else + } else instr = BCHILD; /* @@ -680,7 +680,7 @@ mem1: saved_errno = errno; p->fts_accpath = cur->fts_accpath; } else if (nlinks == 0 #ifdef DT_DIR - || nlinks > 0 && + || nlinks > 0 && dp->d_type != DT_DIR && dp->d_type != DT_UNKNOWN #endif ) { @@ -774,7 +774,7 @@ fts_stat(sp, p, follow) /* If user needs stat info, stat buffer already allocated. */ sbp = ISSET(FTS_NOSTAT) ? &sb : p->fts_statp; - + /* * If doing a logical walk, or application requested FTS_FOLLOW, do * a stat(2). If that fails, check for a non-existent symlink. If @@ -786,7 +786,7 @@ fts_stat(sp, p, follow) if (!lstat(p->fts_accpath, sbp)) { errno = 0; return (FTS_SLNONE); - } + } p->fts_errno = saved_errno; goto err; } @@ -919,7 +919,7 @@ fts_lfree(head) * Allow essentially unlimited paths; find, rm, ls should all work on any tree. * Most systems will allow creation of paths much longer than MAXPATHLEN, even * though the kernel won't resolve them. Add the size (not just what's needed) - * plus 256 bytes so don't realloc the path 2 bytes at a time. + * plus 256 bytes so don't realloc the path 2 bytes at a time. */ static int fts_palloc(sp, more) diff --git a/lib/libc/gen/getcap.c b/lib/libc/gen/getcap.c index f883ec4efbb8..6bb44506ecbb 100644 --- a/lib/libc/gen/getcap.c +++ b/lib/libc/gen/getcap.c @@ -42,7 +42,7 @@ static char sccsid[] = "@(#)getcap.c 8.3 (Berkeley) 3/25/94"; #include <ctype.h> #include <db.h> -#include <errno.h> +#include <errno.h> #include <fcntl.h> #include <limits.h> #include <stdio.h> @@ -198,7 +198,7 @@ getent(cap, len, db_array, fd, name, depth, nfield) char *record, *cbuf; int tc_not_resolved; char pbuf[_POSIX_PATH_MAX]; - + /* * Return with ``loop detected'' error if we've recursed more than * MAX_RECURSION times. @@ -306,7 +306,7 @@ getent(cap, len, db_array, fd, name, depth, nfield) for (;;) { if (bp >= b_end) { int n; - + n = read(fd, buf, sizeof(buf)); if (n <= 0) { if (myfd) @@ -323,7 +323,7 @@ getent(cap, len, db_array, fd, name, depth, nfield) b_end = buf+n; bp = buf; } - + c = *bp++; if (c == '\n') { if (rp > record && *(rp-1) == '\\') { @@ -335,7 +335,7 @@ getent(cap, len, db_array, fd, name, depth, nfield) *rp++ = c; /* - * Enforce loop invariant: if no room + * Enforce loop invariant: if no room * left in record buffer, try to get * some more. */ @@ -364,13 +364,13 @@ getent(cap, len, db_array, fd, name, depth, nfield) */ if (eof) break; - + /* * Toss blank lines and comments. */ if (*record == '\0' || *record == '#') continue; - + /* * See if this is the record we want ... */ @@ -431,7 +431,7 @@ tc_exp: { tclen = s - tcstart; tcend = s; - iret = getent(&icap, &ilen, db_p, fd, tc, depth+1, + iret = getent(&icap, &ilen, db_p, fd, tc, depth+1, NULL); newicap = icap; /* Put into a register. */ newilen = ilen; @@ -447,11 +447,11 @@ tc_exp: { tc_not_resolved = 1; /* couldn't resolve tc */ if (iret == -1) { - *(s - 1) = ':'; + *(s - 1) = ':'; scan = s - 1; tc_not_resolved = 1; continue; - + } } /* not interested in name field of tc'ed record */ @@ -514,7 +514,7 @@ tc_exp: { */ scan = s-1; } - + } /* * Close file (if we opened it), give back any extra memory, and @@ -524,17 +524,17 @@ tc_exp: { (void)close(fd); *len = rp - record - 1; /* don't count NUL */ if (r_end > rp) - if ((record = + if ((record = realloc(record, (size_t)(rp - record))) == NULL) { errno = ENOMEM; return (-2); } - + *cap = record; if (tc_not_resolved) return (1); return (0); -} +} static int cdbget(capdbp, bp, name) @@ -564,7 +564,7 @@ cdbget(capdbp, bp, name) key.data = (char *)data.data + 1; key.size = data.size - 1; } - + *bp = (char *)data.data + 1; return (((char *)(data.data))[0] == TCERR ? 1 : 0); } @@ -641,7 +641,7 @@ cgetclose() } /* - * Cgetnext() gets either the first or next entry in the logical database + * Cgetnext() gets either the first or next entry in the logical database * specified by db_array. It returns 0 upon completion of the database, 1 * upon returning an entry with more remaining, and -1 if an error occurs. */ @@ -702,10 +702,10 @@ cgetnext(bp, db_array) slash = 1; else slash = 0; - } + } - /* + /* * Line points to a name line. */ i = 0; @@ -745,12 +745,12 @@ cgetnext(bp, db_array) *rp++ = *cp; *rp = '\0'; - /* - * XXX + /* + * XXX * Last argument of getent here should be nbuf if we want true - * sequential access in the case of duplicates. + * sequential access in the case of duplicates. * With NULL, getent will return the first entry found - * rather than the duplicate entry record. This is a + * rather than the duplicate entry record. This is a * matter of semantics that should be resolved. */ status = getent(bp, &dummy, db_array, -1, buf, 0, NULL); @@ -894,10 +894,10 @@ cgetstr(buf, cap, str) * Cgetustr retrieves the value of the string capability cap from the * capability record pointed to by buf. The difference between cgetustr() * and cgetstr() is that cgetustr does not decode escapes but rather treats - * all characters literally. A pointer to a NUL terminated malloc'd - * copy of the string is returned in the char pointed to by str. The + * all characters literally. A pointer to a NUL terminated malloc'd + * copy of the string is returned in the char pointed to by str. The * length of the string not including the trailing NUL is returned on success, - * -1 if the requested string capability couldn't be found, -2 if a system + * -1 if the requested string capability couldn't be found, -2 if a system * error was encountered (storage allocation failure). */ int @@ -1039,10 +1039,10 @@ nfcmp(nf, rec) { char *cp, tmp; int ret; - + for (cp = rec; *cp != ':'; cp++) ; - + tmp = *(cp + 1); *(cp + 1) = '\0'; ret = strcmp(nf, rec); diff --git a/lib/libc/gen/getgrent.c b/lib/libc/gen/getgrent.c index a13e7c30a9a7..e9b9d1fccd20 100644 --- a/lib/libc/gen/getgrent.c +++ b/lib/libc/gen/getgrent.c @@ -338,7 +338,7 @@ _getypgroup(struct group *gr, const char *name, char *map) return 0; } - if(yp_match(_gr_yp_domain, map, name, strlen(name), + if(yp_match(_gr_yp_domain, map, name, strlen(name), &result, &resultlen)) return 0; @@ -402,5 +402,5 @@ unpack: } return 1; } - + #endif /* YP */ diff --git a/lib/libc/gen/getnetgrent.c b/lib/libc/gen/getnetgrent.c index c60cc4e7f179..1ad838e86bdc 100644 --- a/lib/libc/gen/getnetgrent.c +++ b/lib/libc/gen/getnetgrent.c @@ -192,7 +192,7 @@ innetgr(group, host, user, dom) char *hst, *usr, *dm; /* Sanity check */ - + if (group == NULL || !strlen(group)) return (0); diff --git a/lib/libc/gen/getpwent.c b/lib/libc/gen/getpwent.c index 46482b465fa2..22b148559d02 100644 --- a/lib/libc/gen/getpwent.c +++ b/lib/libc/gen/getpwent.c @@ -355,7 +355,7 @@ _createcaches() n->next = namehead; namehead = n; } - /* + /* * If netgroup 'foo' doesn't exist, * try group 'foo' instead. */ @@ -419,7 +419,7 @@ _createcaches() n->next = namehead; namehead = n; } - /* + /* * If netgroup 'foo' doesn't exist, * try group 'foo' instead. */ @@ -599,7 +599,7 @@ _getyppass(struct passwd *pw, const char *name, const char *map) gotmaster++; } - if(yp_match(_pw_yp_domain, (char *)&mastermap, name, strlen(name), + if(yp_match(_pw_yp_domain, (char *)&mastermap, name, strlen(name), &result, &resultlen)) return 0; @@ -739,5 +739,5 @@ unpack: } return 1; } - + #endif /* YP */ diff --git a/lib/libc/gen/getusershell.c b/lib/libc/gen/getusershell.c index 2bcdaf78bd97..408f9f3664d1 100644 --- a/lib/libc/gen/getusershell.c +++ b/lib/libc/gen/getusershell.c @@ -72,7 +72,7 @@ getusershell() void endusershell() { - + if (shells != NULL) free(shells); shells = NULL; diff --git a/lib/libc/gen/getvfsent.c b/lib/libc/gen/getvfsent.c index 79f9dd4445da..63fb1daf8ffa 100644 --- a/lib/libc/gen/getvfsent.c +++ b/lib/libc/gen/getvfsent.c @@ -83,7 +83,7 @@ getvfsbyname(const char *name) } for(i = 0; i < _vfslistlen; i++) { - if( ! strcmp(_vfslist[i].vfc_name, name) ) + if( ! strcmp(_vfslist[i].vfc_name, name) ) break; } @@ -113,7 +113,7 @@ getvfsbytype(int type) } for(i = 0; i < _vfslistlen; i++) { - if(_vfslist[i].vfc_index == type) + if(_vfslist[i].vfc_index == type) break; } diff --git a/lib/libc/gen/glob.c b/lib/libc/gen/glob.c index 8c8e1629d64c..2105f2a79137 100644 --- a/lib/libc/gen/glob.c +++ b/lib/libc/gen/glob.c @@ -58,7 +58,7 @@ static char sccsid[] = "@(#)glob.c 8.3 (Berkeley) 10/13/93"; * GLOB_TILDE: * expand ~user/foo to the /home/dir/of/user/foo * GLOB_BRACE: - * expand {1,2}{a,b} to 1a 1b 2a 2b + * expand {1,2}{a,b} to 1a 1b 2a 2b * gl_matchc: * Number of matches in the current invocation of glob. */ @@ -173,7 +173,7 @@ glob(pattern, flags, errfunc, pglob) bufend = bufnext + MAXPATHLEN; if (flags & GLOB_QUOTE) { /* Protect the quoted characters. */ - while (bufnext < bufend && (c = *patnext++) != EOS) + while (bufnext < bufend && (c = *patnext++) != EOS) if (c == QUOTE) { if ((c = *patnext++) == EOS) { c = QUOTE; @@ -184,8 +184,8 @@ glob(pattern, flags, errfunc, pglob) else *bufnext++ = c; } - else - while (bufnext < bufend && (c = *patnext++) != EOS) + else + while (bufnext < bufend && (c = *patnext++) != EOS) *bufnext++ = c; *bufnext = EOS; @@ -246,7 +246,7 @@ static int globexp2(ptr, pattern, pglob, rv) for (pm = pe++; *pe != RBRACKET && *pe != EOS; pe++) continue; if (*pe == EOS) { - /* + /* * We could not find a matching RBRACKET. * Ignore and just look for RBRACE */ @@ -274,7 +274,7 @@ static int globexp2(ptr, pattern, pglob, rv) for (pl = pm++; *pm != RBRACKET && *pm != EOS; pm++) continue; if (*pm == EOS) { - /* + /* * We could not find a matching RBRACKET. * Ignore and just look for RBRACE */ @@ -299,7 +299,7 @@ static int globexp2(ptr, pattern, pglob, rv) /* Append the current string */ for (lm = ls; (pl < pm); *lm++ = *pl++) continue; - /* + /* * Append the rest of the pattern after the * closing brace */ @@ -344,15 +344,15 @@ globtilde(pattern, patbuf, pglob) return pattern; /* Copy up to the end of the string or / */ - for (p = pattern + 1, h = (char *) patbuf; *p && *p != SLASH; + for (p = pattern + 1, h = (char *) patbuf; *p && *p != SLASH; *h++ = *p++) continue; *h = EOS; if (((char *) patbuf)[0] == EOS) { - /* - * handle a plain ~ or ~/ by expanding $HOME + /* + * handle a plain ~ or ~/ by expanding $HOME * first and then trying the password file */ if ((h = getenv("HOME")) == NULL) { @@ -375,14 +375,14 @@ globtilde(pattern, patbuf, pglob) /* Copy the home directory */ for (b = patbuf; *h; *b++ = *h++) continue; - + /* Append the rest of the pattern */ while ((*b++ = *p++) != EOS) continue; return patbuf; } - + /* * The main glob() routine: compiles the pattern (optionally processing @@ -440,7 +440,7 @@ glob0(pattern, pglob) break; case STAR: pglob->gl_flags |= GLOB_MAGCHAR; - /* collapse adjacent stars to one, + /* collapse adjacent stars to one, * to avoid exponential behavior */ if (bufnext == patbuf || bufnext[-1] != M_ALL) @@ -460,17 +460,17 @@ glob0(pattern, pglob) return(err); /* - * If there was no match we are going to append the pattern + * If there was no match we are going to append the pattern * if GLOB_NOCHECK was specified or if GLOB_NOMAGIC was specified * and the pattern did not contain any magic characters * GLOB_NOMAGIC is there just for compatibility with csh. */ - if (pglob->gl_pathc == oldpathc && - ((pglob->gl_flags & GLOB_NOCHECK) || + if (pglob->gl_pathc == oldpathc && + ((pglob->gl_flags & GLOB_NOCHECK) || ((pglob->gl_flags & GLOB_NOMAGIC) && !(pglob->gl_flags & GLOB_MAGCHAR)))) return(globextend(pattern, pglob)); - else if (!(pglob->gl_flags & GLOB_NOSORT)) + else if (!(pglob->gl_flags & GLOB_NOSORT)) qsort(pglob->gl_pathv + pglob->gl_offs + oldpathc, pglob->gl_pathc - oldpathc, sizeof(char *), compare); return(0); @@ -519,7 +519,7 @@ glob2(pathbuf, pathend, pattern, pglob) *pathend = EOS; if (g_lstat(pathbuf, &sb, pglob)) return(0); - + if (((pglob->gl_flags & GLOB_MARK) && pathend[-1] != SEP) && (S_ISDIR(sb.st_mode) || (S_ISLNK(sb.st_mode) && @@ -572,7 +572,7 @@ glob3(pathbuf, pathend, pattern, restpattern, pglob) *pathend = EOS; errno = 0; - + if ((dirp = g_opendir(pathbuf, pglob)) == NULL) { /* TODO: don't call for ENOENT or ENOTDIR? */ if (pglob->gl_errfunc) { @@ -598,7 +598,7 @@ glob3(pathbuf, pathend, pattern, restpattern, pglob) /* Initial DOT must be matched literally. */ if (dp->d_name[0] == DOT && *pattern != DOT) continue; - for (sc = (u_char *) dp->d_name, dc = pathend; + for (sc = (u_char *) dp->d_name, dc = pathend; (*dc++ = *sc++) != EOS;) continue; if (!match(pathend, pattern, restpattern)) { @@ -644,7 +644,7 @@ globextend(path, pglob) const Char *p; newsize = sizeof(*pathv) * (2 + pglob->gl_pathc + pglob->gl_offs); - pathv = pglob->gl_pathv ? + pathv = pglob->gl_pathv ? realloc((char *)pglob->gl_pathv, newsize) : malloc(newsize); if (pathv == NULL) @@ -686,7 +686,7 @@ match(name, pat, patend) case M_ALL: if (pat == patend) return(1); - do + do if (match(name, pat, patend)) return(1); while (*name++ != EOS); @@ -825,7 +825,7 @@ g_Ctoc(str, buf) } #ifdef DEBUG -static void +static void qprintf(str, s) const char *str; register Char *s; diff --git a/lib/libc/gen/nlist.c b/lib/libc/gen/nlist.c index 5dc3de1f2e1a..9993dcabc053 100644 --- a/lib/libc/gen/nlist.c +++ b/lib/libc/gen/nlist.c @@ -95,8 +95,8 @@ __fdnlist(fd, list) * does not start at a page boundary - we save ourselves a * lot of nastiness by mmapping the whole file. * - * This gives us an easy way to randomly access all the strings, - * without making the memory allocation permanent as with + * This gives us an easy way to randomly access all the strings, + * without making the memory allocation permanent as with * malloc/free (i.e., munmap will return it to the system). */ a_out_mmap = mmap(NULL, (size_t)st.st_size, PROT_READ, 0, fd, (off_t)0); diff --git a/lib/libc/gen/popen.c b/lib/libc/gen/popen.c index 89aba1638ed9..4affdf4ae0a4 100644 --- a/lib/libc/gen/popen.c +++ b/lib/libc/gen/popen.c @@ -53,8 +53,8 @@ static struct pid { struct pid *next; FILE *fp; pid_t pid; -} *pidlist; - +} *pidlist; + FILE * popen(program, type) const char *program; @@ -155,6 +155,6 @@ pclose(iop) else last->next = cur->next; free(cur); - + return (pid == -1 ? -1 : pstat.w_status); } diff --git a/lib/libc/gen/scandir.c b/lib/libc/gen/scandir.c index 395df8d3d52b..e6e840802703 100644 --- a/lib/libc/gen/scandir.c +++ b/lib/libc/gen/scandir.c @@ -79,7 +79,7 @@ scandir(dirname, namelist, select, dcomp) /* * estimate the array size by taking the size of the directory file - * and dividing it by a multiple of the minimum size entry. + * and dividing it by a multiple of the minimum size entry. */ arraysz = (stb.st_size / 24); names = (struct dirent **)malloc(arraysz * sizeof(struct dirent *)); diff --git a/lib/libc/gen/setmode.c b/lib/libc/gen/setmode.c index 84cadcbd0891..2190b4e07d3c 100644 --- a/lib/libc/gen/setmode.c +++ b/lib/libc/gen/setmode.c @@ -190,7 +190,7 @@ setmode(p) (void)sigprocmask(SIG_SETMASK, &sigoset, NULL); setlen = SET_LEN + 2; - + if ((set = malloc((u_int)(sizeof(BITCMD) * setlen))) == NULL) return (NULL); saveset = set; @@ -368,7 +368,7 @@ addcmd(set, op, who, oparg, mask) set->cmd2 = CMD2_UBITS | CMD2_GBITS | CMD2_OBITS; set->bits = mask; } - + if (oparg == '+') set->cmd2 |= CMD2_SET; else if (oparg == '-') @@ -399,7 +399,7 @@ dumpmode(set) /* * Given an array of bitcmd structures, compress by compacting consecutive * '+', '-' and 'X' commands into at most 3 commands, one of each. The 'u', - * 'g' and 'o' commands continue to be separate. They could probably be + * 'g' and 'o' commands continue to be separate. They could probably be * compacted, but it's not worth the effort. */ static int diff --git a/lib/libc/gen/sysconf.c b/lib/libc/gen/sysconf.c index 83f21a3e00e0..2994505e942c 100644 --- a/lib/libc/gen/sysconf.c +++ b/lib/libc/gen/sysconf.c @@ -184,5 +184,5 @@ yesno: if (sysctl(mib, 2, &value, &len, NULL, 0) == -1) errno = EINVAL; return (-1); } - return (sysctl(mib, 2, &value, &len, NULL, 0) == -1 ? -1 : value); + return (sysctl(mib, 2, &value, &len, NULL, 0) == -1 ? -1 : value); } diff --git a/lib/libc/gen/telldir.c b/lib/libc/gen/telldir.c index eeba2956aadb..ab23d9db7a20 100644 --- a/lib/libc/gen/telldir.c +++ b/lib/libc/gen/telldir.c @@ -49,7 +49,7 @@ static char sccsid[] = "@(#)telldir.c 8.1 (Berkeley) 6/4/93"; /* * One of these structures is malloced to describe the current directory - * position each time telldir is called. It records the current magic + * position each time telldir is called. It records the current magic * cookie returned by getdirentries and the offset within the buffer * associated with that return value. */ diff --git a/lib/libc/gen/ttyslot.c b/lib/libc/gen/ttyslot.c index 3d9fee62fc4f..066f2f9f855b 100644 --- a/lib/libc/gen/ttyslot.c +++ b/lib/libc/gen/ttyslot.c @@ -50,9 +50,9 @@ ttyslot() char *name; setttyent(); - for (cnt = 0; cnt < 3; ++cnt) + for (cnt = 0; cnt < 3; ++cnt) if (name = ttyname(cnt)) { - if (p = rindex(name, '/')) + if (p = rindex(name, '/')) ++p; else p = name; diff --git a/lib/libc/gen/ualarm.c b/lib/libc/gen/ualarm.c index e9e051d5e19f..ec49a2d75d3e 100644 --- a/lib/libc/gen/ualarm.c +++ b/lib/libc/gen/ualarm.c @@ -54,7 +54,7 @@ ualarm(usecs, reload) new.it_interval.tv_usec = reload % USPS; new.it_interval.tv_sec = reload / USPS; - + new.it_value.tv_usec = usecs % USPS; new.it_value.tv_sec = usecs / USPS; diff --git a/lib/libc/gen/uname.c b/lib/libc/gen/uname.c index 1511c1f957fe..63f29566660b 100644 --- a/lib/libc/gen/uname.c +++ b/lib/libc/gen/uname.c @@ -34,7 +34,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char sccsid[] = "From: @(#)uname.c 8.1 (Berkeley) 1/4/94";*/ static const char rcsid[] = - "$Id$"; + "$Id: uname.c,v 1.2 1994/10/13 20:31:19 wollman Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -58,7 +58,7 @@ uname(name) len = sizeof(name->sysname); oerrno = errno; if (sysctl(mib, 2, &name->sysname, &len, NULL, 0) == -1) { - if(errno == ENOMEM) + if(errno == ENOMEM) errno = oerrno; else rval = -1; @@ -69,7 +69,7 @@ uname(name) len = sizeof(name->nodename); oerrno = errno; if (sysctl(mib, 2, &name->nodename, &len, NULL, 0) == -1) { - if(errno == ENOMEM) + if(errno == ENOMEM) errno = oerrno; else rval = -1; @@ -80,7 +80,7 @@ uname(name) len = sizeof(name->release); oerrno = errno; if (sysctl(mib, 2, &name->release, &len, NULL, 0) == -1) { - if(errno == ENOMEM) + if(errno == ENOMEM) errno = oerrno; else rval = -1; diff --git a/lib/libc/gen/unvis.c b/lib/libc/gen/unvis.c index 6126d6ad66df..547048336c4d 100644 --- a/lib/libc/gen/unvis.c +++ b/lib/libc/gen/unvis.c @@ -65,7 +65,7 @@ unvis(cp, c, astate, flag) if (*astate == S_OCTAL2 || *astate == S_OCTAL3) { *astate = S_GROUND; return (UNVIS_VALID); - } + } return (*astate == S_GROUND ? UNVIS_NOCHAR : UNVIS_SYNBAD); } @@ -76,7 +76,7 @@ unvis(cp, c, astate, flag) if (c == '\\') { *astate = S_START; return (0); - } + } *cp = c; return (UNVIS_VALID); @@ -149,7 +149,7 @@ unvis(cp, c, astate, flag) } *astate = S_GROUND; return (UNVIS_SYNBAD); - + case S_META: if (c == '-') *astate = S_META1; @@ -160,12 +160,12 @@ unvis(cp, c, astate, flag) return (UNVIS_SYNBAD); } return (0); - + case S_META1: *astate = S_GROUND; *cp |= c; return (UNVIS_VALID); - + case S_CTRL: if (c == '?') *cp |= 0177; @@ -176,15 +176,15 @@ unvis(cp, c, astate, flag) case S_OCTAL2: /* second possible octal digit */ if (isoctal(c)) { - /* - * yes - and maybe a third + /* + * yes - and maybe a third */ *cp = (*cp << 3) + (c - '0'); - *astate = S_OCTAL3; + *astate = S_OCTAL3; return (0); - } - /* - * no - done with current sequence, push back passed char + } + /* + * no - done with current sequence, push back passed char */ *astate = S_GROUND; return (UNVIS_VALIDPUSH); @@ -199,10 +199,10 @@ unvis(cp, c, astate, flag) * we were done, push back passed char */ return (UNVIS_VALIDPUSH); - - default: - /* - * decoder in unknown state - (probably uninitialized) + + default: + /* + * decoder in unknown state - (probably uninitialized) */ *astate = S_GROUND; return (UNVIS_SYNBAD); @@ -210,7 +210,7 @@ unvis(cp, c, astate, flag) } /* - * strunvis - decode src into dst + * strunvis - decode src into dst * * Number of chars decoded into dst is returned, -1 on error. * Dst is null terminated. diff --git a/lib/libc/gen/vis.c b/lib/libc/gen/vis.c index 2232149122eb..e12226a593f6 100644 --- a/lib/libc/gen/vis.c +++ b/lib/libc/gen/vis.c @@ -111,7 +111,7 @@ vis(dst, c, flag, nextc) goto done; } } - if (((c & 0177) == ' ') || (flag & VIS_OCTAL)) { + if (((c & 0177) == ' ') || (flag & VIS_OCTAL)) { *dst++ = '\\'; *dst++ = ((u_char)c >> 6 & 07) + '0'; *dst++ = ((u_char)c >> 3 & 07) + '0'; @@ -141,10 +141,10 @@ done: /* * strvis, strvisx - visually encode characters from src into dst - * + * * Dst must be 4 times the size of src to account for possible * expansion. The length of dst, not including the trailing NULL, - * is returned. + * is returned. * * Strvisx encodes exactly len bytes from src into dst. * This is useful for encoding a block of data. diff --git a/lib/libc/gmon/gmon.c b/lib/libc/gmon/gmon.c index 022ffb564122..572b7eb97e1c 100644 --- a/lib/libc/gmon/gmon.c +++ b/lib/libc/gmon/gmon.c @@ -106,7 +106,7 @@ monstartup(lowpc, highpc) s_scale = ((float)p->kcountsize / o ) * SCALE_1_TO_1; #else /* avoid floating point */ int quot = o / p->kcountsize; - + if (quot >= 0x10000) s_scale = 1; else if (quot >= 0x100) @@ -239,7 +239,7 @@ static int hertz() { struct itimerval tim; - + tim.it_interval.tv_sec = 0; tim.it_interval.tv_usec = 1; tim.it_value.tv_sec = 0; diff --git a/lib/libc/gmon/mcount.c b/lib/libc/gmon/mcount.c index 13e4df99e8a6..63fbf886a151 100644 --- a/lib/libc/gmon/mcount.c +++ b/lib/libc/gmon/mcount.c @@ -51,7 +51,7 @@ static char sccsid[] = "@(#)mcount.c 8.1 (Berkeley) 6/4/93"; * _mcount updates data structures that represent traversals of the * program's call graph edges. frompc and selfpc are the return * address and function address that represents the given call graph edge. - * + * * Note: the original BSD code used the same variable (frompcindex) for * both frompcindex and frompc. Any reasonable, modern compiler will * perform this optimization. @@ -158,7 +158,7 @@ _MCOUNT_DECL(frompc, selfpc) /* _mcount; may be static, inline, etc */ *frompcindex = toindex; goto done; } - + } done: #ifdef KERNEL diff --git a/lib/libc/i386/sys/i386_get_ldt.c b/lib/libc/i386/sys/i386_get_ldt.c index db9757cf699d..8c4e5d221a06 100644 --- a/lib/libc/i386/sys/i386_get_ldt.c +++ b/lib/libc/i386/sys/i386_get_ldt.c @@ -1,7 +1,7 @@ /* * Copyright (c) 1993 John Brezak * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -12,7 +12,7 @@ * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -24,12 +24,12 @@ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. - * - * $Id$ + * + * $Id: i386_get_ldt.c,v 1.2 1995/01/23 01:29:50 davidg Exp $ */ #if defined(LIBC_RCS) && !defined(lint) -static const char rcsid[] = "$Id$"; +static const char rcsid[] = "$Id: i386_get_ldt.c,v 1.2 1995/01/23 01:29:50 davidg Exp $"; #endif /* LIBC_RCS and not lint */ #include <sys/cdefs.h> @@ -50,6 +50,6 @@ i386_get_ldt(int start, union descriptor *descs, int num) p.start = start; p.descs = descs; p.num = num; - + return sysarch(I386_GET_LDT, (char *)&p); } diff --git a/lib/libc/i386/sys/i386_set_ldt.c b/lib/libc/i386/sys/i386_set_ldt.c index 1d24956a1a6f..8754fd12344e 100644 --- a/lib/libc/i386/sys/i386_set_ldt.c +++ b/lib/libc/i386/sys/i386_set_ldt.c @@ -1,7 +1,7 @@ /* * Copyright (c) 1993 John Brezak * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -12,7 +12,7 @@ * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -24,12 +24,12 @@ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. - * - * $Id$ + * + * $Id: i386_set_ldt.c,v 1.2 1995/01/23 01:29:53 davidg Exp $ */ #if defined(LIBC_RCS) && !defined(lint) -static const char rcsid[] = "$Id$"; +static const char rcsid[] = "$Id: i386_set_ldt.c,v 1.2 1995/01/23 01:29:53 davidg Exp $"; #endif /* LIBC_RCS and not lint */ #include <sys/cdefs.h> @@ -50,6 +50,6 @@ i386_set_ldt(int start, union descriptor *descs, int num) p.start = start; p.descs = descs; p.num = num; - + return sysarch(I386_SET_LDT, (char *)&p); } diff --git a/lib/libc/locale/collate.c b/lib/libc/locale/collate.c index bcc6804986d9..bdcf6a486440 100644 --- a/lib/libc/locale/collate.c +++ b/lib/libc/locale/collate.c @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: collate.c,v 1.2 1995/02/17 16:36:12 ache Exp $ + * $Id: collate.c,v 1.3 1995/02/18 01:42:02 ache Exp $ */ #include <rune.h> @@ -50,7 +50,7 @@ struct __collate_st_chain_pri __collate_chain_pri_table[TABLE_SIZE]; return -1; \ } \ } while(0) - + __dead void __collate_err(int ex, const char *f) __dead2; int diff --git a/lib/libc/locale/read_runemagi.c b/lib/libc/locale/read_runemagi.c index 83b65f791556..9bd1808543a4 100644 --- a/lib/libc/locale/read_runemagi.c +++ b/lib/libc/locale/read_runemagi.c @@ -128,7 +128,7 @@ _Read_RuneMagi(fp) if (!rl->mapupper_ext.nranges) rl->mapupper_ext.ranges = 0; - + return(rl); } diff --git a/lib/libc/net/gethostbydns.c b/lib/libc/net/gethostbydns.c index 110e4172f34b..6db04f932dde 100644 --- a/lib/libc/net/gethostbydns.c +++ b/lib/libc/net/gethostbydns.c @@ -31,14 +31,14 @@ * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -53,7 +53,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93"; -static char rcsid[] = "$Id: gethostbydns.c,v 1.2 1994/09/25 17:45:37 pst Exp $"; +static char rcsid[] = "$Id: gethostbydns.c,v 1.3 1994/12/01 22:25:38 wollman Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -123,7 +123,7 @@ addrsort(ap, num) p = ap; for (i = 0; i < num; i++, p++) { for (j = 0 ; j < _res.nsort; j++) - if (_res.sort_list[j].addr.s_addr == + if (_res.sort_list[j].addr.s_addr == (((struct in_addr *)(*p))->s_addr & _res.sort_list[j].mask)) break; aval[i] = j; @@ -410,7 +410,7 @@ _gethostbydnsname(name) host.h_addr_list = h_addr_ptrs; return (&host); } - if (!isdigit(*cp) && *cp != '.') + if (!isdigit(*cp) && *cp != '.') break; } @@ -432,7 +432,7 @@ _gethostbydnsaddr(addr, len, type) register struct hostent *hp; char qbuf[MAXDNAME+1]; int o_res_options = _res.options; - + if (type != AF_INET) return (NULL); (void)sprintf(qbuf, "%u.%u.%u.%u.in-addr.arpa", diff --git a/lib/libc/net/gethostbyht.c b/lib/libc/net/gethostbyht.c index 78e0c305c099..4b616cd65cde 100644 --- a/lib/libc/net/gethostbyht.c +++ b/lib/libc/net/gethostbyht.c @@ -31,14 +31,14 @@ * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -53,7 +53,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93"; -static char rcsid[] = "$Id: gethostnamadr.c,v 1.1 1994/05/27 04:57:16 rgrimes Exp $"; +static char rcsid[] = "$Id: gethostbyht.c,v 1.1 1994/09/25 02:12:11 pst Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -129,7 +129,7 @@ again: host.h_name = cp; q = host.h_aliases = host_aliases; cp = strpbrk(cp, " \t"); - if (cp != NULL) + if (cp != NULL) *cp++ = '\0'; while (cp && *cp) { if (*cp == ' ' || *cp == '\t') { @@ -152,7 +152,7 @@ _gethostbyhtname(name) { register struct hostent *p; register char **cp; - + sethostent(0); while ((p = gethostent())) { if (strcasecmp(p->h_name, name) == 0) diff --git a/lib/libc/net/gethostnamadr.c b/lib/libc/net/gethostnamadr.c index 04a443d6b610..54f78d01fa82 100644 --- a/lib/libc/net/gethostnamadr.c +++ b/lib/libc/net/gethostnamadr.c @@ -24,8 +24,8 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)$Id: gethostnamadr.c,v 1.5 1994/09/25 02:12:18 pst Exp $"; -static char rcsid[] = "$Id: gethostnamadr.c,v 1.5 1994/09/25 02:12:18 pst Exp $"; +static char sccsid[] = "@(#)$Id: gethostnamadr.c,v 1.6 1995/03/24 15:38:54 ache Exp $"; +static char rcsid[] = "$Id: gethostnamadr.c,v 1.6 1995/03/24 15:38:54 ache Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -47,7 +47,7 @@ extern struct hostent * _gethostbynisaddr __P((const char *, int, int)); #define _PATH_HOSTCONF "/etc/host.conf" -enum service_type { +enum service_type { SERVICE_NONE = 0, SERVICE_BIND, SERVICE_HOSTS, diff --git a/lib/libc/net/getnetbydns.c b/lib/libc/net/getnetbydns.c index fbfb3c7371e8..f0a224fd5b0c 100644 --- a/lib/libc/net/getnetbydns.c +++ b/lib/libc/net/getnetbydns.c @@ -31,14 +31,14 @@ * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -53,7 +53,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93"; -static char rcsid[] = "$Id: getnetbydns.c,v 1.1 1994/09/25 02:12:20 pst Exp $"; +static char rcsid[] = "$Id: getnetbydns.c,v 1.2 1994/09/25 17:45:38 pst Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -168,7 +168,7 @@ static char *net_aliases[MAXALIASES], cp += n; return (NULL); } - cp += n; + cp += n; *ap++ = bp; bp += (strlen(bp) + 1); net_entry.n_addrtype = (class == C_IN) @@ -204,7 +204,7 @@ static char *net_aliases[MAXALIASES], paux1 = pauxt; } in = ++st; - } + } net_entry.n_net = inet_network(paux2); } net_entry.n_aliases++; @@ -277,7 +277,7 @@ _getnetbydnsname(net) int anslen; querybuf buf; char qbuf[MAXDNAME]; - + (void)strcpy(&qbuf[0],net); anslen = res_search(qbuf, C_IN, T_PTR, buf.buf, sizeof buf.buf); if (anslen < 0) { diff --git a/lib/libc/net/getnetbyht.c b/lib/libc/net/getnetbyht.c index cdb5e4933b76..4f6439cc77df 100644 --- a/lib/libc/net/getnetbyht.c +++ b/lib/libc/net/getnetbyht.c @@ -103,7 +103,7 @@ again: net.n_net = inet_network(cp); net.n_addrtype = AF_INET; q = net.n_aliases = net_aliases; - if (p != NULL) + if (p != NULL) cp = p; while (cp && *cp) { if (*cp == ' ' || *cp == '\t') { diff --git a/lib/libc/net/getnetbynis.c b/lib/libc/net/getnetbynis.c index 33afdde4d0db..21f17b9cda15 100644 --- a/lib/libc/net/getnetbynis.c +++ b/lib/libc/net/getnetbynis.c @@ -24,8 +24,8 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)$Id: getnetbynis.c,v 1.1 1994/09/25 02:12:26 pst Exp $"; -static char rcsid[] = "$Id: getnetbynis.c,v 1.1 1994/09/25 02:12:26 pst Exp $"; +static char sccsid[] = "@(#)$Id: getnetbynis.c,v 1.2 1994/09/26 02:50:43 wollman Exp $"; +static char rcsid[] = "$Id: getnetbynis.c,v 1.2 1994/09/26 02:50:43 wollman Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -122,13 +122,13 @@ _getnetbynisaddr(addr, type) if (type != AF_INET) return (NULL); - in.s_addr = addr; + in.s_addr = addr; str = inet_ntoa(in); cp = str + strlen(str) - 2; while(!strcmp(cp, ".0")) { *cp = '\0'; cp = str + strlen(str) - 2; } - + return _getnetbynis(str, "networks.byaddr"); } diff --git a/lib/libc/net/getnetnamadr.c b/lib/libc/net/getnetnamadr.c index cf0a81aad456..5d99c8f9c9d8 100644 --- a/lib/libc/net/getnetnamadr.c +++ b/lib/libc/net/getnetnamadr.c @@ -24,8 +24,8 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)$Id: getnetnamadr.c,v 1.2 1994/09/26 22:45:10 wollman Exp $"; -static char rcsid[] = "$Id: getnetnamadr.c,v 1.2 1994/09/26 22:45:10 wollman Exp $"; +static char sccsid[] = "@(#)$Id: getnetnamadr.c,v 1.3 1995/03/24 15:51:30 ache Exp $"; +static char rcsid[] = "$Id: getnetnamadr.c,v 1.3 1995/03/24 15:51:30 ache Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -49,7 +49,7 @@ extern struct netent * _getnetbynisaddr __P((long, int)); #define _PATH_NETCONF "/etc/host.conf" #endif -enum service_type { +enum service_type { SERVICE_NONE = 0, SERVICE_BIND, SERVICE_TABLE, diff --git a/lib/libc/net/herror.c b/lib/libc/net/herror.c index 0366b0489807..c9135c304aae 100644 --- a/lib/libc/net/herror.c +++ b/lib/libc/net/herror.c @@ -31,14 +31,14 @@ * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -53,7 +53,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)herror.c 8.1 (Berkeley) 6/4/93"; -static char rcsid[] = "$Id: herror.c,v 4.9.1.1 1993/05/02 23:14:35 vixie Rel $"; +static char rcsid[] = "$Id: herror.c,v 1.1.1.1 1994/05/27 04:57:15 rgrimes Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> diff --git a/lib/libc/net/inet_addr.c b/lib/libc/net/inet_addr.c index 246a418a9563..f69d0fcd8c0f 100644 --- a/lib/libc/net/inet_addr.c +++ b/lib/libc/net/inet_addr.c @@ -55,7 +55,7 @@ inet_addr(cp) return (INADDR_NONE); } -/* +/* * Check whether "cp" is a valid ascii representation * of an Internet address and convert to a binary address. * Returns 1 if the address is valid, 0 if not. @@ -93,7 +93,7 @@ inet_aton(cp, addr) continue; } if (base == 16 && isascii(c) && isxdigit(c)) { - val = (val << 4) + + val = (val << 4) + (c + 10 - (islower(c) ? 'a' : 'A')); cp++; continue; diff --git a/lib/libc/net/iso_addr.c b/lib/libc/net/iso_addr.c index 41dc531cb783..8829497973e5 100644 --- a/lib/libc/net/iso_addr.c +++ b/lib/libc/net/iso_addr.c @@ -65,7 +65,7 @@ iso_addr(addr) new = *addr - 'a' + 10; } else if ((*addr >= 'A') && (*addr <= 'F')) { new = *addr - 'A' + 10; - } else if (*addr == 0) + } else if (*addr == 0) state |= END; else state |= DELIM; @@ -86,7 +86,7 @@ iso_addr(addr) break; } break; - } while (cp < cplim); + } while (cp < cplim); out_addr.isoa_len = cp - out_addr.isoa_genaddr; return (&out_addr); } diff --git a/lib/libc/net/linkaddr.c b/lib/libc/net/linkaddr.c index 50ab39227824..68eed3df3394 100644 --- a/lib/libc/net/linkaddr.c +++ b/lib/libc/net/linkaddr.c @@ -112,7 +112,7 @@ link_addr(addr, sdl) break; } break; - } while (cp < cplim); + } while (cp < cplim); sdl->sdl_alen = cp - LLADDR(sdl); new = cp - (char *)sdl; if (new > sizeof(*sdl)) @@ -127,7 +127,7 @@ link_ntoa(sdl) register const struct sockaddr_dl *sdl; { static char obuf[64]; - register char *out = obuf; + register char *out = obuf; register int i; register u_char *in = (u_char *)LLADDR(sdl); u_char *inlim = in + sdl->sdl_alen; diff --git a/lib/libc/net/ns_addr.c b/lib/libc/net/ns_addr.c index 9b0b9d17e9ff..da8f8b4d72ca 100644 --- a/lib/libc/net/ns_addr.c +++ b/lib/libc/net/ns_addr.c @@ -47,7 +47,7 @@ static struct ns_addr addr, zero_addr; static void Field(), cvtbase(); -struct ns_addr +struct ns_addr ns_addr(name) const char *name; { @@ -157,7 +157,7 @@ Field(buf, out, len) case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': base16 = 1; break; - + case 'x': case 'X': *--bp = '0'; base16 = 1; diff --git a/lib/libc/net/res_comp.c b/lib/libc/net/res_comp.c index 1e7653555586..a78a7986629e 100644 --- a/lib/libc/net/res_comp.c +++ b/lib/libc/net/res_comp.c @@ -31,14 +31,14 @@ * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -53,7 +53,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)res_comp.c 8.1 (Berkeley) 6/4/93"; -static char rcsid[] = "$Id: res_comp.c,v 4.9.1.11 1994/07/23 23:24:11 vixie Exp $"; +static char rcsid[] = "$Id: res_comp.c,v 1.2 1994/09/25 02:12:32 pst Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> diff --git a/lib/libc/net/res_debug.c b/lib/libc/net/res_debug.c index a40a3895f321..78b11c957fd9 100644 --- a/lib/libc/net/res_debug.c +++ b/lib/libc/net/res_debug.c @@ -31,14 +31,14 @@ * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -53,7 +53,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)res_debug.c 8.1 (Berkeley) 6/4/93"; -static char rcsid[] = "$Id: res_debug.c,v 4.9.1.16 1994/07/11 07:41:13 vixie Exp $"; +static char rcsid[] = "$Id: res_debug.c,v 1.2 1994/09/25 02:12:34 pst Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -291,7 +291,7 @@ __fp_nquery(msg, len, file) fprintf(file, ", Auth: %d", ntohs(hp->nscount)); fprintf(file, ", Addit: %d", ntohs(hp->arcount)); } - if ((!_res.pfcode) || (_res.pfcode & + if ((!_res.pfcode) || (_res.pfcode & (RES_PRF_HEADX | RES_PRF_HEAD2 | RES_PRF_HEAD1))) { putc('\n',file); } diff --git a/lib/libc/net/res_init.c b/lib/libc/net/res_init.c index 1b1613ffe72b..347e5b6d3e72 100644 --- a/lib/libc/net/res_init.c +++ b/lib/libc/net/res_init.c @@ -31,14 +31,14 @@ * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -53,7 +53,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)res_init.c 8.1 (Berkeley) 6/7/93"; -static char rcsid[] = "$Id: res_init.c,v 1.2 1994/09/25 02:12:36 pst Exp $"; +static char rcsid[] = "$Id: res_init.c,v 1.3 1994/09/25 17:45:39 pst Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -91,7 +91,7 @@ struct __res_state _res; * since it was noted that INADDR_ANY actually meant ``the first interface * you "ifconfig"'d at boot time'' and if this was a SLIP or PPP interface, * it had to be "up" in order for you to reach your own name server. It - * was later decided that since the recommended practice is to always + * was later decided that since the recommended practice is to always * install local static routes through 127.0.0.1 for all your network * interfaces, that we could solve this problem without a code change. * @@ -287,11 +287,11 @@ res_init() if (inet_aton(net, &a)) { _res.sort_list[nsort].mask = a.s_addr; } else { - _res.sort_list[nsort].mask = + _res.sort_list[nsort].mask = net_mask(_res.sort_list[nsort].addr); } } else { - _res.sort_list[nsort].mask = + _res.sort_list[nsort].mask = net_mask(_res.sort_list[nsort].addr); } nsort++; @@ -306,7 +306,7 @@ res_init() continue; } } - if (nserv > 1) + if (nserv > 1) _res.nscount = nserv; #ifdef RESOLVSORT _res.nsort = nsort; diff --git a/lib/libc/net/res_mkquery.c b/lib/libc/net/res_mkquery.c index 7007edbc5570..7788d165b2ff 100644 --- a/lib/libc/net/res_mkquery.c +++ b/lib/libc/net/res_mkquery.c @@ -31,14 +31,14 @@ * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -53,7 +53,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)res_mkquery.c 8.1 (Berkeley) 6/4/93"; -static char rcsid[] = "$Id: res_mkquery.c,v 1.2 1994/09/25 02:12:38 pst Exp $"; +static char rcsid[] = "$Id: res_mkquery.c,v 1.3 1994/09/25 17:45:39 pst Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> diff --git a/lib/libc/net/res_query.c b/lib/libc/net/res_query.c index 51e13e7f966c..ed923eb6e31b 100644 --- a/lib/libc/net/res_query.c +++ b/lib/libc/net/res_query.c @@ -31,14 +31,14 @@ * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -53,7 +53,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)res_query.c 8.1 (Berkeley) 6/4/93"; -static char rcsid[] = "$Id: res_query.c,v 1.2 1994/09/25 02:12:41 pst Exp $"; +static char rcsid[] = "$Id: res_query.c,v 1.3 1994/09/25 17:45:40 pst Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> diff --git a/lib/libc/net/res_send.c b/lib/libc/net/res_send.c index a694b5ec6e31..8ee0a928f4fb 100644 --- a/lib/libc/net/res_send.c +++ b/lib/libc/net/res_send.c @@ -31,14 +31,14 @@ * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -53,7 +53,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93"; -static char rcsid[] = "$Id: res_send.c,v 1.2 1994/09/25 02:12:49 pst Exp $"; +static char rcsid[] = "$Id: res_send.c,v 1.3 1994/09/25 17:45:41 pst Exp $"; #endif /* LIBC_SCCS and not lint */ /* change this to "0" diff --git a/lib/libc/nls/msgcat.c b/lib/libc/nls/msgcat.c index 37a15e1c6e80..b4a465290c12 100644 --- a/lib/libc/nls/msgcat.c +++ b/lib/libc/nls/msgcat.c @@ -1,4 +1,4 @@ -/* $Id$ */ +/* $Id: msgcat.c,v 1.1 1995/03/30 12:47:26 jkh Exp $ */ /*********************************************************** Copyright 1990, by Alfalfa Software Incorporated, Cambridge, Massachusetts. @@ -29,7 +29,7 @@ up-to-date. Many thanks. 267 Allston St., #3 Cambridge, MA 02139 USA nazgul@alfalfa.com - + ******************************************************************/ #if defined(LIBC_SCCS) && !defined(lint) @@ -92,7 +92,7 @@ int type; long len; char *base, *cptr, *pathP; struct stat sbuf; - + if (!name || !*name) return(NLERR); if (strchr(name, '/')) { @@ -103,14 +103,14 @@ int type; if ((nlspath = (char *) getenv("NLSPATH")) == NULL) { nlspath = "/usr/share/nls/%L/%N.cat:/usr/share/nls/%N/%L"; } - + len = strlen(nlspath); base = cptr = (char *) malloc(len + 2); if (!base) return(NLERR); strcpy(cptr, nlspath); cptr[len] = ':'; cptr[len+1] = '\0'; - + for (nlspath = cptr; *cptr; ++cptr) { if (*cptr == ':') { *cptr = '\0'; @@ -181,7 +181,7 @@ int setId; hi = cat->numSets; cur = (hi - lo) / 2; } - + while (True) { set = cat->sets + cur; if (set->setId == setId) break; @@ -201,16 +201,16 @@ int setId; return(set); } - + static MCMsgT *MCGetMsg( set, msgId) MCSetT *set; int msgId; { MCMsgT *msg; long lo, hi, cur, dir; - + if (!set || set->invalid || msgId <= 0) return(NULL); - + lo = 0; if (msgId - 1 < set->numMsgs) { cur = msgId - 1; @@ -219,7 +219,7 @@ int msgId; hi = set->numMsgs; cur = (hi - lo) / 2; } - + while (True) { msg = set->u.msgs + cur; if (msg->msgId == msgId) break; @@ -264,7 +264,7 @@ nl_catd catd; int i, j; if (!cat) return -1; - + if (cat->loadType != MCLoadAll) close(cat->fd); for (i = 0; i < cat->numSets; ++i) { set = cat->sets + i; @@ -312,13 +312,13 @@ int type; if (read(cat->fd, &header, sizeof(header)) != sizeof(header)) CORRUPT(); if (strncmp(header.magic, MCMagic, MCMagicLen) != 0) CORRUPT(); - + if (header.majorVer != MCMajorVer) { fprintf(stderr, "%s: %s is version %d, we need %d.\n", ERRNAME, catpath, header.majorVer, MCMajorVer); return(0); } - + if (header.numSets <= 0) { fprintf(stderr, "%s: %s has %d sets!\n", ERRNAME, catpath, header.numSets); @@ -338,7 +338,7 @@ int type; if (read(cat->fd, set, sizeof(*set)) != sizeof(*set)) CORRUPT(); /* if it's invalid, skip over it (and backup 'i') */ - + if (set->invalid) { --i; nextSet = set->nextSet; @@ -376,7 +376,7 @@ MCSetT *set; /* Get the messages */ if (lseek(cat->fd, set->u.firstMsg, 0) == -1) return(0); if ((set->u.msgs = (MCMsgT *) malloc(sizeof(MCMsgT) * set->numMsgs)) == NULL) return(-1); - + for (i = 0; i < set->numMsgs; ++i) { msg = set->u.msgs + i; if (read(cat->fd, msg, sizeof(*msg)) != sizeof(*msg)) return(0); @@ -389,8 +389,8 @@ MCSetT *set; set->invalid = False; return(1); } - - - + + + diff --git a/lib/libc/nls/msgcat.h b/lib/libc/nls/msgcat.h index e6e574488e06..4fabb591529b 100644 --- a/lib/libc/nls/msgcat.h +++ b/lib/libc/nls/msgcat.h @@ -1,4 +1,4 @@ -/* $Id$ */ +/* $Id: msgcat.h,v 1.1 1995/03/30 12:47:27 jkh Exp $ */ /* -*-c++-*- */ @@ -34,7 +34,7 @@ up-to-date. Many thanks. 267 Allston St., #3 Cambridge, MA 02139 USA nazgul@alfalfa.com - + ******************************************************************/ diff --git a/lib/libc/quad/muldi3.c b/lib/libc/quad/muldi3.c index a8d7cfc7eabc..5e2331fee273 100644 --- a/lib/libc/quad/muldi3.c +++ b/lib/libc/quad/muldi3.c @@ -49,7 +49,7 @@ static char sccsid[] = "@(#)muldi3.c 8.1 (Berkeley) 6/4/93"; * * u = 2^n u1 * u0 (n = number of bits in `u_long', usu. 32) * - * and + * and * * v = 2^n v1 * v0 * diff --git a/lib/libc/quad/qdivrem.c b/lib/libc/quad/qdivrem.c index 34b94ceaab23..56f91ec9fb7c 100644 --- a/lib/libc/quad/qdivrem.c +++ b/lib/libc/quad/qdivrem.c @@ -198,7 +198,7 @@ __qdivrem(uq, vq, arq) v2 = v[2]; /* for D3 */ do { register digit uj0, uj1, uj2; - + /* * D3: Calculate qhat (\^q, in TeX notation). * Let qhat = min((u[j]*B + u[j+1])/v[1], B-1), and diff --git a/lib/libc/regex/engine.c b/lib/libc/regex/engine.c index 02c841afa466..6d982f889c51 100644 --- a/lib/libc/regex/engine.c +++ b/lib/libc/regex/engine.c @@ -1028,7 +1028,7 @@ FILE *d; fprintf(d, "\n"); } -/* +/* - at - print current situation == #ifdef REDEBUG == static void at(struct match *m, char *title, char *start, char *stop, \ diff --git a/lib/libc/regex/regerror.c b/lib/libc/regex/regerror.c index a8d09454199b..2d2160ac1126 100644 --- a/lib/libc/regex/regerror.c +++ b/lib/libc/regex/regerror.c @@ -131,7 +131,7 @@ size_t errbuf_size; for (r = rerrs; r->code != 0; r++) if (r->code == target) break; - + if (errcode®_ITOA) { if (r->code != 0) (void) strcpy(convbuf, r->name); diff --git a/lib/libc/rpc/Makefile.inc b/lib/libc/rpc/Makefile.inc index 1854c0d23c05..43f0f3939532 100644 --- a/lib/libc/rpc/Makefile.inc +++ b/lib/libc/rpc/Makefile.inc @@ -7,7 +7,7 @@ SRCS+= auth_none.c auth_unix.c authunix_prot.c bindresvport.c \ pmap_clnt.c pmap_getmaps.c pmap_getport.c pmap_prot.c \ pmap_prot2.c pmap_rmt.c rpc_prot.c rpc_commondata.c rpc_callmsg.c \ svc.c svc_auth.c svc_auth_unix.c svc_raw.c svc_run.c svc_simple.c \ - svc_tcp.c svc_udp.c + svc_tcp.c svc_udp.c # # XXX -- rstat.1 and rstat_svc.8 shouldn't really be here @@ -16,7 +16,7 @@ SRCS+= auth_none.c auth_unix.c authunix_prot.c bindresvport.c \ # Paul. # -# MAN1+= rpc/rstat.1 +# MAN1+= rpc/rstat.1 MAN3+= rpc/bindresvport.3 rpc/getrpcent.3 rpc/getrpcport.3 rpc/rpc.3 MAN5+= rpc/rpc.5 MAN8+= rpc/rstat_svc.8 diff --git a/lib/libc/rpc/auth_none.c b/lib/libc/rpc/auth_none.c index 9c5a664795f6..3701363f3707 100644 --- a/lib/libc/rpc/auth_none.c +++ b/lib/libc/rpc/auth_none.c @@ -5,23 +5,23 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -30,15 +30,15 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)auth_none.c 1.19 87/08/11 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)auth_none.c 2.1 88/07/29 4.0 RPCSRC";*/ -static char *rcsid = "$Id: auth_none.c,v 1.1 1993/10/27 05:40:10 paul Exp $"; +static char *rcsid = "$Id: auth_none.c,v 1.1 1994/08/07 18:35:38 wollman Exp $"; #endif /* * auth_none.c - * Creates a client authentication handle for passing "null" - * credentials and verifiers to remote systems. - * - * Copyright (C) 1984, Sun Microsystems, Inc. + * Creates a client authentication handle for passing "null" + * credentials and verifiers to remote systems. + * + * Copyright (C) 1984, Sun Microsystems, Inc. */ #include <rpc/types.h> @@ -110,7 +110,7 @@ authnone_marshal(client, xdrs) ap->marshalled_client, ap->mcnt)); } -static void +static void authnone_verf() { } diff --git a/lib/libc/rpc/auth_unix.c b/lib/libc/rpc/auth_unix.c index 44df3e44b921..ed374cab72ba 100644 --- a/lib/libc/rpc/auth_unix.c +++ b/lib/libc/rpc/auth_unix.c @@ -5,11 +5,11 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. @@ -17,11 +17,11 @@ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -30,12 +30,12 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)auth_unix.c 1.19 87/08/11 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)auth_unix.c 2.2 88/08/01 4.0 RPCSRC";*/ -static char *rcsid = "$Id: auth_unix.c,v 1.2 1994/08/10 02:25:22 wollman Exp $"; +static char *rcsid = "$Id: auth_unix.c,v 1.3 1995/03/18 17:55:03 ache Exp $"; #endif /* - * auth_unix.c, Implements UNIX style authentication parameters. - * + * auth_unix.c, Implements UNIX style authentication parameters. + * * Copyright (C) 1984, Sun Microsystems, Inc. * * The system is very weak. The client uses no encryption for it's @@ -160,7 +160,7 @@ authunix_create(machname, uid, gid, len, aup_gids) * Serialize the parameters into origcred */ xdrmem_create(&xdrs, mymem, MAX_AUTH_BYTES, XDR_ENCODE); - if (! xdr_authunix_parms(&xdrs, &aup)) + if (! xdr_authunix_parms(&xdrs, &aup)) abort(); au->au_origcred.oa_length = len = XDR_GETPOS(&xdrs); au->au_origcred.oa_flavor = AUTH_UNIX; @@ -205,7 +205,7 @@ authunix_create_default() if ((len = getgroups(NGROUPS, real_gids)) < 0) abort(); if(len > NGRPS) len = NGRPS; /* GW: turn `gid_t's into `int's */ - for(i = 0; i < len; i++) { + for(i = 0; i < len; i++) { gids[i] = real_gids[i]; } return (authunix_create(machname, uid, gid, len, gids)); @@ -284,7 +284,7 @@ authunix_refresh(auth) xdrmem_create(&xdrs, au->au_origcred.oa_base, au->au_origcred.oa_length, XDR_DECODE); stat = xdr_authunix_parms(&xdrs, &aup); - if (! stat) + if (! stat) goto done; /* update the time and serialize in place */ diff --git a/lib/libc/rpc/authunix_prot.c b/lib/libc/rpc/authunix_prot.c index 15faf184cfb5..5a8c2a465ed7 100644 --- a/lib/libc/rpc/authunix_prot.c +++ b/lib/libc/rpc/authunix_prot.c @@ -5,23 +5,23 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)authunix_prot.c 1.15 87/08/11 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)authunix_prot.c 2.1 88/07/29 4.0 RPCSRC";*/ -static char *rcsid = "$Id: authunix_prot.c,v 1.1 1993/10/27 05:40:15 paul Exp $"; +static char *rcsid = "$Id: authunix_prot.c,v 1.1 1994/08/07 18:35:40 wollman Exp $"; #endif /* diff --git a/lib/libc/rpc/bindresvport.c b/lib/libc/rpc/bindresvport.c index a085c910c3c3..3f48d268845a 100644 --- a/lib/libc/rpc/bindresvport.c +++ b/lib/libc/rpc/bindresvport.c @@ -5,23 +5,23 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)bindresvport.c 1.8 88/02/08 SMI";*/ /*static char *sccsid = "from: @(#)bindresvport.c 2.2 88/07/29 4.0 RPCSRC";*/ -static char *rcsid = "$Id: bindresvport.c,v 1.1 1993/10/27 05:40:17 paul Exp $"; +static char *rcsid = "$Id: bindresvport.c,v 1.1 1994/08/07 18:35:42 wollman Exp $"; #endif /* diff --git a/lib/libc/rpc/clnt_generic.c b/lib/libc/rpc/clnt_generic.c index ad9c22bb7191..ef4b969d4fd4 100644 --- a/lib/libc/rpc/clnt_generic.c +++ b/lib/libc/rpc/clnt_generic.c @@ -5,11 +5,11 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. @@ -17,11 +17,11 @@ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)clnt_generic.c 1.4 87/08/11 (C) 1987 SMI";*/ /*static char *sccsid = "from: @(#)clnt_generic.c 2.2 88/08/01 4.0 RPCSRC";*/ -static char *rcsid = "$Id: clnt_generic.c,v 1.1 1993/10/27 05:40:19 paul Exp $"; +static char *rcsid = "$Id: clnt_generic.c,v 1.1 1994/08/07 18:35:43 wollman Exp $"; #endif /* @@ -43,7 +43,7 @@ static char *rcsid = "$Id: clnt_generic.c,v 1.1 1993/10/27 05:40:19 paul Exp $"; /* * Generic client creation: takes (hostname, program-number, protocol) and - * returns client handle. Default options are set, which the user can + * returns client handle. Default options are set, which the user can * change using the rpc equivalent of ioctl()'s. */ CLIENT * @@ -70,7 +70,7 @@ clnt_create(hostname, prog, vers, proto) * Only support INET for now */ rpc_createerr.cf_stat = RPC_SYSTEMERROR; - rpc_createerr.cf_error.re_errno = EAFNOSUPPORT; + rpc_createerr.cf_error.re_errno = EAFNOSUPPORT; return (NULL); } sin.sin_family = h->h_addrtype; @@ -80,7 +80,7 @@ clnt_create(hostname, prog, vers, proto) p = getprotobyname(proto); if (p == NULL) { rpc_createerr.cf_stat = RPC_UNKNOWNPROTO; - rpc_createerr.cf_error.re_errno = EPFNOSUPPORT; + rpc_createerr.cf_error.re_errno = EPFNOSUPPORT; return (NULL); } sock = RPC_ANYSOCK; @@ -106,7 +106,7 @@ clnt_create(hostname, prog, vers, proto) break; default: rpc_createerr.cf_stat = RPC_SYSTEMERROR; - rpc_createerr.cf_error.re_errno = EPFNOSUPPORT; + rpc_createerr.cf_error.re_errno = EPFNOSUPPORT; return (NULL); } return (client); diff --git a/lib/libc/rpc/clnt_perror.c b/lib/libc/rpc/clnt_perror.c index 9a7d76cbc200..c4076cb192d6 100644 --- a/lib/libc/rpc/clnt_perror.c +++ b/lib/libc/rpc/clnt_perror.c @@ -5,23 +5,23 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)clnt_perror.c 1.15 87/10/07 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)clnt_perror.c 2.1 88/07/29 4.0 RPCSRC";*/ -static char *rcsid = "$Id: clnt_perror.c,v 1.1 1993/10/27 05:40:20 paul Exp $"; +static char *rcsid = "$Id: clnt_perror.c,v 1.1 1994/08/07 18:35:44 wollman Exp $"; #endif /* @@ -77,17 +77,17 @@ clnt_sperror(rpch, s) return (0); CLNT_GETERR(rpch, &e); - (void) sprintf(str, "%s: ", s); + (void) sprintf(str, "%s: ", s); str += strlen(str); - (void) strcpy(str, clnt_sperrno(e.re_status)); + (void) strcpy(str, clnt_sperrno(e.re_status)); str += strlen(str); switch (e.re_status) { case RPC_SUCCESS: case RPC_CANTENCODEARGS: case RPC_CANTDECODERES: - case RPC_TIMEDOUT: + case RPC_TIMEDOUT: case RPC_PROGUNAVAIL: case RPC_PROCUNAVAIL: case RPC_CANTDECODEARGS: @@ -102,13 +102,13 @@ clnt_sperror(rpch, s) case RPC_CANTSEND: case RPC_CANTRECV: (void) sprintf(str, "; errno = %s", - strerror(e.re_errno)); + strerror(e.re_errno)); str += strlen(str); break; case RPC_VERSMISMATCH: (void) sprintf(str, - "; low version = %lu, high version = %lu", + "; low version = %lu, high version = %lu", e.re_vers.low, e.re_vers.high); str += strlen(str); break; @@ -128,15 +128,15 @@ clnt_sperror(rpch, s) break; case RPC_PROGVERSMISMATCH: - (void) sprintf(str, - "; low version = %lu, high version = %lu", + (void) sprintf(str, + "; low version = %lu, high version = %lu", e.re_vers.low, e.re_vers.high); str += strlen(str); break; default: /* unknown */ - (void) sprintf(str, - "; s1 = %lu, s2 = %lu", + (void) sprintf(str, + "; s1 = %lu, s2 = %lu", e.re_lb.s1, e.re_lb.s2); str += strlen(str); break; @@ -160,41 +160,41 @@ struct rpc_errtab { }; static struct rpc_errtab rpc_errlist[] = { - { RPC_SUCCESS, - "RPC: Success" }, - { RPC_CANTENCODEARGS, + { RPC_SUCCESS, + "RPC: Success" }, + { RPC_CANTENCODEARGS, "RPC: Can't encode arguments" }, - { RPC_CANTDECODERES, + { RPC_CANTDECODERES, "RPC: Can't decode result" }, - { RPC_CANTSEND, + { RPC_CANTSEND, "RPC: Unable to send" }, - { RPC_CANTRECV, + { RPC_CANTRECV, "RPC: Unable to receive" }, - { RPC_TIMEDOUT, + { RPC_TIMEDOUT, "RPC: Timed out" }, - { RPC_VERSMISMATCH, + { RPC_VERSMISMATCH, "RPC: Incompatible versions of RPC" }, - { RPC_AUTHERROR, + { RPC_AUTHERROR, "RPC: Authentication error" }, - { RPC_PROGUNAVAIL, + { RPC_PROGUNAVAIL, "RPC: Program unavailable" }, - { RPC_PROGVERSMISMATCH, + { RPC_PROGVERSMISMATCH, "RPC: Program/version mismatch" }, - { RPC_PROCUNAVAIL, + { RPC_PROCUNAVAIL, "RPC: Procedure unavailable" }, - { RPC_CANTDECODEARGS, + { RPC_CANTDECODEARGS, "RPC: Server can't decode arguments" }, - { RPC_SYSTEMERROR, + { RPC_SYSTEMERROR, "RPC: Remote system error" }, - { RPC_UNKNOWNHOST, + { RPC_UNKNOWNHOST, "RPC: Unknown host" }, { RPC_UNKNOWNPROTO, "RPC: Unknown protocol" }, - { RPC_PMAPFAILURE, + { RPC_PMAPFAILURE, "RPC: Port mapper failure" }, - { RPC_PROGNOTREGISTERED, + { RPC_PROGNOTREGISTERED, "RPC: Program not registered"}, - { RPC_FAILED, + { RPC_FAILED, "RPC: Failed (unspecified error)"} }; @@ -265,7 +265,7 @@ clnt_pcreateerror(s) } struct auth_errtab { - enum auth_stat status; + enum auth_stat status; char *message; }; diff --git a/lib/libc/rpc/clnt_raw.c b/lib/libc/rpc/clnt_raw.c index 9ee87b225701..0f86b3e571f5 100644 --- a/lib/libc/rpc/clnt_raw.c +++ b/lib/libc/rpc/clnt_raw.c @@ -5,11 +5,11 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. @@ -17,11 +17,11 @@ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)clnt_raw.c 1.22 87/08/11 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)clnt_raw.c 2.2 88/08/01 4.0 RPCSRC";*/ -static char *rcsid = "$Id: clnt_raw.c,v 1.1 1993/10/27 05:40:22 paul Exp $"; +static char *rcsid = "$Id: clnt_raw.c,v 1.1 1994/08/07 18:35:45 wollman Exp $"; #endif /* @@ -103,7 +103,7 @@ clntraw_create(prog, vers) call_msg.rm_call.cb_rpcvers = RPC_MSG_VERSION; call_msg.rm_call.cb_prog = prog; call_msg.rm_call.cb_vers = vers; - xdrmem_create(xdrs, clp->mashl_callmsg, MCALL_MSG_SIZE, XDR_ENCODE); + xdrmem_create(xdrs, clp->mashl_callmsg, MCALL_MSG_SIZE, XDR_ENCODE); if (! xdr_callhdr(xdrs, &call_msg)) { perror("clnt_raw.c - Fatal header serialization error."); } @@ -123,7 +123,7 @@ clntraw_create(prog, vers) return (client); } -static enum clnt_stat +static enum clnt_stat clntraw_call(h, proc, xargs, argsp, xresults, resultsp, timeout) CLIENT *h; u_long proc; diff --git a/lib/libc/rpc/clnt_simple.c b/lib/libc/rpc/clnt_simple.c index 671e2eb61a93..fefef2efc288 100644 --- a/lib/libc/rpc/clnt_simple.c +++ b/lib/libc/rpc/clnt_simple.c @@ -5,23 +5,23 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -30,10 +30,10 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)clnt_simple.c 1.35 87/08/11 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)clnt_simple.c 2.2 88/08/01 4.0 RPCSRC";*/ -static char *rcsid = "$Id: clnt_simple.c,v 1.1 1993/10/27 05:40:23 paul Exp $"; +static char *rcsid = "$Id: clnt_simple.c,v 1.1 1994/08/07 18:35:46 wollman Exp $"; #endif -/* +/* * clnt_simple.c * Simplified front end to rpc. * @@ -78,7 +78,7 @@ callrpc(host, prognum, versnum, procnum, inproc, in, outproc, out) } if (crp->valid && crp->oldprognum == prognum && crp->oldversnum == versnum && strcmp(crp->oldhost, host) == 0) { - /* reuse old client */ + /* reuse old client */ } else { crp->valid = 0; (void)close(crp->socket); @@ -106,7 +106,7 @@ callrpc(host, prognum, versnum, procnum, inproc, in, outproc, out) tottimeout.tv_usec = 0; clnt_stat = clnt_call(crp->client, procnum, inproc, in, outproc, out, tottimeout); - /* + /* * if call failed, empty cache */ if (clnt_stat != RPC_SUCCESS) diff --git a/lib/libc/rpc/clnt_tcp.c b/lib/libc/rpc/clnt_tcp.c index efc041ab8db3..1de9d8e972f9 100644 --- a/lib/libc/rpc/clnt_tcp.c +++ b/lib/libc/rpc/clnt_tcp.c @@ -5,23 +5,23 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -30,9 +30,9 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)clnt_tcp.c 1.37 87/10/05 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)clnt_tcp.c 2.2 88/08/01 4.0 RPCSRC";*/ -static char *rcsid = "$Id: clnt_tcp.c,v 1.1 1993/10/27 05:40:24 paul Exp $"; +static char *rcsid = "$Id: clnt_tcp.c,v 1.1 1994/08/07 18:35:47 wollman Exp $"; #endif - + /* * clnt_tcp.c, Implements a TCP/IP based, client side RPC. * @@ -87,7 +87,7 @@ struct ct_data { bool_t ct_closeit; struct timeval ct_wait; bool_t ct_waitset; /* wait set by clnt_control? */ - struct sockaddr_in ct_addr; + struct sockaddr_in ct_addr; struct rpc_err ct_error; char ct_mcall[MCALL_MSG_SIZE]; /* marshalled callmsg */ u_int ct_mpos; /* pos after marshal */ diff --git a/lib/libc/rpc/clnt_udp.c b/lib/libc/rpc/clnt_udp.c index 42dfcf1e76fd..02867265a964 100644 --- a/lib/libc/rpc/clnt_udp.c +++ b/lib/libc/rpc/clnt_udp.c @@ -5,23 +5,23 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)clnt_udp.c 1.39 87/08/11 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)clnt_udp.c 2.2 88/08/01 4.0 RPCSRC";*/ -static char *rcsid = "$Id: clnt_udp.c,v 1.1 1994/08/07 18:35:48 wollman Exp $"; +static char *rcsid = "$Id: clnt_udp.c,v 1.2 1995/04/02 20:05:20 wpaul Exp $"; #endif /* @@ -68,7 +68,7 @@ static struct clnt_ops udp_ops = { clntudp_control }; -/* +/* * Private data kept per client handle */ struct cu_data { @@ -206,7 +206,7 @@ clntudp_create(raddr, program, version, wait, sockp) UDPMSGSIZE, UDPMSGSIZE)); } -static enum clnt_stat +static enum clnt_stat clntudp_call(cl, proc, xargs, argsp, xresults, resultsp, utimeout) register CLIENT *cl; /* client handle */ u_long proc; /* procedure number */ @@ -298,7 +298,7 @@ send_again: #endif /* def FD_SETSIZE */ for (;;) { readfds = mask; - switch (select(_rpc_dtablesize(), &readfds, (int *)NULL, + switch (select(_rpc_dtablesize(), &readfds, (int *)NULL, (int *)NULL, &(cu->cu_wait))) { case 0: @@ -311,7 +311,7 @@ send_again: if ((time_waited.tv_sec < timeout.tv_sec) || ((time_waited.tv_sec == timeout.tv_sec) && (time_waited.tv_usec < timeout.tv_usec))) - goto send_again; + goto send_again; return (cu->cu_error.re_status = RPC_TIMEDOUT); /* @@ -320,27 +320,27 @@ send_again: */ case -1: if (errno == EINTR) - continue; + continue; cu->cu_error.re_errno = errno; return (cu->cu_error.re_status = RPC_CANTRECV); } do { fromlen = sizeof(struct sockaddr); - inlen = recvfrom(cu->cu_sock, cu->cu_inbuf, + inlen = recvfrom(cu->cu_sock, cu->cu_inbuf, (int) cu->cu_recvsz, 0, (struct sockaddr *)&from, &fromlen); } while (inlen < 0 && errno == EINTR); if (inlen < 0) { if (errno == EWOULDBLOCK) - continue; + continue; cu->cu_error.re_errno = errno; return (cu->cu_error.re_status = RPC_CANTRECV); } if (inlen < sizeof(u_long)) - continue; + continue; /* see if reply transaction id matches sent id */ if (*((u_long *)(cu->cu_inbuf)) != *((u_long *)(cu->cu_outbuf))) - continue; + continue; /* we now assume we have the proper reply */ break; } @@ -363,7 +363,7 @@ send_again: xdrs->x_op = XDR_FREE; (void)xdr_opaque_auth(xdrs, &(reply_msg.acpted_rply.ar_verf)); - } + } } /* end successful completion */ else { /* maybe our credentials need to be refreshed ... */ @@ -403,7 +403,7 @@ clntudp_freeres(cl, xdr_res, res_ptr) return ((*xdr_res)(xdrs, res_ptr)); } -static void +static void clntudp_abort(/*h*/) /*CLIENT *h;*/ { @@ -438,7 +438,7 @@ clntudp_control(cl, request, info) } return (TRUE); } - + static void clntudp_destroy(cl) CLIENT *cl; diff --git a/lib/libc/rpc/get_myaddress.c b/lib/libc/rpc/get_myaddress.c index 2b0b20d96f0e..c5cd91c98c6e 100644 --- a/lib/libc/rpc/get_myaddress.c +++ b/lib/libc/rpc/get_myaddress.c @@ -5,23 +5,23 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)get_myaddress.c 1.4 87/08/11 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)get_myaddress.c 2.1 88/07/29 4.0 RPCSRC";*/ -static char *rcsid = "$Id: get_myaddress.c,v 1.1 1993/10/27 05:40:27 paul Exp $"; +static char *rcsid = "$Id: get_myaddress.c,v 1.1 1994/08/07 18:35:49 wollman Exp $"; #endif /* @@ -50,7 +50,7 @@ static char *rcsid = "$Id: get_myaddress.c,v 1.1 1993/10/27 05:40:27 paul Exp $" #include <netinet/in.h> #include <arpa/inet.h> -/* +/* * don't use gethostbyname, which would invoke yellow pages */ get_myaddress(addr) diff --git a/lib/libc/rpc/getrpcent.c b/lib/libc/rpc/getrpcent.c index a495278f8d27..f94fcff8f31a 100644 --- a/lib/libc/rpc/getrpcent.c +++ b/lib/libc/rpc/getrpcent.c @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)getrpcent.c 1.14 91/03/11 Copyr 1984 Sun Micro";*/ -static char *rcsid = "$Id: getrpcent.c,v 1.1 1993/10/27 05:40:29 paul Exp $"; +static char *rcsid = "$Id: getrpcent.c,v 1.1 1994/08/07 18:35:51 wollman Exp $"; #endif /* @@ -279,7 +279,7 @@ interpret(val, len) d->rpc.r_number = atoi(cp); q = d->rpc.r_aliases = d->rpc_aliases; cp = strpbrk(cp, " \t"); - if (cp != NULL) + if (cp != NULL) *cp++ = '\0'; while (cp && *cp) { if (*cp == ' ' || *cp == '\t') { diff --git a/lib/libc/rpc/getrpcport.c b/lib/libc/rpc/getrpcport.c index f1d58f9eb718..75af815580fb 100644 --- a/lib/libc/rpc/getrpcport.c +++ b/lib/libc/rpc/getrpcport.c @@ -5,23 +5,23 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)getrpcport.c 1.3 87/08/11 SMI";*/ /*static char *sccsid = "from: @(#)getrpcport.c 2.1 88/07/29 4.0 RPCSRC";*/ -static char *rcsid = "$Id: getrpcport.c,v 1.1 1993/10/27 05:40:31 paul Exp $"; +static char *rcsid = "$Id: getrpcport.c,v 1.1 1994/08/07 18:35:52 wollman Exp $"; #endif /* diff --git a/lib/libc/rpc/pmap_clnt.c b/lib/libc/rpc/pmap_clnt.c index 4ef44ec3144c..a69284d917aa 100644 --- a/lib/libc/rpc/pmap_clnt.c +++ b/lib/libc/rpc/pmap_clnt.c @@ -5,23 +5,23 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)pmap_clnt.c 1.37 87/08/11 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)pmap_clnt.c 2.2 88/08/01 4.0 RPCSRC";*/ -static char *rcsid = "$Id: pmap_clnt.c,v 1.1 1993/10/27 05:40:32 paul Exp $"; +static char *rcsid = "$Id: pmap_clnt.c,v 1.1 1994/08/07 18:35:53 wollman Exp $"; #endif /* diff --git a/lib/libc/rpc/pmap_getmaps.c b/lib/libc/rpc/pmap_getmaps.c index 5af52106454b..7f43baa63cd6 100644 --- a/lib/libc/rpc/pmap_getmaps.c +++ b/lib/libc/rpc/pmap_getmaps.c @@ -5,23 +5,23 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)pmap_getmaps.c 1.10 87/08/11 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)pmap_getmaps.c 2.2 88/08/01 4.0 RPCSRC";*/ -static char *rcsid = "$Id: pmap_getmaps.c,v 1.1 1993/10/27 05:40:35 paul Exp $"; +static char *rcsid = "$Id: pmap_getmaps.c,v 1.1 1994/08/07 18:35:54 wollman Exp $"; #endif /* diff --git a/lib/libc/rpc/pmap_getport.c b/lib/libc/rpc/pmap_getport.c index 06ed4d409fbb..c982fe84977a 100644 --- a/lib/libc/rpc/pmap_getport.c +++ b/lib/libc/rpc/pmap_getport.c @@ -5,23 +5,23 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)pmap_getport.c 1.9 87/08/11 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)pmap_getport.c 2.2 88/08/01 4.0 RPCSRC";*/ -static char *rcsid = "$Id: pmap_getport.c,v 1.1 1993/10/27 05:40:36 paul Exp $"; +static char *rcsid = "$Id: pmap_getport.c,v 1.1 1994/08/07 18:35:55 wollman Exp $"; #endif /* diff --git a/lib/libc/rpc/pmap_prot.c b/lib/libc/rpc/pmap_prot.c index ea0a20dfb144..07b5acd5b2af 100644 --- a/lib/libc/rpc/pmap_prot.c +++ b/lib/libc/rpc/pmap_prot.c @@ -5,23 +5,23 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)pmap_prot.c 1.17 87/08/11 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)pmap_prot.c 2.1 88/07/29 4.0 RPCSRC";*/ -static char *rcsid = "$Id: pmap_prot.c,v 1.1 1993/10/27 05:40:37 paul Exp $"; +static char *rcsid = "$Id: pmap_prot.c,v 1.1 1994/08/07 18:35:56 wollman Exp $"; #endif /* @@ -51,8 +51,8 @@ xdr_pmap(xdrs, regs) struct pmap *regs; { - if (xdr_u_long(xdrs, ®s->pm_prog) && - xdr_u_long(xdrs, ®s->pm_vers) && + if (xdr_u_long(xdrs, ®s->pm_prog) && + xdr_u_long(xdrs, ®s->pm_vers) && xdr_u_long(xdrs, ®s->pm_prot)) return (xdr_u_long(xdrs, ®s->pm_port)); return (FALSE); diff --git a/lib/libc/rpc/pmap_prot2.c b/lib/libc/rpc/pmap_prot2.c index 71ab21a7103b..5e937ed7114e 100644 --- a/lib/libc/rpc/pmap_prot2.c +++ b/lib/libc/rpc/pmap_prot2.c @@ -5,23 +5,23 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)pmap_prot2.c 1.3 87/08/11 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)pmap_prot2.c 2.1 88/07/29 4.0 RPCSRC";*/ -static char *rcsid = "$Id: pmap_prot2.c,v 1.1 1993/10/27 05:40:39 paul Exp $"; +static char *rcsid = "$Id: pmap_prot2.c,v 1.1 1994/08/07 18:35:57 wollman Exp $"; #endif /* @@ -45,7 +45,7 @@ static char *rcsid = "$Id: pmap_prot2.c,v 1.1 1993/10/27 05:40:39 paul Exp $"; #include <rpc/pmap_prot.h> -/* +/* * What is going on with linked lists? (!) * First recall the link list declaration from pmap_prot.h: * @@ -54,11 +54,11 @@ static char *rcsid = "$Id: pmap_prot2.c,v 1.1 1993/10/27 05:40:39 paul Exp $"; * struct pmaplist *pml_map; * }; * - * Compare that declaration with a corresponding xdr declaration that + * Compare that declaration with a corresponding xdr declaration that * is (a) pointer-less, and (b) recursive: * * typedef union switch (bool_t) { - * + * * case TRUE: struct { * struct pmap; * pmaplist_t foo; @@ -71,8 +71,8 @@ static char *rcsid = "$Id: pmap_prot2.c,v 1.1 1993/10/27 05:40:39 paul Exp $"; * the C declaration has no bool_t variable. The bool_t can be * interpreted as ``more data follows me''; if FALSE then nothing * follows this bool_t; if TRUE then the bool_t is followed by - * an actual struct pmap, and then (recursively) by the - * xdr union, pamplist_t. + * an actual struct pmap, and then (recursively) by the + * xdr union, pamplist_t. * * This could be implemented via the xdr_union primitive, though this * would cause a one recursive call per element in the list. Rather than do @@ -109,7 +109,7 @@ xdr_pmaplist(xdrs, rp) * before we free the current object ... */ if (freeing) - next = &((*rp)->pml_next); + next = &((*rp)->pml_next); if (! xdr_reference(xdrs, (caddr_t *)rp, (u_int)sizeof(struct pmaplist), xdr_pmap)) return (FALSE); diff --git a/lib/libc/rpc/pmap_rmt.c b/lib/libc/rpc/pmap_rmt.c index 339860c2c153..6f1b04832183 100644 --- a/lib/libc/rpc/pmap_rmt.c +++ b/lib/libc/rpc/pmap_rmt.c @@ -5,23 +5,23 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)pmap_rmt.c 1.21 87/08/27 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)pmap_rmt.c 2.2 88/08/01 4.0 RPCSRC";*/ -static char *rcsid = "$Id: pmap_rmt.c,v 1.1 1993/10/27 05:40:40 paul Exp $"; +static char *rcsid = "$Id: pmap_rmt.c,v 1.1 1994/08/07 18:35:57 wollman Exp $"; #endif /* @@ -156,7 +156,7 @@ xdr_rmtcallres(xdrs, crp) /* * The following is kludged-up support for simple rpc broadcasts. - * Someday a large, complicated system will replace these trivial + * Someday a large, complicated system will replace these trivial * routines which only support udp/ip . */ @@ -214,7 +214,7 @@ getbroadcastnets(addrs, sock, buf) typedef bool_t (*resultproc_t)(); -enum clnt_stat +enum clnt_stat clnt_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult) u_long prog; /* program number */ u_long vers; /* version number */ @@ -248,7 +248,7 @@ clnt_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult) struct rmtcallargs a; struct rmtcallres r; struct rpc_msg msg; - struct timeval t; + struct timeval t; char outbuf[MAX_BROADCAST_SIZE], inbuf[UDPMSGSIZE]; /* @@ -328,7 +328,7 @@ clnt_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult) msg.acpted_rply.ar_results.where = (caddr_t)&r; msg.acpted_rply.ar_results.proc = xdr_rmtcallres; readfds = mask; - switch (select(_rpc_dtablesize(), &readfds, (int *)NULL, + switch (select(_rpc_dtablesize(), &readfds, (int *)NULL, (int *)NULL, &t)) { case 0: /* timed out */ diff --git a/lib/libc/rpc/rpc_callmsg.c b/lib/libc/rpc/rpc_callmsg.c index 4ec59dbc7855..205280379d62 100644 --- a/lib/libc/rpc/rpc_callmsg.c +++ b/lib/libc/rpc/rpc_callmsg.c @@ -5,23 +5,23 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)rpc_callmsg.c 1.4 87/08/11 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)rpc_callmsg.c 2.1 88/07/29 4.0 RPCSRC";*/ -static char *rcsid = "$Id: rpc_callmsg.c,v 1.1 1993/10/27 05:40:46 paul Exp $"; +static char *rcsid = "$Id: rpc_callmsg.c,v 1.1 1994/08/07 18:36:00 wollman Exp $"; #endif /* diff --git a/lib/libc/rpc/rpc_commondata.c b/lib/libc/rpc/rpc_commondata.c index e870ab8dde7c..aa095265b086 100644 --- a/lib/libc/rpc/rpc_commondata.c +++ b/lib/libc/rpc/rpc_commondata.c @@ -5,23 +5,23 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -29,13 +29,13 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)rpc_commondata.c 2.1 88/07/29 4.0 RPCSRC";*/ -static char *rcsid = "$Id: rpc_commondata.c,v 1.1 1993/10/27 05:40:47 paul Exp $"; +static char *rcsid = "$Id: rpc_commondata.c,v 1.1 1994/08/07 18:36:01 wollman Exp $"; #endif #include <rpc/rpc.h> /* * This file should only contain common data (global data) that is exported - * by public interfaces + * by public interfaces */ struct opaque_auth _null_auth; #ifdef FD_SETSIZE diff --git a/lib/libc/rpc/rpc_dtablesize.c b/lib/libc/rpc/rpc_dtablesize.c index e448624883b0..6ca511df8994 100644 --- a/lib/libc/rpc/rpc_dtablesize.c +++ b/lib/libc/rpc/rpc_dtablesize.c @@ -5,23 +5,23 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -53,7 +53,7 @@ static char *rcsid = "rpc_dtablesize.c,v 1.1 1994/08/07 18:36:02 wollman Exp"; _rpc_dtablesize() { static int size; - + if (size == 0) { size = getdtablesize(); if (size > FD_SETSIZE) diff --git a/lib/libc/rpc/rpc_prot.c b/lib/libc/rpc/rpc_prot.c index 7fbb36fd7557..1693b6730c83 100644 --- a/lib/libc/rpc/rpc_prot.c +++ b/lib/libc/rpc/rpc_prot.c @@ -5,23 +5,23 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)rpc_prot.c 1.36 87/08/11 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)rpc_prot.c 2.3 88/08/07 4.0 RPCSRC";*/ -static char *rcsid = "$Id: rpc_prot.c,v 1.1 1993/10/27 05:40:50 paul Exp $"; +static char *rcsid = "$Id: rpc_prot.c,v 1.1 1994/08/07 18:36:03 wollman Exp $"; #endif /* @@ -86,9 +86,9 @@ xdr_des_block(xdrs, blkp) /* * XDR the MSG_ACCEPTED part of a reply message union */ -bool_t +bool_t xdr_accepted_reply(xdrs, ar) - register XDR *xdrs; + register XDR *xdrs; register struct accepted_reply *ar; { @@ -113,7 +113,7 @@ xdr_accepted_reply(xdrs, ar) /* * XDR the MSG_DENIED part of a reply message union */ -bool_t +bool_t xdr_rejected_reply(xdrs, rr) register XDR *xdrs; register struct rejected_reply *rr; @@ -149,7 +149,7 @@ xdr_replymsg(xdrs, rmsg) register struct rpc_msg *rmsg; { if ( - xdr_u_long(xdrs, &(rmsg->rm_xid)) && + xdr_u_long(xdrs, &(rmsg->rm_xid)) && xdr_enum(xdrs, (enum_t *)&(rmsg->rm_direction)) && (rmsg->rm_direction == REPLY) ) return (xdr_union(xdrs, (enum_t *)&(rmsg->rm_reply.rp_stat), @@ -221,7 +221,7 @@ accepted(acpt_stat, error) error->re_lb.s2 = (long)acpt_stat; } -static void +static void rejected(rjct_stat, error) register enum reject_stat rjct_stat; register struct rpc_err *error; diff --git a/lib/libc/rpc/svc.c b/lib/libc/rpc/svc.c index 55ad25e92ad0..de16d2eac71e 100644 --- a/lib/libc/rpc/svc.c +++ b/lib/libc/rpc/svc.c @@ -5,32 +5,32 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 */ -#if defined(LIBC_SCCS) && !defined(lint) +#if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)svc.c 1.44 88/02/08 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)svc.c 2.4 88/08/11 4.0 RPCSRC";*/ -static char *rcsid = "$Id: svc.c,v 1.1 1993/10/27 05:40:54 paul Exp $"; +static char *rcsid = "$Id: svc.c,v 1.1 1994/08/07 18:36:06 wollman Exp $"; #endif /* @@ -105,12 +105,12 @@ xprt_register(xprt) } /* - * De-activate a transport handle. + * De-activate a transport handle. */ void -xprt_unregister(xprt) +xprt_unregister(xprt) SVCXPRT *xprt; -{ +{ register int sock = xprt->xp_sock; #ifdef FD_SETSIZE @@ -225,15 +225,15 @@ svc_sendreply(xprt, xdr_results, xdr_location) xdrproc_t xdr_results; caddr_t xdr_location; { - struct rpc_msg rply; + struct rpc_msg rply; - rply.rm_direction = REPLY; - rply.rm_reply.rp_stat = MSG_ACCEPTED; - rply.acpted_rply.ar_verf = xprt->xp_verf; + rply.rm_direction = REPLY; + rply.rm_reply.rp_stat = MSG_ACCEPTED; + rply.acpted_rply.ar_verf = xprt->xp_verf; rply.acpted_rply.ar_stat = SUCCESS; rply.acpted_rply.ar_results.where = xdr_location; rply.acpted_rply.ar_results.proc = xdr_results; - return (SVC_REPLY(xprt, &rply)); + return (SVC_REPLY(xprt, &rply)); } /* @@ -259,13 +259,13 @@ void svcerr_decode(xprt) register SVCXPRT *xprt; { - struct rpc_msg rply; + struct rpc_msg rply; - rply.rm_direction = REPLY; - rply.rm_reply.rp_stat = MSG_ACCEPTED; + rply.rm_direction = REPLY; + rply.rm_reply.rp_stat = MSG_ACCEPTED; rply.acpted_rply.ar_verf = xprt->xp_verf; rply.acpted_rply.ar_stat = GARBAGE_ARGS; - SVC_REPLY(xprt, &rply); + SVC_REPLY(xprt, &rply); } /* @@ -275,13 +275,13 @@ void svcerr_systemerr(xprt) register SVCXPRT *xprt; { - struct rpc_msg rply; + struct rpc_msg rply; - rply.rm_direction = REPLY; - rply.rm_reply.rp_stat = MSG_ACCEPTED; + rply.rm_direction = REPLY; + rply.rm_reply.rp_stat = MSG_ACCEPTED; rply.acpted_rply.ar_verf = xprt->xp_verf; rply.acpted_rply.ar_stat = SYSTEM_ERR; - SVC_REPLY(xprt, &rply); + SVC_REPLY(xprt, &rply); } /* @@ -315,15 +315,15 @@ svcerr_weakauth(xprt) /* * Program unavailable error reply */ -void +void svcerr_noprog(xprt) register SVCXPRT *xprt; { - struct rpc_msg rply; + struct rpc_msg rply; - rply.rm_direction = REPLY; - rply.rm_reply.rp_stat = MSG_ACCEPTED; - rply.acpted_rply.ar_verf = xprt->xp_verf; + rply.rm_direction = REPLY; + rply.rm_reply.rp_stat = MSG_ACCEPTED; + rply.acpted_rply.ar_verf = xprt->xp_verf; rply.acpted_rply.ar_stat = PROG_UNAVAIL; SVC_REPLY(xprt, &rply); } @@ -331,9 +331,9 @@ svcerr_noprog(xprt) /* * Program version mismatch error reply */ -void +void svcerr_progvers(xprt, low_vers, high_vers) - register SVCXPRT *xprt; + register SVCXPRT *xprt; u_long low_vers; u_long high_vers; { @@ -358,9 +358,9 @@ svcerr_progvers(xprt, low_vers, high_vers) * the "raw" parameters (msg.rm_call.cb_cred and msg.rm_call.cb_verf) and * the "cooked" credentials (rqst->rq_clntcred). * However, this function does not know the structure of the cooked - * credentials, so it make the following assumptions: + * credentials, so it make the following assumptions: * a) the structure is contiguous (no pointers), and - * b) the cred structure size does not exceed RQCRED_SIZE bytes. + * b) the cred structure size does not exceed RQCRED_SIZE bytes. * In all events, all three parameters are freed upon exit from this routine. * The storage is trivially management on the call stack in user land, but * is mallocated in kernel land. @@ -412,7 +412,7 @@ svc_getreqset(readfds) #ifdef FD_SETSIZE - setsize = _rpc_dtablesize(); + setsize = _rpc_dtablesize(); maskp = (u_long *)readfds->fds_bits; for (sock = 0; sock < setsize; sock += NFDBITS) { for (mask = *maskp++; bit = ffs(mask); mask ^= (1 << (bit - 1))) { diff --git a/lib/libc/rpc/svc_auth.c b/lib/libc/rpc/svc_auth.c index 0a9f2765bf6a..6c1e560c2be1 100644 --- a/lib/libc/rpc/svc_auth.c +++ b/lib/libc/rpc/svc_auth.c @@ -5,11 +5,11 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)svc_auth.c 1.19 87/08/11 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)svc_auth.c 2.1 88/08/07 4.0 RPCSRC";*/ -static char *rcsid = "$Id: svc_auth.c,v 1.1 1993/10/27 05:40:56 paul Exp $"; +static char *rcsid = "$Id: svc_auth.c,v 1.1 1994/08/07 18:36:07 wollman Exp $"; #endif /* @@ -43,16 +43,16 @@ static char *rcsid = "$Id: svc_auth.c,v 1.1 1993/10/27 05:40:56 paul Exp $"; #include <rpc/rpc.h> /* - * svcauthsw is the bdevsw of server side authentication. - * + * svcauthsw is the bdevsw of server side authentication. + * * Server side authenticators are called from authenticate by * using the client auth struct flavor field to index into svcauthsw. - * The server auth flavors must implement a routine that looks - * like: - * + * The server auth flavors must implement a routine that looks + * like: + * * enum auth_stat * flavorx_auth(rqst, msg) - * register struct svc_req *rqst; + * register struct svc_req *rqst; * register struct rpc_msg *msg; * */ diff --git a/lib/libc/rpc/svc_auth_unix.c b/lib/libc/rpc/svc_auth_unix.c index 5cf825f6f8ab..d7d342405fd7 100644 --- a/lib/libc/rpc/svc_auth_unix.c +++ b/lib/libc/rpc/svc_auth_unix.c @@ -5,23 +5,23 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)svc_auth_unix.c 1.28 88/02/08 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)svc_auth_unix.c 2.3 88/08/01 4.0 RPCSRC";*/ -static char *rcsid = "$Id: svc_auth_unix.c,v 1.1 1993/10/27 05:40:58 paul Exp $"; +static char *rcsid = "$Id: svc_auth_unix.c,v 1.1 1994/08/07 18:36:08 wollman Exp $"; #endif /* @@ -127,7 +127,7 @@ done: * Looks up longhand in a cache. */ /*ARGSUSED*/ -enum auth_stat +enum auth_stat _svcauth_short(rqst, msg) struct svc_req *rqst; struct rpc_msg *msg; diff --git a/lib/libc/rpc/svc_raw.c b/lib/libc/rpc/svc_raw.c index e34ea9e32608..8f0694be6335 100644 --- a/lib/libc/rpc/svc_raw.c +++ b/lib/libc/rpc/svc_raw.c @@ -5,23 +5,23 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)svc_raw.c 1.15 87/08/11 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)svc_raw.c 2.1 88/07/29 4.0 RPCSRC";*/ -static char *rcsid = "$Id: svc_raw.c,v 1.1 1993/10/27 05:40:59 paul Exp $"; +static char *rcsid = "$Id: svc_raw.c,v 1.1 1994/08/07 18:36:08 wollman Exp $"; #endif /* @@ -151,7 +151,7 @@ svcraw_freeargs(xprt, xdr_args, args_ptr) SVCXPRT *xprt; xdrproc_t xdr_args; caddr_t args_ptr; -{ +{ register struct svcraw_private *srp = svcraw_private; register XDR *xdrs; @@ -160,7 +160,7 @@ svcraw_freeargs(xprt, xdr_args, args_ptr) xdrs = &srp->xdr_stream; xdrs->x_op = XDR_FREE; return ((*xdr_args)(xdrs, args_ptr)); -} +} static void svcraw_destroy() diff --git a/lib/libc/rpc/svc_run.c b/lib/libc/rpc/svc_run.c index 52fddf226382..730acd3f1907 100644 --- a/lib/libc/rpc/svc_run.c +++ b/lib/libc/rpc/svc_run.c @@ -5,23 +5,23 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)svc_run.c 1.1 87/10/13 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)svc_run.c 2.1 88/07/29 4.0 RPCSRC";*/ -static char *rcsid = "$Id: svc_run.c,v 1.1 1993/10/27 05:41:00 paul Exp $"; +static char *rcsid = "$Id: svc_run.c,v 1.1 1994/08/07 18:36:09 wollman Exp $"; #endif /* diff --git a/lib/libc/rpc/svc_simple.c b/lib/libc/rpc/svc_simple.c index eacf859f5ca9..75125b39a3a0 100644 --- a/lib/libc/rpc/svc_simple.c +++ b/lib/libc/rpc/svc_simple.c @@ -5,23 +5,23 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -30,10 +30,10 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)svc_simple.c 1.18 87/08/11 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)svc_simple.c 2.2 88/08/01 4.0 RPCSRC";*/ -static char *rcsid = "$Id: svc_simple.c,v 1.1 1993/10/27 05:41:01 paul Exp $"; +static char *rcsid = "$Id: svc_simple.c,v 1.1 1994/08/07 18:36:10 wollman Exp $"; #endif -/* +/* * svc_simple.c * Simplified front end to rpc. * @@ -60,7 +60,7 @@ registerrpc(prognum, versnum, procnum, progname, inproc, outproc) char *(*progname)(); xdrproc_t inproc, outproc; { - + if (procnum == NULLPROC) { (void) fprintf(stderr, "can't reassign procedure number %d\n", NULLPROC); @@ -74,7 +74,7 @@ registerrpc(prognum, versnum, procnum, progname, inproc, outproc) } } (void) pmap_unset((u_long)prognum, (u_long)versnum); - if (!svc_register(transp, (u_long)prognum, (u_long)versnum, + if (!svc_register(transp, (u_long)prognum, (u_long)versnum, universal, IPPROTO_UDP)) { (void) fprintf(stderr, "couldn't register prog %d vers %d\n", prognum, versnum); @@ -105,7 +105,7 @@ universal(rqstp, transp) char xdrbuf[UDPMSGSIZE]; struct proglst *pl; - /* + /* * enforce "procnum 0 is echo" convention */ if (rqstp->rq_proc == NULLPROC) { diff --git a/lib/libc/rpc/svc_tcp.c b/lib/libc/rpc/svc_tcp.c index 9d19504858fb..6c20de9cc247 100644 --- a/lib/libc/rpc/svc_tcp.c +++ b/lib/libc/rpc/svc_tcp.c @@ -5,23 +5,23 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -30,11 +30,11 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)svc_tcp.c 1.21 87/08/11 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)svc_tcp.c 2.2 88/08/01 4.0 RPCSRC";*/ -static char *rcsid = "$Id: svc_tcp.c,v 1.1 1993/10/27 05:41:02 paul Exp $"; +static char *rcsid = "$Id: svc_tcp.c,v 1.1 1994/08/07 18:36:11 wollman Exp $"; #endif /* - * svc_tcp.c, Server side for TCP/IP based RPC. + * svc_tcp.c, Server side for TCP/IP based RPC. * * Copyright (C) 1984, Sun Microsystems, Inc. * @@ -195,7 +195,7 @@ makefd_xprt(fd, sendsize, recvsize) { register SVCXPRT *xprt; register struct tcp_conn *cd; - + xprt = (SVCXPRT *)mem_alloc(sizeof(SVCXPRT)); if (xprt == (SVCXPRT *)NULL) { (void) fprintf(stderr, "svc_tcp: makefd_xprt: out of memory\n"); @@ -306,7 +306,7 @@ readtcp(xprt, buf, len) #endif /* def FD_SETSIZE */ do { readfds = mask; - if (select(_rpc_dtablesize(), &readfds, (int*)NULL, (int*)NULL, + if (select(_rpc_dtablesize(), &readfds, (int*)NULL, (int*)NULL, &wait_per_try) <= 0) { if (errno == EINTR) { continue; diff --git a/lib/libc/rpc/svc_udp.c b/lib/libc/rpc/svc_udp.c index e69318ca2f69..58a90fa6e0fe 100644 --- a/lib/libc/rpc/svc_udp.c +++ b/lib/libc/rpc/svc_udp.c @@ -5,23 +5,23 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)svc_udp.c 1.24 87/08/11 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)svc_udp.c 2.2 88/07/29 4.0 RPCSRC";*/ -static char *rcsid = "$Id: svc_udp.c,v 1.1 1994/08/07 18:36:12 wollman Exp $"; +static char *rcsid = "$Id: svc_udp.c,v 1.2 1994/08/31 12:38:18 csgr Exp $"; #endif /* @@ -164,7 +164,7 @@ svcudp_stat(xprt) SVCXPRT *xprt; { - return (XPRT_IDLE); + return (XPRT_IDLE); } static bool_t @@ -204,8 +204,8 @@ svcudp_recv(xprt, msg) static bool_t svcudp_reply(xprt, msg) - register SVCXPRT *xprt; - struct rpc_msg *msg; + register SVCXPRT *xprt; + struct rpc_msg *msg; { register struct svcudp_data *su = su_data(xprt); register XDR *xdrs = &(su->su_xdrs); @@ -284,7 +284,7 @@ svcudp_destroy(xprt) (type *) mem_alloc((unsigned) (sizeof(type) * (size))) #define BZERO(addr, type, size) \ - bzero((char *) addr, sizeof(type) * (int) (size)) + bzero((char *) addr, sizeof(type) * (int) (size)) /* * An entry in the cache @@ -307,7 +307,7 @@ struct cache_node { /* * Next node on the list, if there is a collision */ - cache_ptr cache_next; + cache_ptr cache_next; }; @@ -331,11 +331,11 @@ struct udp_cache { * the hashing function */ #define CACHE_LOC(transp, xid) \ - (xid % (SPARSENESS*((struct udp_cache *) su_data(transp)->su_cache)->uc_size)) + (xid % (SPARSENESS*((struct udp_cache *) su_data(transp)->su_cache)->uc_size)) /* - * Enable use of the cache. + * Enable use of the cache. * Note: there is no disable. */ svcudp_enablecache(transp, size) @@ -347,7 +347,7 @@ svcudp_enablecache(transp, size) if (su->su_cache != NULL) { CACHE_PERROR("enablecache: cache already enabled"); - return(0); + return(0); } uc = ALLOC(struct udp_cache, 1); if (uc == NULL) { @@ -379,9 +379,9 @@ svcudp_enablecache(transp, size) static void cache_set(xprt, replylen) SVCXPRT *xprt; - u_long replylen; + u_long replylen; { - register cache_ptr victim; + register cache_ptr victim; register cache_ptr *vicp; register struct svcudp_data *su = su_data(xprt); struct udp_cache *uc = (struct udp_cache *) su->su_cache; @@ -395,9 +395,9 @@ cache_set(xprt, replylen) victim = uc->uc_fifo[uc->uc_nextvictim]; if (victim != NULL) { loc = CACHE_LOC(xprt, victim->cache_xid); - for (vicp = &uc->uc_entries[loc]; - *vicp != NULL && *vicp != victim; - vicp = &(*vicp)->cache_next) + for (vicp = &uc->uc_entries[loc]; + *vicp != NULL && *vicp != victim; + vicp = &(*vicp)->cache_next) ; if (*vicp == NULL) { CACHE_PERROR("cache_set: victim not found"); @@ -431,7 +431,7 @@ cache_set(xprt, replylen) victim->cache_prog = uc->uc_prog; victim->cache_addr = uc->uc_addr; loc = CACHE_LOC(xprt, victim->cache_xid); - victim->cache_next = uc->uc_entries[loc]; + victim->cache_next = uc->uc_entries[loc]; uc->uc_entries[loc] = victim; uc->uc_fifo[uc->uc_nextvictim++] = victim; uc->uc_nextvictim %= uc->uc_size; diff --git a/lib/libc/stdio/Makefile.inc b/lib/libc/stdio/Makefile.inc index 04b01838a2c6..5ca501621a49 100644 --- a/lib/libc/stdio/Makefile.inc +++ b/lib/libc/stdio/Makefile.inc @@ -32,7 +32,7 @@ MLINKS+=getc.3 fgetc.3 getc.3 getchar.3 getc.3 getw.3 MLINKS+=mktemp.3 mkstemp.3 MLINKS+=printf.3 fprintf.3 printf.3 snprintf.3 printf.3 sprintf.3 \ printf.3 vfprintf.3 printf.3 vprintf.3 printf.3 vsnprintf.3 \ - printf.3 vsprintf.3 + printf.3 vsprintf.3 MLINKS+=putc.3 fputc.3 putc.3 putchar.3 putc.3 putw.3 MLINKS+=scanf.3 fscanf.3 scanf.3 sscanf.3 scanf.3 vfscanf.3 scanf.3 vscanf.3 \ scanf.3 vsscanf.3 diff --git a/lib/libc/stdio/freopen.c b/lib/libc/stdio/freopen.c index 88dd03c89986..7a8a3efeb842 100644 --- a/lib/libc/stdio/freopen.c +++ b/lib/libc/stdio/freopen.c @@ -47,8 +47,8 @@ static char sccsid[] = "@(#)freopen.c 8.1 (Berkeley) 6/4/93"; #include <stdlib.h> #include "local.h" -/* - * Re-direct an existing, open (probably) file to some other file. +/* + * Re-direct an existing, open (probably) file to some other file. * ANSI is written such that the original file gets closed if at * all possible, no matter what. */ diff --git a/lib/libc/stdio/stdio.c b/lib/libc/stdio/stdio.c index 78993877daf8..c2d7d874632a 100644 --- a/lib/libc/stdio/stdio.c +++ b/lib/libc/stdio/stdio.c @@ -54,7 +54,7 @@ __sread(cookie, buf, n) { register FILE *fp = cookie; register int ret; - + ret = read(fp->_file, buf, n); /* if the read succeeded, update the current offset */ if (ret >= 0) @@ -85,7 +85,7 @@ __sseek(cookie, offset, whence) { register FILE *fp = cookie; register off_t ret; - + ret = lseek(fp->_file, (off_t)offset, whence); if (ret == -1L) fp->_flags &= ~__SOFF; diff --git a/lib/libc/stdio/vfprintf.c b/lib/libc/stdio/vfprintf.c index 94e65cd5433b..f53db612ff60 100644 --- a/lib/libc/stdio/vfprintf.c +++ b/lib/libc/stdio/vfprintf.c @@ -537,7 +537,7 @@ fp_begin: if (prec == -1) ch = (ch == 'g') ? 'e' : 'E'; else ch = 'g'; - } + } if (ch <= 'e') { /* 'e' or 'E' fmt */ --expt; expsize = exponent(expstr, expt, ch); @@ -803,8 +803,8 @@ cvt(value, ndigits, flags, sign, decpt, ch, length) mode = 3; /* ndigits after the decimal point */ else { /* - * To obtain ndigits after the decimal point for the 'e' - * and 'E' formats, round to ndigits + 1 significant + * To obtain ndigits after the decimal point for the 'e' + * and 'E' formats, round to ndigits + 1 significant * figures. */ if (ch == 'e' || ch == 'E') diff --git a/lib/libc/stdlib/getsubopt.c b/lib/libc/stdlib/getsubopt.c index d0ebde2b4aa3..afd577ad933a 100644 --- a/lib/libc/stdlib/getsubopt.c +++ b/lib/libc/stdlib/getsubopt.c @@ -80,7 +80,7 @@ getsubopt(optionp, tokens, valuep) *p = '\0'; for (*valuep = ++p; *p && *p != ',' && *p != ' ' && *p != '\t'; ++p); - if (*p) + if (*p) *p++ = '\0'; } else *p++ = '\0'; diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c index ea8f092a7176..26a2b54687e2 100644 --- a/lib/libc/stdlib/malloc.c +++ b/lib/libc/stdlib/malloc.c @@ -39,9 +39,9 @@ static char sccsid[] = "@(#)malloc.c 8.1 (Berkeley) 6/4/93"; * malloc.c (Caltech) 2/21/82 * Chris Kingsley, kingsley@cit-20. * - * This is a very fast storage allocator. It allocates blocks of a small + * This is a very fast storage allocator. It allocates blocks of a small * number of different sizes, and keeps free lists of each size. Blocks that - * don't exactly fit are passed up to the next larger size. In this + * don't exactly fit are passed up to the next larger size. In this * implementation, the available sizes are 2^n-4 (or 2^n-10) bytes long. * This is designed for use in a virtual memory environment. */ @@ -257,7 +257,7 @@ morecore(bucket) void free(cp) void *cp; -{ +{ register int size; register union overhead *op; @@ -298,9 +298,9 @@ int __realloc_srchlen = 4; /* 4 should be plenty, -1 =>'s whole list */ void * realloc(cp, nbytes) - void *cp; + void *cp; size_t nbytes; -{ +{ register u_int onb; register int i; union overhead *op; @@ -389,7 +389,7 @@ findbucket(freep, srchlen) #ifdef MSTATS /* * mstats - print out statistics about malloc - * + * * Prints two lines of numbers, one showing the length of the free list * for each size category, the second showing the number of mallocs - * frees for each size category. diff --git a/lib/libc/stdlib/merge.c b/lib/libc/stdlib/merge.c index 7d008445504d..a47e3007290e 100644 --- a/lib/libc/stdlib/merge.c +++ b/lib/libc/stdlib/merge.c @@ -80,7 +80,7 @@ static void insertionsort __P((u_char *, size_t, size_t, int (*)())); do \ *dst++ = *src++; \ while (i -= 1) - + /* * Find the next possible pointer head. (Trickery for forcing an array * to do double duty as a linked list when objects do not align with word @@ -164,7 +164,7 @@ EXPONENTIAL: for (i = size; ; i <<= 1) } else if ((*cmp)(q, p) <= sense) { t = p; if (i == size) - big = 0; + big = 0; goto FASTCASE; } else b = p; diff --git a/lib/libc/stdlib/qsort.c b/lib/libc/stdlib/qsort.c index 1d3aa93e0fc9..49f53495a10a 100644 --- a/lib/libc/stdlib/qsort.c +++ b/lib/libc/stdlib/qsort.c @@ -65,7 +65,7 @@ swapfunc(a, b, n, swaptype) char *a, *b; int n, swaptype; { - if(swaptype <= 1) + if(swaptype <= 1) swapcode(long, a, b, n) else swapcode(char, a, b, n) @@ -151,7 +151,7 @@ loop: SWAPINIT(a, es); } if (swap_cnt == 0) { /* Switch to insertion sort */ for (pm = a + es; pm < (char *) a + n * es; pm += es) - for (pl = pm; pl > (char *) a && cmp(pl - es, pl) > 0; + for (pl = pm; pl > (char *) a && cmp(pl - es, pl) > 0; pl -= es) swap(pl, pl - es); return; @@ -164,7 +164,7 @@ loop: SWAPINIT(a, es); vecswap(pb, pn - r, r); if ((r = pb - pa) > es) qsort(a, r / es, es, cmp); - if ((r = pd - pc) > es) { + if ((r = pd - pc) > es) { /* Iterate rather than recurse to save stack space */ a = pn - r; n = r / es; diff --git a/lib/libc/stdlib/radixsort.c b/lib/libc/stdlib/radixsort.c index d211f3d6396d..af47fb06ce76 100644 --- a/lib/libc/stdlib/radixsort.c +++ b/lib/libc/stdlib/radixsort.c @@ -3,7 +3,7 @@ * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by - * Peter McIlroy and by Dan Bernstein at New York University, + * Peter McIlroy and by Dan Bernstein at New York University, * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -40,13 +40,13 @@ static char sccsid[] = "@(#)radixsort.c 8.1 (Berkeley) 6/4/93"; /* * Radixsort routines. - * + * * Program r_sort_a() is unstable but uses O(logN) extra memory for a stack. * Use radixsort(a, n, trace, endchar) for this case. - * + * * For stable sorting (using N extra pointers) use sradixsort(), which calls * r_sort_b(). - * + * * For a description of this code, see D. McIlroy, P. McIlroy, K. Bostic, * "Engineering Radix Sort". */ @@ -294,7 +294,7 @@ r_sort_b(a, ta, n, i, tr, endch) *--top[tr[(*ak)[i]]] = *ak; } } - + static inline void simplesort(a, n, b, tr, endch) /* insertion sort */ register const u_char **a; diff --git a/lib/libc/stdlib/random.c b/lib/libc/stdlib/random.c index 0928a86e60ae..fa89f82fd836 100644 --- a/lib/libc/stdlib/random.c +++ b/lib/libc/stdlib/random.c @@ -61,7 +61,7 @@ static char sccsid[] = "@(#)random.c 8.1 (Berkeley) 6/4/93"; * state information, which will allow a degree seven polynomial. (Note: * the zeroeth word of state information also has some other information * stored in it -- see setstate() for details). - * + * * The random number generation technique is a linear feedback shift register * approach, employing trinomials (since there are fewer terms to sum up that * way). In this approach, the least significant bit of all the numbers in @@ -216,12 +216,12 @@ srandom(x) * the break values for the different R.N.G.'s, we choose the best (largest) * one we can and set things up for it. srandom() is then called to * initialize the state information. - * + * * Note that on return from srandom(), we set state[-1] to be the type * multiplexed with the current value of the rear pointer; this is so * successive calls to initstate() won't lose this information and will be * able to restart with setstate(). - * + * * Note: the first thing we do is save the current state, if any, just like * setstate() so that it doesn't matter when initstate is called. * diff --git a/lib/libc/stdlib/setenv.c b/lib/libc/stdlib/setenv.c index b36d6734fa53..4a28f25ef93e 100644 --- a/lib/libc/stdlib/setenv.c +++ b/lib/libc/stdlib/setenv.c @@ -39,7 +39,7 @@ static char sccsid[] = "@(#)setenv.c 8.1 (Berkeley) 6/4/93"; #include <stdlib.h> #include <string.h> -char *__findenv __P((const char *, int *)); +char *__findenv __P((const char *, int *)); /* * setenv -- diff --git a/lib/libc/stdlib/strhash.c b/lib/libc/stdlib/strhash.c index 77bc02ef0c64..0b50ce020fdd 100644 --- a/lib/libc/stdlib/strhash.c +++ b/lib/libc/stdlib/strhash.c @@ -1,5 +1,5 @@ #ifndef lint -static char *rcsid = "$Header: /home/ncvs/src/lib/libc/stdlib/strhash.c,v 1.2 1995/03/26 19:32:24 ache Exp $"; +static char *rcsid = "$Header: /home/ncvs/src/lib/libc/stdlib/strhash.c,v 1.3 1995/03/28 08:41:02 jkh Exp $"; #endif /* @@ -12,12 +12,12 @@ static char *rcsid = "$Header: /home/ncvs/src/lib/libc/stdlib/strhash.c,v 1.2 19 * * * All rights reserved. - * + * * This is unsupported software and is subject to change without notice. * the author makes no representations about the suitability of this software * for any purpose. It is supplied "as is" without express or implied * warranty. - * + * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, provided * that the above copyright notice appear in all copies and that both that @@ -32,11 +32,18 @@ static char *rcsid = "$Header: /home/ncvs/src/lib/libc/stdlib/strhash.c,v 1.2 19 * This is a fairly simple open addressing hash scheme. * Terry did all the code, I just did the spec. * Thanks again, you crazy Aussie.. - * + * */ /* * $Log: strhash.c,v $ + * Revision 1.3 1995/03/28 08:41:02 jkh + * Fix a missing _hash() to prevent namespace pollution with the db/hash routines. + * Grrr. If the dbhash routines weren't grossly overengineered I wouldn't + * even need to do this! :-( + * + * Also now export the hash_stats routine. Manpage coming RSN - I promise. + * * Revision 1.2 1995/03/26 19:32:24 ache * Hash 8bit chars without sign extension * @@ -53,35 +60,35 @@ static char *rcsid = "$Header: /home/ncvs/src/lib/libc/stdlib/strhash.c,v 1.2 19 * * Revision 2.0 90/03/26 01:44:26 jkh * pre-beta check-in - * + * * Revision 1.8 90/03/09 19:22:35 jkh * Fixed bogus comment. - * + * * Revision 1.7 90/03/09 19:01:08 jkh * Added comments, GPL. - * + * * Revision 1.6 90/03/08 17:55:58 terry * Rearranged hash_purge to be a tiny bit more efficient. * Added verbose option to hash_stats. - * + * * Revision 1.5 90/03/08 17:19:54 terry * Added hash_purge. Added arg to hash_traverse. Changed all * void * to Generic. - * + * * Revision 1.4 90/03/08 12:02:35 terry * Fixed problems with allocation that I screwed up last night. * Changed bucket lists to be singly linked. Thanks to JKH, my hero. - * + * * Revision 1.3 90/03/07 21:33:33 terry * Cleaned up a few decls to keep gcc -Wall quiet. - * + * * Revision 1.2 90/03/07 21:14:53 terry * Comments. Added HASH_STATS define. Removed hash_find() * and new_node(). - * + * * Revision 1.1 90/03/07 20:49:45 terry * Initial revision - * + * * */ @@ -112,26 +119,26 @@ static hash_node *list_find(caddr_t key, hash_node *head); hash_table * hash_create(int size) { - register int i; + register int i; hash_table *new = (hash_table *)malloc(sizeof(hash_table)); if (!new || size < 0){ return HASH_NULL; } - + if (size == 0){ size = HASH_SZ; } - + if (!(new->buckets = (hash_node **)malloc(size * sizeof(hash_node *)))){ return HASH_NULL; } for (i = 0; i < size; i++){ new->buckets[i] = NODE_NULL; - } + } new->size = size; - + return new; } @@ -166,7 +173,7 @@ _hash(int size, char *key) while (*key){ h = (h << 1) ^ (h ^ (unsigned char) *key++); - } + } h %= size; return h; @@ -179,17 +186,17 @@ _hash(int size, char *key) * The function (*nukefunc)() is in charge of disposing * of the storage help by the data associated with the node. */ -void +void hash_destroy(hash_table *table, char *key, void (*nukefunc)()) { int bucket = _hash(table->size, key); hash_node *found = table->buckets[bucket]; hash_node *to_free = NODE_NULL; - + if (!found) { return; } - + if (!strcmp(found->key, key)) { /* * It was the head of the list. @@ -209,12 +216,12 @@ hash_destroy(hash_table *table, char *key, void (*nukefunc)()) } found = found->next; } - + if (!to_free){ return; } } - + if (nukefunc) (*nukefunc)(to_free->key, to_free->data); free(to_free); @@ -227,8 +234,8 @@ hash_destroy(hash_table *table, char *key, void (*nukefunc)()) * * Search the table for the given key. Then: * - * 1) If you find it and there is no replacement function, just - * return what you found. (This is a simple search). + * 1) If you find it and there is no replacement function, just + * return what you found. (This is a simple search). * 2) If you find it and there is a replacement function, run * the function on the data you found, and replace the old * data with whatever is passed in datum. Return 0. @@ -256,11 +263,11 @@ hash_search(hash_table *table, caddr_t key, void *datum, } else{ if (datum){ - + static int assign_key(); - + hash_node *new = (hash_node *)malloc(sizeof(hash_node)); - + if (!new || !assign_key(key, new)){ return GENERIC_NULL; } @@ -276,7 +283,7 @@ hash_search(hash_table *table, caddr_t key, void *datum, /* * assign_key() * - * Set the key value of a node to be 'key'. Get some space from + * Set the key value of a node to be 'key'. Get some space from * malloc and copy it in etc. Return 1 if all is well, 0 otherwise. */ static int @@ -285,11 +292,11 @@ assign_key(char *key, hash_node *node) if (!node || !key){ return 0; } - + if (!(node->key = (char *)malloc(strlen(key) + 1))){ return 0; } - + node->key[0] = '\0'; strcat(node->key, key); return 1; @@ -304,12 +311,12 @@ assign_key(char *key, hash_node *node) void hash_traverse(hash_table *table, int (*func)(), void *arg) { - register int i; + register int i; register int size = table->size; if (!func) return; - + for (i = 0; i < size; i++) { hash_node *n = table->buckets[i]; while (n) { @@ -317,7 +324,7 @@ hash_traverse(hash_table *table, int (*func)(), void *arg) return; n = n->next; } - } + } return; } @@ -331,9 +338,9 @@ hash_traverse(hash_table *table, int (*func)(), void *arg) void hash_purge(hash_table *table, void (*purge_func)(char *p1, void *p2)) { - register int i; + register int i; register int size = table->size; - + for (i = 0; i < size; i++) { hash_node *n = table->buckets[i]; if (n) { @@ -347,7 +354,7 @@ hash_purge(hash_table *table, void (*purge_func)(char *p1, void *p2)) } while (n); table->buckets[i] = NODE_NULL; } - } + } } #undef min @@ -361,19 +368,19 @@ hash_purge(hash_table *table, void (*purge_func)(char *p1, void *p2)) void hash_stats(hash_table *table, int verbose) { - register int i; + register int i; int total_elements = 0; int non_empty_buckets = 0; int max_count = 0; int max_repeats = 0; int *counts; int size = table->size; - + if (!(counts = (int *)malloc(size * sizeof(int)))){ fprintf(stderr, "malloc returns 0\n"); - exit(1); + exit(1); } - + for (i = 0; i < size; i++){ int x = 0; hash_node *n = table->buckets[i]; @@ -392,7 +399,7 @@ hash_stats(hash_table *table, int verbose) counts[i]++; n = n->next; } - + total_elements += counts[i]; if (counts[i] > max_count){ max_count = counts[i]; @@ -401,17 +408,17 @@ hash_stats(hash_table *table, int verbose) else if (counts[i] == max_count){ max_repeats++; } - + if (counts[i] && verbose){ printf(" (%d)\n", counts[i]); } - } - + } + printf("\n"); printf("%d element%s in storage.\n", total_elements, total_elements == 1 ? "" : "s"); - + if (total_elements){ - printf("%d of %d (%.2f%%) buckets are in use\n", non_empty_buckets, size, + printf("%d of %d (%.2f%%) buckets are in use\n", non_empty_buckets, size, (double)100 * (double)non_empty_buckets / (double)(size)); printf("the maximum number of elements in a bucket is %d (%d times)\n", max_count, max_repeats); printf("average per bucket is %f\n", (double)total_elements / (double)non_empty_buckets); diff --git a/lib/libc/stdlib/strtoull.c b/lib/libc/stdlib/strtoull.c index cc62a076ca4e..ee1e13b7d7c2 100644 --- a/lib/libc/stdlib/strtoull.c +++ b/lib/libc/stdlib/strtoull.c @@ -70,7 +70,7 @@ strtouq(nptr, endptr, base) if (c == '-') { neg = 1; c = *s++; - } else { + } else { neg = 0; if (c == '+') c = *s++; diff --git a/lib/libc/stdlib/strtouq.c b/lib/libc/stdlib/strtouq.c index cc62a076ca4e..ee1e13b7d7c2 100644 --- a/lib/libc/stdlib/strtouq.c +++ b/lib/libc/stdlib/strtouq.c @@ -70,7 +70,7 @@ strtouq(nptr, endptr, base) if (c == '-') { neg = 1; c = *s++; - } else { + } else { neg = 0; if (c == '+') c = *s++; diff --git a/lib/libc/stdtime/localtime.c b/lib/libc/stdtime/localtime.c index aafb75194718..e0a7e9a84f7c 100644 --- a/lib/libc/stdtime/localtime.c +++ b/lib/libc/stdtime/localtime.c @@ -1153,7 +1153,7 @@ int * number; int delta; { int number0; - + number0 = *number; *number += delta; return (*number < number0) != (delta < 0); diff --git a/lib/libc/string/memset.c b/lib/libc/string/memset.c index 9c28b7b81a38..99c72dcb0700 100644 --- a/lib/libc/string/memset.c +++ b/lib/libc/string/memset.c @@ -84,7 +84,7 @@ memset(dst0, c0, length) * * but we use a minimum of 3 here since the overhead of the code * to do word writes is substantial. - */ + */ if (length < 3 * wsize) { while (length != 0) { *dst++ = VAL; diff --git a/lib/libc/string/strsep.c b/lib/libc/string/strsep.c index 18dc3987e67e..ddad5964ce19 100644 --- a/lib/libc/string/strsep.c +++ b/lib/libc/string/strsep.c @@ -41,7 +41,7 @@ static char sccsid[] = "@(#)strsep.c 8.1 (Berkeley) 6/4/93"; /* * Get next token from string *stringp, where tokens are possibly-empty - * strings separated by characters from delim. + * strings separated by characters from delim. * * Writes NULs into the string at *stringp to end tokens. * delim need not remain constant from call to call. diff --git a/lib/libc/xdr/Makefile.inc b/lib/libc/xdr/Makefile.inc index b85f2eb12832..fc85212184d1 100644 --- a/lib/libc/xdr/Makefile.inc +++ b/lib/libc/xdr/Makefile.inc @@ -6,5 +6,5 @@ SRCS+= xdr.c xdr_array.c xdr_mem.c \ MAN3+= xdr/xdr.3 -UNSUPPORTED+= xdr_float.c +UNSUPPORTED+= xdr_float.c diff --git a/lib/libc/xdr/xdr.c b/lib/libc/xdr/xdr.c index 9f402047aa5a..92d75929b096 100644 --- a/lib/libc/xdr/xdr.c +++ b/lib/libc/xdr/xdr.c @@ -5,23 +5,23 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)xdr.c 1.35 87/08/12";*/ /*static char *sccsid = "from: @(#)xdr.c 2.1 88/07/29 4.0 RPCSRC";*/ -static char *rcsid = "$Id: xdr.c,v 1.1 1993/10/27 05:41:06 paul Exp $"; +static char *rcsid = "$Id: xdr.c,v 1.1 1994/08/07 18:39:30 wollman Exp $"; #endif /* @@ -70,7 +70,7 @@ xdr_free(proc, objp) char *objp; { XDR x; - + x.x_op = XDR_FREE; (*proc)(&x, objp); } @@ -562,8 +562,8 @@ xdr_string(xdrs, cpp, maxsize) return (FALSE); } -/* - * Wrapper for xdr_string that can be called directly from +/* + * Wrapper for xdr_string that can be called directly from * routines like clnt_call */ bool_t diff --git a/lib/libc/xdr/xdr_array.c b/lib/libc/xdr/xdr_array.c index a17b534a92e7..47cc0afcb380 100644 --- a/lib/libc/xdr/xdr_array.c +++ b/lib/libc/xdr/xdr_array.c @@ -5,23 +5,23 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)xdr_array.c 1.10 87/08/11 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)xdr_array.c 2.1 88/07/29 4.0 RPCSRC";*/ -static char *rcsid = "$Id: xdr_array.c,v 1.1 1993/10/27 05:41:09 paul Exp $"; +static char *rcsid = "$Id: xdr_array.c,v 1.1 1994/08/07 18:39:31 wollman Exp $"; #endif /* @@ -93,7 +93,7 @@ xdr_array(xdrs, addrp, sizep, maxsize, elsize, elproc) return (TRUE); *addrp = target = mem_alloc(nodesize); if (target == NULL) { - (void) fprintf(stderr, + (void) fprintf(stderr, "xdr_array: out of memory\n"); return (FALSE); } @@ -103,7 +103,7 @@ xdr_array(xdrs, addrp, sizep, maxsize, elsize, elproc) case XDR_FREE: return (TRUE); } - + /* * now we xdr each element of array */ @@ -138,7 +138,7 @@ xdr_vector(xdrs, basep, nelem, elemsize, xdr_elem) register char *basep; register u_int nelem; register u_int elemsize; - register xdrproc_t xdr_elem; + register xdrproc_t xdr_elem; { register u_int i; register char *elptr; @@ -150,6 +150,6 @@ xdr_vector(xdrs, basep, nelem, elemsize, xdr_elem) } elptr += elemsize; } - return(TRUE); + return(TRUE); } diff --git a/lib/libc/xdr/xdr_float.c b/lib/libc/xdr/xdr_float.c index fae0c8b7f8e3..105ca43bbfad 100644 --- a/lib/libc/xdr/xdr_float.c +++ b/lib/libc/xdr/xdr_float.c @@ -5,23 +5,23 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)xdr_float.c 1.12 87/08/11 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)xdr_float.c 2.1 88/07/29 4.0 RPCSRC";*/ -static char *rcsid = "$Id: xdr_float.c,v 1.1 1993/10/27 05:41:10 paul Exp $"; +static char *rcsid = "$Id: xdr_float.c,v 1.1 1994/08/07 18:39:32 wollman Exp $"; #endif /* @@ -103,7 +103,7 @@ xdr_float(xdrs, fp) switch (xdrs->x_op) { case XDR_ENCODE: -#ifdef IEEEFP +#ifdef IEEEFP return (XDR_PUTLONG(xdrs, (long *)fp)); #else vs = *((struct vax_single *)fp); diff --git a/lib/libc/xdr/xdr_mem.c b/lib/libc/xdr/xdr_mem.c index 3909edda4ee8..63cacf727f52 100644 --- a/lib/libc/xdr/xdr_mem.c +++ b/lib/libc/xdr/xdr_mem.c @@ -5,23 +5,23 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)xdr_mem.c 1.19 87/08/11 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)xdr_mem.c 2.1 88/07/29 4.0 RPCSRC";*/ -static char *rcsid = "$Id: xdr_mem.c,v 1.1 1993/10/27 05:41:11 paul Exp $"; +static char *rcsid = "$Id: xdr_mem.c,v 1.1 1994/08/07 18:39:33 wollman Exp $"; #endif /* @@ -71,7 +71,7 @@ static struct xdr_ops xdrmem_ops = { /* * The procedure xdrmem_create initializes a stream descriptor for a - * memory buffer. + * memory buffer. */ void xdrmem_create(xdrs, addr, size, op) diff --git a/lib/libc/xdr/xdr_rec.c b/lib/libc/xdr/xdr_rec.c index 54ed0a388834..493d4436b235 100644 --- a/lib/libc/xdr/xdr_rec.c +++ b/lib/libc/xdr/xdr_rec.c @@ -5,31 +5,31 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 */ -#if defined(LIBC_SCCS) && !defined(lint) +#if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)xdr_rec.c 1.21 87/08/11 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)xdr_rec.c 2.2 88/08/01 4.0 RPCSRC";*/ -static char *rcsid = "$Id: xdr_rec.c,v 1.1 1994/08/07 18:39:33 wollman Exp $"; +static char *rcsid = "$Id: xdr_rec.c,v 1.2 1994/08/07 22:21:14 wollman Exp $"; #endif /* @@ -45,7 +45,7 @@ static char *rcsid = "$Id: xdr_rec.c,v 1.1 1994/08/07 18:39:33 wollman Exp $"; * by n bytes of data, where n is contained in the header. The header * is represented as a htonl(u_long). Thegh order bit encodes * whether or not the fragment is the last fragment of the record - * (1 => fragment is last, 0 => more fragments to follow. + * (1 => fragment is last, 0 => more fragments to follow. * The other 31 bits encode the byte length of the fragment. */ @@ -146,8 +146,8 @@ xdrrec_create(xdrs, sendsize, recvsize, tcp_handle, readit, writeit) if (rstrm == NULL) { (void)fprintf(stderr, "xdrrec_create: out of memory\n"); - /* - * This is bad. Should rework xdrrec_create to + /* + * This is bad. Should rework xdrrec_create to * return a handle, and in this case return NULL */ return; @@ -260,7 +260,7 @@ xdrrec_getbytes(xdrs, addr, len) current = (len < current) ? len : current; if (! get_input_bytes(rstrm, addr, current)) return (FALSE); - addr += current; + addr += current; rstrm->fbtbc -= current; len -= current; } @@ -422,7 +422,7 @@ xdrrec_skiprecord(xdrs) /* * Look ahead fuction. - * Returns TRUE iff there is no more input in the buffer + * Returns TRUE iff there is no more input in the buffer * after consuming the rest of the current record. */ bool_t @@ -481,7 +481,7 @@ flush_out(rstrm, eor) bool_t eor; { register u_long eormask = (eor == TRUE) ? LAST_FRAG : 0; - register u_long len = (u_long)(rstrm->out_finger) - + register u_long len = (u_long)(rstrm->out_finger) - (u_long)(rstrm->frag_header) - sizeof(u_long); *(rstrm->frag_header) = htonl(len | eormask); diff --git a/lib/libc/xdr/xdr_reference.c b/lib/libc/xdr/xdr_reference.c index c955f8820256..d7ef28037df3 100644 --- a/lib/libc/xdr/xdr_reference.c +++ b/lib/libc/xdr/xdr_reference.c @@ -5,32 +5,32 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 */ -#if defined(LIBC_SCCS) && !defined(lint) +#if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)xdr_reference.c 1.11 87/08/11 SMI";*/ /*static char *sccsid = "from: @(#)xdr_reference.c 2.1 88/07/29 4.0 RPCSRC";*/ -static char *rcsid = "$Id: xdr_reference.c,v 1.1 1993/10/27 05:41:13 paul Exp $"; +static char *rcsid = "$Id: xdr_reference.c,v 1.1 1994/08/07 18:39:34 wollman Exp $"; #endif /* diff --git a/lib/libc/xdr/xdr_stdio.c b/lib/libc/xdr/xdr_stdio.c index 9761b13d5f2a..5cfdf205a619 100644 --- a/lib/libc/xdr/xdr_stdio.c +++ b/lib/libc/xdr/xdr_stdio.c @@ -5,23 +5,23 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)xdr_stdio.c 1.16 87/08/11 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)xdr_stdio.c 2.1 88/07/29 4.0 RPCSRC";*/ -static char *rcsid = "$Id: xdr_stdio.c,v 1.1 1993/10/27 05:41:14 paul Exp $"; +static char *rcsid = "$Id: xdr_stdio.c,v 1.1 1994/08/07 18:39:35 wollman Exp $"; #endif /* @@ -163,10 +163,10 @@ xdrstdio_getpos(xdrs) } static bool_t -xdrstdio_setpos(xdrs, pos) +xdrstdio_setpos(xdrs, pos) XDR *xdrs; u_int pos; -{ +{ return ((fseek((FILE *)xdrs->x_private, (long)pos, 0) < 0) ? FALSE : TRUE); diff --git a/lib/libc/yp/yplib.c b/lib/libc/yp/yplib.c index 4d96340ed2fd..b54292ea09d4 100644 --- a/lib/libc/yp/yplib.c +++ b/lib/libc/yp/yplib.c @@ -28,7 +28,7 @@ */ #ifndef LINT -static char *rcsid = "$Id: yplib.c,v 1.8 1995/04/26 19:03:05 wpaul Exp $"; +static char *rcsid = "$Id: yplib.c,v 1.9 1995/05/03 18:33:10 wpaul Exp $"; #endif #include <sys/param.h> @@ -291,7 +291,7 @@ skipit: bzero((char *)&clnt_sin, sizeof clnt_sin); clnt_sin.sin_family = AF_INET; clnt_sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); - + clnt_sock = RPC_ANYSOCK; client = clnttcp_create(&clnt_sin, YPBINDPROG, YPBINDVERS, &clnt_sock, 0, 0); diff --git a/lib/libcompat/4.1/getpw.c b/lib/libcompat/4.1/getpw.c index 9fc7eb1323ca..5ea696af7bdc 100644 --- a/lib/libcompat/4.1/getpw.c +++ b/lib/libcompat/4.1/getpw.c @@ -29,7 +29,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id$ + * $Id: getpw.c,v 1.1 1995/04/10 18:47:55 joerg Exp $ */ #include <sys/types.h> @@ -47,12 +47,12 @@ getpw(uid, buf) #endif { struct passwd *pw; - + pw = getpwuid(uid); endpwent(); - + if(pw == 0) return -1; - + strncpy(buf, pw->pw_name, L_cuserid); return 0; } diff --git a/lib/libcompat/4.3/rexec.c b/lib/libcompat/4.3/rexec.c index a8a7b5bfd4fe..5b1afc8d7239 100644 --- a/lib/libcompat/4.3/rexec.c +++ b/lib/libcompat/4.3/rexec.c @@ -170,7 +170,7 @@ next: continue; /* * Allow match either for user's input host name - * or official hostname. Also allow match of + * or official hostname. Also allow match of * incompletely-specified host in local domain. */ if (strcasecmp(host, tokval) == 0) @@ -187,7 +187,7 @@ next: case LOGIN: if (token()) - if (*aname == 0) { + if (*aname == 0) { *aname = malloc((unsigned) strlen(tokval) + 1); (void) strcpy(*aname, tokval); } else { @@ -335,7 +335,7 @@ retry: } else { char num[8]; int s2, sin2len; - + s2 = socket(AF_INET, SOCK_STREAM, 0); if (s2 < 0) { (void) close(s); diff --git a/lib/libcompat/regexp/regexp.c b/lib/libcompat/regexp/regexp.c index 0084295bfb37..3e8496806167 100644 --- a/lib/libcompat/regexp/regexp.c +++ b/lib/libcompat/regexp/regexp.c @@ -335,7 +335,7 @@ int *flagp; } /* Make a closing node, and hook it on the end. */ - ender = regnode((paren) ? CLOSE+parno : END); + ender = regnode((paren) ? CLOSE+parno : END); regtail(ret, ender); /* Hook the tails of the branches to the closing node. */ @@ -567,7 +567,7 @@ int *flagp; * On entry, the char at regparse[-1] is going to go * into the string, no matter what it is. (It could be * following a \ if we are entered from the '\' case.) - * + * * Basic idea is to pick up a good char in ch and * examine the next char. If it's *+? then we twiddle. * If it's \ then we frozzle. If it's other magic char @@ -622,7 +622,7 @@ int *flagp; default: /* Backup point is \, scan * point is after it. */ regprev = regparse; - regparse++; + regparse++; continue; /* NOT break; */ } } @@ -1174,7 +1174,7 @@ regexp *r; next = regnext(s); if (next == NULL) /* Next ptr. */ printf("(0)"); - else + else printf("(%d)", (s-r->program)+(next-s)); s += 3; if (op == ANYOF || op == ANYBUT || op == EXACTLY) { diff --git a/lib/libcrypt/Makefile b/lib/libcrypt/Makefile index 96b03f829c39..d4d5057297d2 100644 --- a/lib/libcrypt/Makefile +++ b/lib/libcrypt/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile,v 1.5 1994/11/07 21:07:05 phk Exp $ +# $Id: Makefile,v 1.6 1994/11/14 06:44:45 bde Exp $ # LCRYPTBASE= libcrypt @@ -18,7 +18,7 @@ CFLAGS+= -I${.CURDIR}/../libmd # This may have to be revised afterinstall: -.if !defined(NOPIC) +.if !defined(NOPIC) @cd ${DESTDIR}${SHLIBDIR}; \ if [ ! -e ${LCRYPTSO} ]; then \ rm -f ${LCRYPTSO}; \ diff --git a/lib/libcrypt/crypt.c b/lib/libcrypt/crypt.c index fd24e798fbef..0b475614b358 100644 --- a/lib/libcrypt/crypt.c +++ b/lib/libcrypt/crypt.c @@ -6,12 +6,12 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $Id$ + * $Id: crypt.c,v 1.2 1994/11/07 21:07:09 phk Exp $ * */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$Header$"; +static char rcsid[] = "$Header: /home/ncvs/src/lib/libcrypt/crypt.c,v 1.2 1994/11/07 21:07:09 phk Exp $"; #endif /* LIBC_SCCS and not lint */ #include <unistd.h> @@ -35,7 +35,7 @@ to64(s, v, n) /* * UNIX password - * + * * Use MD5 for what it is best at... */ @@ -88,7 +88,7 @@ crypt(pw, salt) MD5Update(&ctx1,sp,sl); MD5Update(&ctx1,pw,strlen(pw)); MD5Final(final,&ctx1); - for(pl = strlen(pw); pl > 0; pl -= 16) + for(pl = strlen(pw); pl > 0; pl -= 16) MD5Update(&ctx,final,pl>16 ? 16 : pl); /* Don't leave anything around in vm they could use. */ @@ -108,8 +108,8 @@ crypt(pw, salt) MD5Final(final,&ctx); - /* - * and now, just to make sure things don't run too fast + /* + * and now, just to make sure things don't run too fast * On a 60 Mhz Pentium this takes 34 msec, so you would * need 30 seconds to build a 1000 entry dictionary... */ @@ -134,7 +134,7 @@ crypt(pw, salt) } p = passwd + strlen(passwd); - + l = (final[ 0]<<16) | (final[ 6]<<8) | final[12]; to64(p,l,4); p += 4; l = (final[ 1]<<16) | (final[ 7]<<8) | final[13]; to64(p,l,4); p += 4; l = (final[ 2]<<16) | (final[ 8]<<8) | final[14]; to64(p,l,4); p += 4; diff --git a/lib/libcurses/EXAMPLES/ex1.c b/lib/libcurses/EXAMPLES/ex1.c index 76da41b4d9bb..e8a4e0ff7442 100644 --- a/lib/libcurses/EXAMPLES/ex1.c +++ b/lib/libcurses/EXAMPLES/ex1.c @@ -47,7 +47,7 @@ static char sccsid[] = "@(#)ex1.c 8.1 (Berkeley) 6/4/93"; #include <signal.h> -#define YSIZE 10 +#define YSIZE 10 #define XSIZE 20 int quit(); @@ -65,7 +65,7 @@ main() crmode(); /* We want cbreak mode */ noecho(); /* We want to have control of chars */ delwin(stdscr); /* Create our own stdscr */ - stdscr = newwin(YSIZE, XSIZE, 10, 35); + stdscr = newwin(YSIZE, XSIZE, 10, 35); flushok(stdscr, TRUE); /* Enable flushing of stdout */ scrollok(stdscr, TRUE); /* Enable scrolling */ erase(); /* Initially, clear the screen */ @@ -107,6 +107,6 @@ quit() exit(0); } - - - + + + diff --git a/lib/libcurses/PSD.doc/ex1.c b/lib/libcurses/PSD.doc/ex1.c index 02ed9b936bdd..97d8432c8bbf 100644 --- a/lib/libcurses/PSD.doc/ex1.c +++ b/lib/libcurses/PSD.doc/ex1.c @@ -37,7 +37,7 @@ #include <signal.h> -#define YSIZE 10 +#define YSIZE 10 #define XSIZE 20 int quit(); @@ -55,7 +55,7 @@ main() crmode(); /* We want cbreak mode */ noecho(); /* We want to have control of chars */ delwin(stdscr); /* Create our own stdscr */ - stdscr = newwin(YSIZE, XSIZE, 10, 35); + stdscr = newwin(YSIZE, XSIZE, 10, 35); flushok(stdscr, TRUE); /* Enable flushing of stdout */ scrollok(stdscr, TRUE); /* Enable scrolling */ erase(); /* Initially, clear the screen */ @@ -97,6 +97,6 @@ quit() exit(0); } - - - + + + diff --git a/lib/libcurses/PSD.doc/ex2.c b/lib/libcurses/PSD.doc/ex2.c index 13e8f2990b99..7b23b61ebf83 100644 --- a/lib/libcurses/PSD.doc/ex2.c +++ b/lib/libcurses/PSD.doc/ex2.c @@ -52,7 +52,7 @@ main() char id[100]; int hh = 0; int curx, cury, base, arg; - + initscr(); signal(SIGINT, quit); crmode(); @@ -181,7 +181,7 @@ main() insertln(); sprintf(id, "%d: ", base); addstr(id); - for (j = 0; j < XSIZE - strlen(id) - 2; j++) + for (j = 0; j < XSIZE - strlen(id) - 2; j++) addch('0' + (base % 10)); cury++; } else if (cury >= YSIZE) { diff --git a/lib/libcurses/PSD.doc/life.c b/lib/libcurses/PSD.doc/life.c index 72febba29ae7..5ecd07f84c43 100644 --- a/lib/libcurses/PSD.doc/life.c +++ b/lib/libcurses/PSD.doc/life.c @@ -128,7 +128,7 @@ getstart() if (Head != NULL) /* start new list */ dellist(Head); - Head = malloc(sizeof (LIST)); + Head = malloc(sizeof (LIST)); /* * loop through the screen looking for 'x's, and add a list diff --git a/lib/libcurses/addbytes.c b/lib/libcurses/addbytes.c index 6dd8bf959b57..39124a063d7e 100644 --- a/lib/libcurses/addbytes.c +++ b/lib/libcurses/addbytes.c @@ -75,7 +75,7 @@ __waddbytes(win, bytes, count, so) #ifdef DEBUG __CTRACE("ADDBYTES(%0.2o, %d, %d)\n", win, y, x); #endif - + lp = win->lines[y]; if (lp->flags & __ISPASTEOL) { lp->flags &= ~__ISPASTEOL; @@ -96,7 +96,7 @@ newline: if (y == win->maxy - 1) { if (c == '\n') break; } - + stand = '\0'; if (win->flags & __WSTANDOUT || so) stand |= __STANDOUT; @@ -104,7 +104,7 @@ newline: if (y == win->maxy - 1) { __CTRACE("ADDBYTES: 1: y = %d, x = %d, firstch = %d, lastch = %d\n", y, x, *win->lines[y]->firstchp, *win->lines[y]->lastchp); #endif - if (lp->line[x].ch != c || + if (lp->line[x].ch != c || !(lp->line[x].attr & stand)) { newx = x + win->ch_off; if (!(lp->flags & __ISDIRTY)) { diff --git a/lib/libcurses/clrtoeol.c b/lib/libcurses/clrtoeol.c index 44fc190fee3d..1f10c41f918b 100644 --- a/lib/libcurses/clrtoeol.c +++ b/lib/libcurses/clrtoeol.c @@ -70,7 +70,7 @@ wclrtoeol(win) } #ifdef DEBUG __CTRACE("CLRTOEOL: minx = %d, maxx = %d, firstch = %d, lastch = %d\n", - minx, maxx - win->lines[y]->line, *win->lines[y]->firstchp, + minx, maxx - win->lines[y]->line, *win->lines[y]->firstchp, *win->lines[y]->lastchp); #endif /* Update firstch and lastch for the line. */ diff --git a/lib/libcurses/cr_put.c b/lib/libcurses/cr_put.c index 36b39fcfb486..b69b01ad3b4a 100644 --- a/lib/libcurses/cr_put.c +++ b/lib/libcurses/cr_put.c @@ -82,8 +82,8 @@ __mvcur(ly, lx, y, x, in_refresh) if (destline != outline || destcol != outcol) fgoto(in_refresh); return (OK); -} - +} + static void fgoto(in_refresh) int in_refresh; @@ -137,7 +137,7 @@ fgoto(in_refresh) * list this won't work. We should probably have an * sc capability but sf will generally take the place * if it works. - * + * * Superbee glitch: in the middle of the screen have * to use esc B (down) because linefeed screws up in * "Efficient Paging" (what a joke) mode (which is @@ -167,7 +167,7 @@ fgoto(in_refresh) */ if (outcol != COLS - 1 && plod(strlen(cgp), in_refresh) > 0) plod(0, in_refresh); - else + else tputs(cgp, 1, __cputchar); } else plod(0, in_refresh); diff --git a/lib/libcurses/curses.c b/lib/libcurses/curses.c index 13ee80ee0402..d78d2843c469 100644 --- a/lib/libcurses/curses.c +++ b/lib/libcurses/curses.c @@ -41,9 +41,9 @@ static char sccsid[] = "@(#)curses.c 8.3 (Berkeley) 5/4/94"; int __echoit = 1; /* If stty indicates ECHO. */ int __pfast; int __rawmode = 0; /* If stty indicates RAW mode. */ -int __noqch = 0; /* - * If terminal doesn't have - * insert/delete line capabilities +int __noqch = 0; /* + * If terminal doesn't have + * insert/delete line capabilities * or change scroll capabilities * for quick change on refresh. */ diff --git a/lib/libcurses/curses.h b/lib/libcurses/curses.h index 8b699fac48e9..1142ca5a894d 100644 --- a/lib/libcurses/curses.h +++ b/lib/libcurses/curses.h @@ -145,7 +145,7 @@ extern char __unctrllen[256]; /* Control strings length. */ * A line is an array of __LDATA structures pointed to by the 'line' pointer. * * IMPORTANT: the __LDATA structure must NOT induce any padding, so if new - * fields are added -- padding fields with *constant values* should ensure + * fields are added -- padding fields with *constant values* should ensure * that the compiler will not generate any padding when storing an array of * __LDATA structures. This is to enable consistent use of memcmp, and memcpy * for comparing and copying arrays. @@ -188,7 +188,7 @@ typedef struct __window { /* Window structure. */ #define __SCROLLOK 0x020 /* Scrolling ok. */ #define __CLEAROK 0x040 /* Clear on next refresh. */ #define __WSTANDOUT 0x080 /* Standout window */ -#define __LEAVEOK 0x100 /* If curser left */ +#define __LEAVEOK 0x100 /* If curser left */ #define __FULLLINE 0x200 /* Line width = terminal width. */ u_int flags; } WINDOW; diff --git a/lib/libcurses/deleteln.c b/lib/libcurses/deleteln.c index 4cb08ea37947..afe6b9381c9c 100644 --- a/lib/libcurses/deleteln.c +++ b/lib/libcurses/deleteln.c @@ -60,8 +60,8 @@ wdeleteln(win) if (win->orig == NULL) win->lines[y] = win->lines[y + 1]; else - (void) memcpy(win->lines[y]->line, - win->lines[y + 1]->line, + (void) memcpy(win->lines[y]->line, + win->lines[y + 1]->line, win->maxx * __LDATASIZE); __touchline(win, y, 0, win->maxx - 1, 0); } diff --git a/lib/libcurses/erase.c b/lib/libcurses/erase.c index 42ca68a35a64..c2e3e48c0ad4 100644 --- a/lib/libcurses/erase.c +++ b/lib/libcurses/erase.c @@ -58,7 +58,7 @@ werase(win) end = &start[win->maxx]; for (sp = start; sp < end; sp++) if (sp->ch != ' ' || sp->attr != 0) { - maxx = sp; + maxx = sp; if (minx == -1) minx = sp - start; sp->ch = ' '; diff --git a/lib/libcurses/id_subwins.c b/lib/libcurses/id_subwins.c index 3528348ff467..0ceef2d70ab1 100644 --- a/lib/libcurses/id_subwins.c +++ b/lib/libcurses/id_subwins.c @@ -59,7 +59,7 @@ __id_subwins(orig) oy = orig->cury; for (y = realy - win->begy; y < win->maxy; y++, oy++) - win->lines[y]->line = + win->lines[y]->line = &orig->lines[oy]->line[win->ch_off]; } } diff --git a/lib/libcurses/initscr.c b/lib/libcurses/initscr.c index 1af8b6f34ea5..ac39669189ba 100644 --- a/lib/libcurses/initscr.c +++ b/lib/libcurses/initscr.c @@ -68,7 +68,7 @@ initscr() return (NULL); /* Need either homing or cursor motion for refreshes */ - if (!HO && !CM) + if (!HO && !CM) return (NULL); if (curscr != NULL) diff --git a/lib/libcurses/insch.c b/lib/libcurses/insch.c index 36cc0dee8940..aa48bcb0d8d4 100644 --- a/lib/libcurses/insch.c +++ b/lib/libcurses/insch.c @@ -61,7 +61,7 @@ winsch(win, ch) temp1->ch = ch; temp1->attr &= ~__STANDOUT; __touchline(win, win->cury, win->curx, win->maxx - 1, 0); - if (win->cury == LINES - 1 && + if (win->cury == LINES - 1 && (win->lines[LINES - 1]->line[COLS - 1].ch != ' ' || win->lines[LINES -1]->line[COLS - 1].attr != 0)) if (win->flags & __SCROLLOK) { diff --git a/lib/libcurses/insertln.c b/lib/libcurses/insertln.c index 4de367eb2685..ce713caa81da 100644 --- a/lib/libcurses/insertln.c +++ b/lib/libcurses/insertln.c @@ -62,8 +62,8 @@ winsertln(win) if (win->orig == NULL) win->lines[y] = win->lines[y - 1]; else - (void)memcpy(win->lines[y]->line, - win->lines[y - 1]->line, + (void)memcpy(win->lines[y]->line, + win->lines[y - 1]->line, win->maxx * __LDATASIZE); __touchline(win, y, 0, win->maxx - 1, 0); } diff --git a/lib/libcurses/newwin.c b/lib/libcurses/newwin.c index afc90cf0aecb..327381774930 100644 --- a/lib/libcurses/newwin.c +++ b/lib/libcurses/newwin.c @@ -158,7 +158,7 @@ __makenew(nl, nc, by, bx, sub) register WINDOW *win; register __LINE *lp; int i; - + #ifdef DEBUG __CTRACE("makenew: (%d, %d, %d, %d)\n", nl, nc, by, bx); @@ -169,7 +169,7 @@ __makenew(nl, nc, by, bx, sub) __CTRACE("makenew: nl = %d\n", nl); #endif - /* + /* * Set up line pointer array and line space. */ if ((win->lines = malloc (nl * sizeof(__LINE *))) == NULL) { @@ -187,14 +187,14 @@ __makenew(nl, nc, by, bx, sub) /* * Allocate window space in one chunk. */ - if ((win->wspace = + if ((win->wspace = malloc(nc * nl * sizeof(__LDATA))) == NULL) { free(win->lines); free(win->lspace); free(win); return NULL; } - + /* * Point line pointers to line space, and lines themselves into * window space. diff --git a/lib/libcurses/overlay.c b/lib/libcurses/overlay.c index 9f35c79e3fb8..22c34332f0a2 100644 --- a/lib/libcurses/overlay.c +++ b/lib/libcurses/overlay.c @@ -69,7 +69,7 @@ overlay(win1, win2) for (y = starty; y < endy; y++, y1++, y2++) { end = &win1->lines[y1]->line[endx - win1->begx]; x = startx - win2->begx; - for (sp = &win1->lines[y1]->line[startx - win1->begx]; + for (sp = &win1->lines[y1]->line[startx - win1->begx]; sp < end; sp++) { if (!isspace(sp->ch)) { wmove(win2, y2, x); diff --git a/lib/libcurses/overwrite.c b/lib/libcurses/overwrite.c index e2d91bd0a8c5..162c731e2ab2 100644 --- a/lib/libcurses/overwrite.c +++ b/lib/libcurses/overwrite.c @@ -66,7 +66,7 @@ overwrite(win1, win2) x = endx - startx; for (y = starty; y < endy; y++) { (void)memcpy( - &win2->lines[y - win2->begy]->line[startx - win2->begx], + &win2->lines[y - win2->begy]->line[startx - win2->begx], &win1->lines[y - win1->begy]->line[startx - win1->begx], x * __LDATASIZE); __touchline(win2, y, startx - win2->begx, endx - win2->begx, diff --git a/lib/libcurses/refresh.c b/lib/libcurses/refresh.c index 5b091f937756..6350f1f1292f 100644 --- a/lib/libcurses/refresh.c +++ b/lib/libcurses/refresh.c @@ -44,7 +44,7 @@ static short ly, lx; static void domvcur __P((int, int, int, int)); static int makech __P((WINDOW *, int)); -static void quickch __P((WINDOW *)); +static void quickch __P((WINDOW *)); static void scrolln __P((int, int, int, int, int)); /* @@ -60,7 +60,7 @@ wrefresh(win) register int retval; register short wy; int dnum; - + /* Initialize loop parameters. */ ly = curscr->cury; lx = curscr->curx; @@ -71,7 +71,7 @@ wrefresh(win) for (wy = 0; wy < win->maxy; wy++) { wlp = win->lines[wy]; if (wlp->flags & __ISDIRTY) - wlp->hash = + wlp->hash = __hash((char *) wlp->line, win->maxx * __LDATASIZE); } @@ -126,12 +126,12 @@ wrefresh(win) for (i = 0; i < curscr->maxy; i++) { __CTRACE("C: %d:", i); __CTRACE(" 0x%x \n", curscr->lines[i]->hash); - for (j = 0; j < curscr->maxx; j++) - __CTRACE("%c", + for (j = 0; j < curscr->maxx; j++) + __CTRACE("%c", curscr->lines[i]->line[j].ch); __CTRACE("\n"); - for (j = 0; j < curscr->maxx; j++) - __CTRACE("%x", + for (j = 0; j < curscr->maxx; j++) + __CTRACE("%x", curscr->lines[i]->line[j].attr); __CTRACE("\n"); if (i < win->begy || i > win->begy + win->maxy - 1) @@ -139,12 +139,12 @@ wrefresh(win) __CTRACE("W: %d:", i - win->begy); __CTRACE(" 0x%x \n", win->lines[i - win->begy]->hash); __CTRACE(" 0x%x ", win->lines[i - win->begy]->flags); - for (j = 0; j < win->maxx; j++) - __CTRACE("%c", + for (j = 0; j < win->maxx; j++) + __CTRACE("%c", win->lines[i - win->begy]->line[j].ch); __CTRACE("\n"); - for (j = 0; j < win->maxx; j++) - __CTRACE("%x", + for (j = 0; j < win->maxx; j++) + __CTRACE("%x", win->lines[i - win->begy]->line[j].attr); __CTRACE("\n"); } @@ -168,7 +168,7 @@ wrefresh(win) if (*win->lines[wy]->lastchp < win->maxx + win->ch_off) *win->lines[wy]->lastchp = win->ch_off; - if (*win->lines[wy]->lastchp < + if (*win->lines[wy]->lastchp < *win->lines[wy]->firstchp) { #ifdef DEBUG __CTRACE("wrefresh: line %d notdirty \n", wy); @@ -179,11 +179,11 @@ wrefresh(win) } #ifdef DEBUG - __CTRACE("\t%d\t%d\n", *win->lines[wy]->firstchp, + __CTRACE("\t%d\t%d\n", *win->lines[wy]->firstchp, *win->lines[wy]->lastchp); #endif } - + #ifdef DEBUG __CTRACE("refresh: ly=%d, lx=%d\n", ly, lx); #endif @@ -258,7 +258,7 @@ makech(win, wy) force = win->lines[wy]->flags & __FORCEPAINT; win->lines[wy]->flags &= ~__FORCEPAINT; if (CE && !curwin) { - for (cp = &win->lines[wy]->line[win->maxx - 1]; + for (cp = &win->lines[wy]->line[win->maxx - 1]; cp->ch == ' ' && cp->attr == 0; cp--) if (cp <= win->lines[wy]->line) break; @@ -294,15 +294,15 @@ makech(win, wy) domvcur(ly, lx, y, wx + win->begx); #ifdef DEBUG - __CTRACE("makech: 1: wx = %d, ly= %d, lx = %d, newy = %d, newx = %d, force =%d\n", + __CTRACE("makech: 1: wx = %d, ly= %d, lx = %d, newy = %d, newx = %d, force =%d\n", wx, ly, lx, y, wx + win->begx, force); #endif ly = y; lx = wx + win->begx; - while ((force || memcmp(nsp, csp, sizeof(__LDATA)) != 0) + while ((force || memcmp(nsp, csp, sizeof(__LDATA)) != 0) && wx <= lch) { - if (ce != NULL && win->maxx + win->begx == + if (ce != NULL && win->maxx + win->begx == curscr->maxx && wx >= nlsp && nsp->ch == ' ' && nsp->attr == 0) { /* Check for clear to end-of-line. */ cep = &curscr->lines[win->begy + wy]->line[win->begx + win->maxx - 1]; @@ -314,7 +314,7 @@ makech(win, wy) #ifdef DEBUG __CTRACE("makech: clsp = %d, nlsp = %d\n", clsp, nlsp); #endif - if ((clsp - nlsp >= strlen(CE) + if ((clsp - nlsp >= strlen(CE) && clsp < win->maxx) || wy == win->maxy - 1) { #ifdef DEBUG @@ -369,21 +369,21 @@ makech(win, wy) putchar(nsp->ch); } if (wx + win->begx < curscr->maxx) { - domvcur(ly, wx + win->begx, + domvcur(ly, wx + win->begx, win->begy + win->maxy - 1, win->begx + win->maxx - 1); } ly = win->begy + win->maxy - 1; lx = win->begx + win->maxx - 1; return (OK); - } - if (wx < win->maxx || wy < win->maxy - 1 || + } + if (wx < win->maxx || wy < win->maxy - 1 || !(win->flags & __SCROLLWIN)) { if (!curwin) { csp->attr = nsp->attr; putchar(csp->ch = nsp->ch); csp++; - } else + } else putchar(nsp->ch); } #ifdef DEBUG @@ -433,7 +433,7 @@ domvcur(oy, ox, ny, nx) /* * Quickch() attempts to detect a pattern in the change of the window - * in order to optimize the change, e.g., scroll n lines as opposed to + * in order to optimize the change, e.g., scroll n lines as opposed to * repainting the screen line by line. */ @@ -449,26 +449,26 @@ quickch(win) __LDATA buf[1024]; u_int blank_hash; - /* + /* * Find how many lines from the top of the screen are unchanged. */ for (top = win->begy; top < win->begy + win->maxy; top++) if (win->lines[top - win->begy]->flags & __FORCEPAINT || win->lines[top - win->begy]->hash != curscr->lines[top]->hash || memcmp(win->lines[top - win->begy]->line, - curscr->lines[top]->line, + curscr->lines[top]->line, win->maxx * __LDATASIZE) != 0) break; else win->lines[top - win->begy]->flags &= ~__ISDIRTY; /* - * Find how many lines from bottom of screen are unchanged. + * Find how many lines from bottom of screen are unchanged. */ for (bot = win->begy + win->maxy - 1; bot >= (int) win->begy; bot--) if (win->lines[bot - win->begy]->flags & __FORCEPAINT || win->lines[bot - win->begy]->hash != curscr->lines[bot]->hash || memcmp(win->lines[bot - win->begy]->line, - curscr->lines[bot]->line, + curscr->lines[bot]->line, win->maxx * __LDATASIZE) != 0) break; else @@ -489,7 +489,7 @@ quickch(win) * Search for the largest block of text not changed. * Invariants of the loop: * - Startw is the index of the beginning of the examined block in win. - * - Starts is the index of the beginning of the examined block in + * - Starts is the index of the beginning of the examined block in * curscr. * - Curw is the index of one past the end of the exmined block in win. * - Curs is the index of one past the end of the exmined block in @@ -498,7 +498,7 @@ quickch(win) */ for (bsize = bot - top; bsize >= THRESH; bsize--) { for (startw = top; startw <= bot - bsize; startw++) - for (starts = top; starts <= bot - bsize; + for (starts = top; starts <= bot - bsize; starts++) { for (curw = startw, curs = starts; curs < starts + bsize; curw++, curs++) @@ -507,7 +507,7 @@ quickch(win) (win->lines[curw - win->begy]->hash != curscr->lines[curs]->hash || memcmp(win->lines[curw - win->begy]->line, - curscr->lines[curs]->line, + curscr->lines[curs]->line, win->maxx * __LDATASIZE) != 0)) break; if (curs == starts + bsize) @@ -516,16 +516,16 @@ quickch(win) } done: /* Did not find anything */ - if (bsize < THRESH) + if (bsize < THRESH) return; #ifdef DEBUG - __CTRACE("quickch:bsize=%d,starts=%d,startw=%d,curw=%d,curs=%d,top=%d,bot=%d\n", + __CTRACE("quickch:bsize=%d,starts=%d,startw=%d,curw=%d,curs=%d,top=%d,bot=%d\n", bsize, starts, startw, curw, curs, top, bot); #endif - /* - * Make sure that there is no overlap between the bottom and top + /* + * Make sure that there is no overlap between the bottom and top * regions and the middle scrolled block. */ if (bot < curs) @@ -540,12 +540,12 @@ quickch(win) for (i = 0; i < curscr->maxy; i++) { __CTRACE("C: %d:", i); __CTRACE(" 0x%x \n", curscr->lines[i]->hash); - for (j = 0; j < curscr->maxx; j++) - __CTRACE("%c", + for (j = 0; j < curscr->maxx; j++) + __CTRACE("%c", curscr->lines[i]->line[j].ch); __CTRACE("\n"); - for (j = 0; j < curscr->maxx; j++) - __CTRACE("%x", + for (j = 0; j < curscr->maxx; j++) + __CTRACE("%x", curscr->lines[i]->line[j].attr); __CTRACE("\n"); if (i < win->begy || i > win->begy + win->maxy - 1) @@ -553,17 +553,17 @@ quickch(win) __CTRACE("W: %d:", i - win->begy); __CTRACE(" 0x%x \n", win->lines[i - win->begy]->hash); __CTRACE(" 0x%x ", win->lines[i - win->begy]->flags); - for (j = 0; j < win->maxx; j++) - __CTRACE("%c", + for (j = 0; j < win->maxx; j++) + __CTRACE("%c", win->lines[i - win->begy]->line[j].ch); __CTRACE("\n"); - for (j = 0; j < win->maxx; j++) - __CTRACE("%x", + for (j = 0; j < win->maxx; j++) + __CTRACE("%x", win->lines[i - win->begy]->line[j].attr); __CTRACE("\n"); } -#endif - +#endif + /* So we don't have to call __hash() each time */ for (i = 0; i < win->maxx; i++) { buf[i].ch = ' '; @@ -579,27 +579,27 @@ quickch(win) * - Target is the index of the target of line i. * - Tmp1 points to current line (i). * - Tmp2 and points to target line (target); - * - Cur_period is the index of the end of the current period. + * - Cur_period is the index of the end of the current period. * (see below). * * There are 2 major issues here that make this rotation non-trivial: * 1. Scrolling in a scrolling region bounded by the top * and bottom regions determined (whose size is sc_region). - * 2. As a result of the use of the mod function, there may be a + * 2. As a result of the use of the mod function, there may be a * period introduced, i.e., 2 maps to 4, 4 to 6, n-2 to 0, and * 0 to 2, which then causes all odd lines not to be rotated. - * To remedy this, an index of the end ( = beginning) of the - * current 'period' is kept, cur_period, and when it is reached, - * the next period is started from cur_period + 1 which is + * To remedy this, an index of the end ( = beginning) of the + * current 'period' is kept, cur_period, and when it is reached, + * the next period is started from cur_period + 1 which is * guaranteed not to have been reached since that would mean that * all records would have been reached. (think about it...). - * + * * Lines in the rotation can have 3 attributes which are marked on the * line so that curscr is consistent with the visual screen. * 1. Not dirty -- lines inside the scrolled block, top region or * bottom region. - * 2. Blank lines -- lines in the differential of the scrolling - * region adjacent to top and bot regions + * 2. Blank lines -- lines in the differential of the scrolling + * region adjacent to top and bot regions * depending on scrolling direction. * 3. Dirty line -- all other lines are marked dirty. */ @@ -617,7 +617,7 @@ quickch(win) __CTRACE("quickch: n=%d startw=%d curw=%d i = %d target=%d ", n, startw, curw, i, target); #endif - if ((target >= startw && target < curw) || target < top + if ((target >= startw && target < curw) || target < top || target > bot) { #ifdef DEBUG __CTRACE("-- notdirty"); @@ -625,7 +625,7 @@ quickch(win) win->lines[target - win->begy]->flags &= ~__ISDIRTY; } else if ((n > 0 && target >= top && target < top + n) || (n < 0 && target <= bot && target > bot + n)) { - if (clp->hash != blank_hash || memcmp(clp->line, + if (clp->hash != blank_hash || memcmp(clp->line, buf, win->maxx * __LDATASIZE) !=0) { (void)memcpy(clp->line, buf, win->maxx * __LDATASIZE); @@ -662,14 +662,14 @@ quickch(win) __CTRACE("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\n"); for (i = 0; i < curscr->maxy; i++) { __CTRACE("C: %d:", i); - for (j = 0; j < curscr->maxx; j++) - __CTRACE("%c", + for (j = 0; j < curscr->maxx; j++) + __CTRACE("%c", curscr->lines[i]->line[j].ch); __CTRACE("\n"); if (i < win->begy || i > win->begy + win->maxy - 1) continue; __CTRACE("W: %d:", i - win->begy); - for (j = 0; j < win->maxx; j++) + for (j = 0; j < win->maxx; j++) __CTRACE("%c", win->lines[i - win->begy]->line[j].ch); __CTRACE("\n"); @@ -680,7 +680,7 @@ quickch(win) scrolln(starts, startw, curs, bot, top); /* * Need to repoint any subwindow lines to the rotated - * line structured. + * line structured. */ for (wp = win->nextp; wp != win; wp = wp->nextp) __set_subwin(win, wp); @@ -846,5 +846,5 @@ scrolln(starts, startw, curs, bot, top) else abort(); __mvcur(top, 0, oy, ox, 1); - } + } } diff --git a/lib/libcurses/scanw.c b/lib/libcurses/scanw.c index d8d79fd23551..221384fdb1c9 100644 --- a/lib/libcurses/scanw.c +++ b/lib/libcurses/scanw.c @@ -101,7 +101,7 @@ wscanw(win, fmt, va_alist) } /* - * mvscanw, mvwscanw -- + * mvscanw, mvwscanw -- * Implement the mvscanw commands. Due to the variable number of * arguments, they cannot be macros. Another sigh.... */ diff --git a/lib/libcurses/setterm.c b/lib/libcurses/setterm.c index 2c2e36ef563e..ac85708bb767 100644 --- a/lib/libcurses/setterm.c +++ b/lib/libcurses/setterm.c @@ -71,9 +71,9 @@ static char *_PC, /* so SR ta te ti uc ue up us */ &SO, &SR, &TA, &TE, &TI, &UC, &UE, &UP, &US, /* vb vs ve al dl sf sr AL */ - &VB, &VS, &VE, &al, &dl, &sf, &sr, &AL_PARM, + &VB, &VS, &VE, &al, &dl, &sf, &sr, &AL_PARM, /* DL UP DO LE */ - &DL_PARM, &UP_PARM, &DOWN_PARM, &LEFT_PARM, + &DL_PARM, &UP_PARM, &DOWN_PARM, &LEFT_PARM, /* RI */ &RIGHT_PARM, }; @@ -224,7 +224,7 @@ zap() __CTRACE("2.2s = %s\n", namp, *fp[-1] ? "TRUE" : "FALSE"); #endif namp += 2; - + } while (*namp); namp = "ALbcbtcdceclcmcrcsdcDLdmdoedeik0k1k2k3k4k5k6k7k8k9hoicimipkdkekhklkrkskullmandnlpcrcscseSFsoSRtatetiucueupusvbvsvealdlsfsrALDLUPDOLERI"; sp = sstrs; diff --git a/lib/libcurses/tstp.c b/lib/libcurses/tstp.c index f16a46cf3f5c..069dbd8a4f72 100644 --- a/lib/libcurses/tstp.c +++ b/lib/libcurses/tstp.c @@ -65,7 +65,7 @@ __stop_signal_handler(signo) (void)sigaddset(&set, SIGALRM); (void)sigaddset(&set, SIGWINCH); (void)sigprocmask(SIG_BLOCK, &set, &oset); - + /* * End the window, which also resets the terminal state to the * original modes. diff --git a/lib/libcurses/tty.c b/lib/libcurses/tty.c index f3db2aad82e2..8265881f9076 100644 --- a/lib/libcurses/tty.c +++ b/lib/libcurses/tty.c @@ -75,7 +75,7 @@ int gettmode() { useraw = 0; - + if (tcgetattr(__tty_fileno = STDIN_FILENO, &__orig_termios)) if (tcgetattr(__tty_fileno = STDOUT_FILENO, &__orig_termios)) __noterm = 1; @@ -160,14 +160,14 @@ nocbreak() return (!__noterm && tcsetattr(__tty_fileno, __tcaction ? TCSASOFT | TCSADRAIN : TCSADRAIN, curt) ? ERR : OK); } - + int echo() { rawt.c_lflag |= ECHO; cbreakt.c_lflag |= ECHO; __baset.c_lflag |= ECHO; - + __echoit = 1; return (!__noterm && tcsetattr(__tty_fileno, __tcaction ? TCSASOFT | TCSADRAIN : TCSADRAIN, curt) ? ERR : OK); @@ -179,7 +179,7 @@ noecho() rawt.c_lflag &= ~ECHO; cbreakt.c_lflag &= ~ECHO; __baset.c_lflag &= ~ECHO; - + __echoit = 0; return (!__noterm && tcsetattr(__tty_fileno, __tcaction ? TCSASOFT | TCSADRAIN : TCSADRAIN, curt) ? ERR : OK); diff --git a/lib/libcurses/unctrl.c b/lib/libcurses/unctrl.c index ff52230b2e9b..530dcc28096a 100644 --- a/lib/libcurses/unctrl.c +++ b/lib/libcurses/unctrl.c @@ -87,7 +87,7 @@ char __unctrllen[256] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 2, + 1, 1, 1, 1, 1, 1, 1, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, diff --git a/lib/libedit/Makefile b/lib/libedit/Makefile index 5880204058f0..8863e80a1b97 100644 --- a/lib/libedit/Makefile +++ b/lib/libedit/Makefile @@ -14,11 +14,11 @@ LDADD+= -ltermcap SRCS= editline.c tokenizer.c history.c CLEANFILES+=common.h emacs.h fcns.h help.h vi.h help.c fcns.c editline.c -CFLAGS+=-I. -I${.CURDIR} +CFLAGS+=-I. -I${.CURDIR} CFLAGS+=#-DDEBUG_TTY -DDEBUG_KEY -DDEBUG_READ -DDEBUG -DDEBUG_REFRESH CFLAGS+=#-DDEBUG_PASTE -AHDR=vi.h emacs.h common.h +AHDR=vi.h emacs.h common.h ASRC=${.CURDIR}/vi.c ${.CURDIR}/emacs.c ${.CURDIR}/common.c vi.h: vi.c makelist @@ -36,7 +36,7 @@ fcns.h: ${AHDR} makelist fcns.c: ${AHDR} fcns.h makelist sh ${.CURDIR}/makelist -fc ${AHDR} > ${.TARGET} -help.c: ${ASRC} makelist +help.c: ${ASRC} makelist sh ${.CURDIR}/makelist -bc ${ASRC} > ${.TARGET} help.h: ${ASRC} makelist diff --git a/lib/libedit/TEST/test.c b/lib/libedit/TEST/test.c index f456f51277c9..2379b6f84781 100644 --- a/lib/libedit/TEST/test.c +++ b/lib/libedit/TEST/test.c @@ -87,7 +87,7 @@ complete(el, ch) EditLine *el; int ch; { - DIR *dd = opendir("."); + DIR *dd = opendir("."); struct dirent *dp; const char* ptr; const LineInfo *lf = el_line(el); diff --git a/lib/libedit/chared.c b/lib/libedit/chared.c index 5a393a762484..62e2f6a22219 100644 --- a/lib/libedit/chared.c +++ b/lib/libedit/chared.c @@ -38,7 +38,7 @@ static char sccsid[] = "@(#)chared.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint && not SCCSID */ -/* +/* * chared.c: Character editor utilities */ #include "sys.h" @@ -67,7 +67,7 @@ cv_undo(el, action, size, ptr) } -/* c_insert(): +/* c_insert(): * Insert num characters */ protected void @@ -80,7 +80,7 @@ c_insert(el, num) if (el->el_line.lastchar + num >= el->el_line.limit) return; /* can't go past end of buffer */ - if (el->el_line.cursor < el->el_line.lastchar) { + if (el->el_line.cursor < el->el_line.lastchar) { /* if I must move chars */ for (cp = el->el_line.lastchar; cp >= el->el_line.cursor; cp--) cp[num] = *cp; @@ -93,7 +93,7 @@ c_insert(el, num) * Delete num characters after the cursor */ protected void -c_delafter(el, num) +c_delafter(el, num) EditLine *el; int num; { @@ -101,10 +101,10 @@ c_delafter(el, num) if (el->el_line.cursor + num > el->el_line.lastchar) num = el->el_line.lastchar - el->el_line.cursor; - if (num > 0) { + if (num > 0) { char *cp; - if (el->el_map.current != el->el_map.emacs) + if (el->el_map.current != el->el_map.emacs) cv_undo(el, INSERT, num, el->el_line.cursor); for (cp = el->el_line.cursor; cp <= el->el_line.lastchar; cp++) @@ -125,12 +125,12 @@ c_delbefore(el, num) { if (el->el_line.cursor - num < el->el_line.buffer) - num = el->el_line.cursor - el->el_line.buffer; + num = el->el_line.cursor - el->el_line.buffer; - if (num > 0) { + if (num > 0) { char *cp; - if (el->el_map.current != el->el_map.emacs) + if (el->el_map.current != el->el_map.emacs) cv_undo(el, INSERT, num, el->el_line.cursor - num); for (cp = el->el_line.cursor - num; cp <= el->el_line.lastchar; cp++) @@ -145,7 +145,7 @@ c_delbefore(el, num) * Return if p is part of a word according to emacs */ protected int -ce__isword(p) +ce__isword(p) int p; { return isalpha(p) || isdigit(p) || strchr("*?_-.[]~=", p) != NULL; @@ -156,7 +156,7 @@ ce__isword(p) * Return if p is part of a word according to vi */ protected int -cv__isword(p) +cv__isword(p) int p; { return !isspace(p); @@ -167,7 +167,7 @@ cv__isword(p) * Find the previous word */ protected char * -c__prev_word(p, low, n, wtest) +c__prev_word(p, low, n, wtest) register char *p, *low; register int n; int (*wtest) __P((int)); @@ -175,9 +175,9 @@ c__prev_word(p, low, n, wtest) p--; while (n--) { - while ((p >= low) && !(*wtest)((unsigned char) *p)) + while ((p >= low) && !(*wtest)((unsigned char) *p)) p--; - while ((p >= low) && (*wtest)((unsigned char) *p)) + while ((p >= low) && (*wtest)((unsigned char) *p)) p--; } @@ -200,9 +200,9 @@ c__next_word(p, high, n, wtest) int (*wtest) __P((int)); { while (n--) { - while ((p < high) && !(*wtest)((unsigned char) *p)) + while ((p < high) && !(*wtest)((unsigned char) *p)) p++; - while ((p < high) && (*wtest)((unsigned char) *p)) + while ((p < high) && (*wtest)((unsigned char) *p)) p++; } if (p > high) @@ -225,14 +225,14 @@ cv_next_word(el, p, high, n, wtest) while (n--) { test = (*wtest)((unsigned char) *p); - while ((p < high) && (*wtest)((unsigned char) *p) == test) + while ((p < high) && (*wtest)((unsigned char) *p) == test) p++; /* * vi historically deletes with cw only the word preserving the * trailing whitespace! This is not what 'w' does.. */ - if (el->el_chared.c_vcmd.action != (DELETE|INSERT)) - while ((p < high) && isspace((unsigned char) *p)) + if (el->el_chared.c_vcmd.action != (DELETE|INSERT)) + while ((p < high) && isspace((unsigned char) *p)) p++; } @@ -262,14 +262,14 @@ cv_prev_word(el, p, low, n, wtest) * vi historically deletes with cb only the word preserving the * leading whitespace! This is not what 'b' does.. */ - if (el->el_chared.c_vcmd.action != (DELETE|INSERT)) - while ((p > low) && isspace((unsigned char) *p)) + if (el->el_chared.c_vcmd.action != (DELETE|INSERT)) + while ((p > low) && isspace((unsigned char) *p)) p--; test = (*wtest)((unsigned char) *p); - while ((p >= low) && (*wtest)((unsigned char) *p) == test) + while ((p >= low) && (*wtest)((unsigned char) *p) == test) p--; p++; - while (isspace((unsigned char) *p)) + while (isspace((unsigned char) *p)) p++; } @@ -319,7 +319,7 @@ c__number(p, num, dval) * Finish vi delete action */ protected void -cv_delfini(el) +cv_delfini(el) EditLine *el; { register int size; @@ -331,13 +331,13 @@ cv_delfini(el) oaction = el->el_chared.c_vcmd.action; el->el_chared.c_vcmd.action = NOP; - if (el->el_chared.c_vcmd.pos == 0) + if (el->el_chared.c_vcmd.pos == 0) return; if (el->el_line.cursor > el->el_chared.c_vcmd.pos) { size = (int) (el->el_line.cursor - el->el_chared.c_vcmd.pos); - c_delbefore(el, size); + c_delbefore(el, size); el->el_line.cursor = el->el_chared.c_vcmd.pos; re_refresh_cursor(el); } @@ -362,7 +362,7 @@ cv_delfini(el) abort(); break; } - + el->el_chared.c_undo.ptr = el->el_line.cursor; el->el_chared.c_undo.dsize = size; @@ -383,7 +383,7 @@ ce__endword(p, high, n) while (n--) { while ((p < high) && isspace((unsigned char) *p)) p++; - while ((p < high) && !isspace((unsigned char) *p)) + while ((p < high) && !isspace((unsigned char) *p)) p++; } @@ -404,14 +404,14 @@ cv__endword(p, high, n) p++; while (n--) { - while ((p < high) && isspace((unsigned char) *p)) + while ((p < high) && isspace((unsigned char) *p)) p++; if (isalnum((unsigned char) *p)) - while ((p < high) && isalnum((unsigned char) *p)) + while ((p < high) && isalnum((unsigned char) *p)) p++; else - while ((p < high) && !(isspace((unsigned char) *p) || + while ((p < high) && !(isspace((unsigned char) *p) || isalnum((unsigned char) *p))) p++; } @@ -458,7 +458,7 @@ ch_init(el) el->el_chared.c_macro.nline = NULL; el->el_chared.c_macro.level = -1; - el->el_chared.c_macro.macro = (char **) el_malloc(EL_MAXMACRO * + el->el_chared.c_macro.macro = (char **) el_malloc(EL_MAXMACRO * sizeof(char *)); return 0; } @@ -551,7 +551,7 @@ el_deletestr(el, n) if (n <= 0) return; - if (el->el_line.cursor < &el->el_line.buffer[n]) + if (el->el_line.cursor < &el->el_line.buffer[n]) return; c_delbefore(el, n); /* delete before dot */ @@ -630,7 +630,7 @@ c_hpos(el) if (el->el_line.cursor == el->el_line.buffer) return 0; else { - for (ptr = el->el_line.cursor - 1; + for (ptr = el->el_line.cursor - 1; ptr >= el->el_line.buffer && *ptr != '\n'; ptr--) continue; diff --git a/lib/libedit/chared.h b/lib/libedit/chared.h index 20da6c87a6db..22d07f0392ee 100644 --- a/lib/libedit/chared.h +++ b/lib/libedit/chared.h @@ -54,7 +54,7 @@ * like real vi: i.e. the transition from command<->insert modes moves * the cursor. * - * On the other hand we really don't want to move the cursor, because + * On the other hand we really don't want to move the cursor, because * all the editing commands don't include the character under the cursor. * Probably the best fix is to make all the editing commands aware of * this fact. @@ -68,7 +68,7 @@ typedef struct c_macro_t { char *nline; } c_macro_t; -/* +/* * Undo information for both vi and emacs */ typedef struct c_undo_t { @@ -139,7 +139,7 @@ protected void cv_delfini __P((EditLine *)); protected char *cv__endword __P((char *, char *, int)); protected int ce__isword __P((int)); protected void cv_undo __P((EditLine *, int, int, char *)); -protected char *cv_next_word __P((EditLine*, char *, char *, int, +protected char *cv_next_word __P((EditLine*, char *, char *, int, int (*)(int))); protected char *cv_prev_word __P((EditLine*, char *, char *, int, int (*)(int))); diff --git a/lib/libedit/common.c b/lib/libedit/common.c index 696da528e510..c8be2b79ec44 100644 --- a/lib/libedit/common.c +++ b/lib/libedit/common.c @@ -44,7 +44,7 @@ static char sccsid[] = "@(#)common.c 8.1 (Berkeley) 6/4/93"; #include "sys.h" #include "el.h" -/* ed_end_of_file(): +/* ed_end_of_file(): * Indicate end of file * [^D] */ @@ -60,7 +60,7 @@ ed_end_of_file(el, c) } -/* ed_insert(): +/* ed_insert(): * Add character to the line * Insert a character [bound to all insert keys] */ @@ -74,16 +74,16 @@ ed_insert(el, c) if (c == '\0') return CC_ERROR; - if (el->el_line.lastchar + el->el_state.argument >= + if (el->el_line.lastchar + el->el_state.argument >= el->el_line.limit) return CC_ERROR; /* end of buffer space */ if (el->el_state.argument == 1) { if (el->el_state.inputmode != MODE_INSERT) { - el->el_chared.c_undo.buf[el->el_chared.c_undo.isize++] = + el->el_chared.c_undo.buf[el->el_chared.c_undo.isize++] = *el->el_line.cursor; el->el_chared.c_undo.buf[el->el_chared.c_undo.isize] = '\0'; - c_delafter(el, 1); + c_delafter(el, 1); } c_insert(el, 1); @@ -95,12 +95,12 @@ ed_insert(el, c) else { if (el->el_state.inputmode != MODE_INSERT) { - for(i = 0;i < el->el_state.argument; i++) - el->el_chared.c_undo.buf[el->el_chared.c_undo.isize++] = + for(i = 0;i < el->el_state.argument; i++) + el->el_chared.c_undo.buf[el->el_chared.c_undo.isize++] = el->el_line.cursor[i]; el->el_chared.c_undo.buf[el->el_chared.c_undo.isize] = '\0'; - c_delafter(el, el->el_state.argument); + c_delafter(el, el->el_state.argument); } c_insert(el, el->el_state.argument); @@ -117,7 +117,7 @@ ed_insert(el, c) } -/* ed_delete_prev_word(): +/* ed_delete_prev_word(): * Delete from beginning of current word to cursor * [M-^?] [^W] */ @@ -132,7 +132,7 @@ ed_delete_prev_word(el, c) if (el->el_line.cursor == el->el_line.buffer) return CC_ERROR; - cp = c__prev_word(el->el_line.cursor, el->el_line.buffer, + cp = c__prev_word(el->el_line.cursor, el->el_line.buffer, el->el_state.argument, ce__isword); for (p = cp, kp = el->el_chared.c_kill.buf; p < el->el_line.cursor; p++) @@ -147,7 +147,7 @@ ed_delete_prev_word(el, c) } -/* ed_delete_next_char(): +/* ed_delete_next_char(): * Delete character under cursor * [^D] [x] */ @@ -159,12 +159,12 @@ ed_delete_next_char(el, c) { #ifdef notdef /* XXX */ #define EL el->el_line -fprintf(stderr, "\nD(b: %x(%s) c: %x(%s) last: %x(%s) limit: %x(%s)\n", +fprintf(stderr, "\nD(b: %x(%s) c: %x(%s) last: %x(%s) limit: %x(%s)\n", EL.buffer, EL.buffer, EL.cursor, EL.cursor, EL.lastchar, EL.lastchar, EL.limit, EL.limit); #endif if (el->el_line.cursor == el->el_line.lastchar) {/* if I'm at the end */ if (el->el_map.type == MAP_VI) { - if (el->el_line.cursor == el->el_line.buffer) { + if (el->el_line.cursor == el->el_line.buffer) { /* if I'm also at the beginning */ #ifdef KSHVI return CC_ERROR; @@ -196,7 +196,7 @@ fprintf(stderr, "\nD(b: %x(%s) c: %x(%s) last: %x(%s) limit: %x(%s)\n", } -/* ed_kill_line(): +/* ed_kill_line(): * Cut to the end of line * [^K] [^K] */ @@ -218,7 +218,7 @@ ed_kill_line(el, c) } -/* ed_move_to_end(): +/* ed_move_to_end(): * Move cursor to the end of line * [^E] [^E] */ @@ -242,7 +242,7 @@ ed_move_to_end(el, c) } -/* ed_move_to_beg(): +/* ed_move_to_beg(): * Move cursor to the beginning of line * [^A] [^A] */ @@ -256,7 +256,7 @@ ed_move_to_beg(el, c) if (el->el_map.type == MAP_VI) { /* We want FIRST non space character */ - while (isspace(*el->el_line.cursor)) + while (isspace(*el->el_line.cursor)) el->el_line.cursor++; if (el->el_chared.c_vcmd.action & DELETE) { cv_delfini(el); @@ -268,7 +268,7 @@ ed_move_to_beg(el, c) } -/* ed_transpose_chars(): +/* ed_transpose_chars(): * Exchange the character to the left of the cursor with the one under it * [^T] [^T] */ @@ -280,7 +280,7 @@ ed_transpose_chars(el, c) if (el->el_line.cursor < el->el_line.lastchar) { if (el->el_line.lastchar <= &el->el_line.buffer[1]) return CC_ERROR; - else + else el->el_line.cursor++; } if (el->el_line.cursor > &el->el_line.buffer[1]) { @@ -290,12 +290,12 @@ ed_transpose_chars(el, c) el->el_line.cursor[-1] = c; return CC_REFRESH; } - else + else return CC_ERROR; } -/* ed_next_char(): +/* ed_next_char(): * Move to the right one character * [^F] [^F] */ @@ -322,7 +322,7 @@ ed_next_char(el, c) } -/* ed_prev_word(): +/* ed_prev_word(): * Move to the beginning of the current word * [M-b] [b] */ @@ -335,8 +335,8 @@ ed_prev_word(el, c) if (el->el_line.cursor == el->el_line.buffer) return CC_ERROR; - el->el_line.cursor = c__prev_word(el->el_line.cursor, el->el_line.buffer, - el->el_state.argument, + el->el_line.cursor = c__prev_word(el->el_line.cursor, el->el_line.buffer, + el->el_state.argument, ce__isword); if (el->el_map.type == MAP_VI) @@ -349,7 +349,7 @@ ed_prev_word(el, c) } -/* ed_prev_char(): +/* ed_prev_char(): * Move to the left one character * [^B] [^B] */ @@ -372,12 +372,12 @@ ed_prev_char(el, c) return CC_CURSOR; } - else + else return CC_ERROR; } -/* ed_quoted_insert(): +/* ed_quoted_insert(): * Add the next character typed verbatim * [^V] [^V] */ @@ -400,7 +400,7 @@ ed_quoted_insert(el, c) } -/* ed_digit(): +/* ed_digit(): * Adds to argument or enters a digit */ protected el_action_t @@ -411,14 +411,14 @@ ed_digit(el, c) if (!isdigit(c)) return CC_ERROR; - if (el->el_state.doingarg) { + if (el->el_state.doingarg) { /* if doing an arg, add this in... */ - if (el->el_state.lastcmd == EM_UNIVERSAL_ARGUMENT) + if (el->el_state.lastcmd == EM_UNIVERSAL_ARGUMENT) el->el_state.argument = c - '0'; else { if (el->el_state.argument > 1000000) return CC_ERROR; - el->el_state.argument = + el->el_state.argument = (el->el_state.argument * 10) + (c - '0'); } return CC_ARGHACK; @@ -428,10 +428,10 @@ ed_digit(el, c) return CC_ERROR; if (el->el_state.inputmode != MODE_INSERT) { - el->el_chared.c_undo.buf[el->el_chared.c_undo.isize++] = + el->el_chared.c_undo.buf[el->el_chared.c_undo.isize++] = *el->el_line.cursor; el->el_chared.c_undo.buf[el->el_chared.c_undo.isize] = '\0'; - c_delafter(el, 1); + c_delafter(el, 1); } c_insert(el, 1); *el->el_line.cursor++ = c; @@ -442,7 +442,7 @@ ed_digit(el, c) } -/* ed_argument_digit(): +/* ed_argument_digit(): * Digit that starts argument * For ESC-n */ @@ -467,7 +467,7 @@ ed_argument_digit(el, c) } -/* ed_unassigned(): +/* ed_unassigned(): * Indicates unbound character * Bound to keys that are not assigned */ @@ -487,7 +487,7 @@ ed_unassigned(el, c) ** TTY key handling. **/ -/* ed_tty_sigint(): +/* ed_tty_sigint(): * Tty interrupt character * [^C] */ @@ -496,12 +496,12 @@ protected el_action_t ed_tty_sigint(el, c) EditLine *el; int c; -{ +{ return CC_NORM; } -/* ed_tty_dsusp(): +/* ed_tty_dsusp(): * Tty delayed suspend character * [^Y] */ @@ -515,7 +515,7 @@ ed_tty_dsusp(el, c) } -/* ed_tty_flush_output(): +/* ed_tty_flush_output(): * Tty flush output characters * [^O] */ @@ -529,7 +529,7 @@ ed_tty_flush_output(el, c) } -/* ed_tty_sigquit(): +/* ed_tty_sigquit(): * Tty quit character * [^\] */ @@ -543,7 +543,7 @@ ed_tty_sigquit(el, c) } -/* ed_tty_sigtstp(): +/* ed_tty_sigtstp(): * Tty suspend character * [^Z] */ @@ -557,7 +557,7 @@ ed_tty_sigtstp(el, c) } -/* ed_tty_stop_output(): +/* ed_tty_stop_output(): * Tty disallow output characters * [^S] */ @@ -571,7 +571,7 @@ ed_tty_stop_output(el, c) } -/* ed_tty_start_output(): +/* ed_tty_start_output(): * Tty allow output characters * [^Q] */ @@ -585,7 +585,7 @@ ed_tty_start_output(el, c) } -/* ed_newline(): +/* ed_newline(): * Execute command * [^J] */ @@ -604,7 +604,7 @@ ed_newline(el, c) } -/* ed_delete_prev_char(): +/* ed_delete_prev_char(): * Delete the character to the left of the cursor * [^?] */ @@ -614,10 +614,10 @@ ed_delete_prev_char(el, c) EditLine *el; int c; { - if (el->el_line.cursor <= el->el_line.buffer) + if (el->el_line.cursor <= el->el_line.buffer) return CC_ERROR; - c_delbefore(el, el->el_state.argument); + c_delbefore(el, el->el_state.argument); el->el_line.cursor -= el->el_state.argument; if (el->el_line.cursor < el->el_line.buffer) el->el_line.cursor = el->el_line.buffer; @@ -625,7 +625,7 @@ ed_delete_prev_char(el, c) } -/* ed_clear_screen(): +/* ed_clear_screen(): * Clear screen leaving current line at the top * [^L] */ @@ -641,7 +641,7 @@ ed_clear_screen(el, c) } -/* ed_redisplay(): +/* ed_redisplay(): * Redisplay everything * ^R */ @@ -657,7 +657,7 @@ ed_redisplay(el, c) } -/* ed_start_over(): +/* ed_start_over(): * Erase current line and start from scratch * [^G] */ @@ -672,7 +672,7 @@ ed_start_over(el, c) } -/* ed_sequence_lead_in(): +/* ed_sequence_lead_in(): * First character in a bound sequence * Placeholder for external keys */ @@ -686,7 +686,7 @@ ed_sequence_lead_in(el, c) } -/* ed_prev_history(): +/* ed_prev_history(): * Move to the previous history line * [^P] [k] */ @@ -703,7 +703,7 @@ ed_prev_history(el, c) if (el->el_history.eventno == 0) { /* save the current buffer away */ (void) strncpy(el->el_history.buf, el->el_line.buffer, EL_BUFSIZ); - el->el_history.last = el->el_history.buf + + el->el_history.last = el->el_history.buf + (el->el_line.lastchar - el->el_line.buffer); } @@ -712,7 +712,7 @@ ed_prev_history(el, c) if (hist_get(el) == CC_ERROR) { beep = 1; /* el->el_history.eventno was fixed by first call */ - (void) hist_get(el); + (void) hist_get(el); } re_refresh(el); @@ -723,7 +723,7 @@ ed_prev_history(el, c) } -/* ed_next_history(): +/* ed_next_history(): * Move to the next history line * [^N] [j] */ @@ -747,7 +747,7 @@ ed_next_history(el, c) } -/* ed_search_prev_history(): +/* ed_search_prev_history(): * Search previous in history for a line matching the current * next search history [M-P] [K] */ @@ -774,7 +774,7 @@ ed_search_prev_history(el, c) if (el->el_history.eventno == 0) { (void) strncpy(el->el_history.buf, el->el_line.buffer, EL_BUFSIZ); - el->el_history.last = el->el_history.buf + + el->el_history.last = el->el_history.buf + (el->el_line.lastchar - el->el_line.buffer); } @@ -795,9 +795,9 @@ ed_search_prev_history(el, c) #ifdef SDEBUG (void) fprintf(el->el_errfile, "Comparing with \"%s\"\n", hp); #endif - if ((strncmp(hp, el->el_line.buffer, - el->el_line.lastchar - el->el_line.buffer) || - hp[el->el_line.lastchar-el->el_line.buffer]) && + if ((strncmp(hp, el->el_line.buffer, + el->el_line.lastchar - el->el_line.buffer) || + hp[el->el_line.lastchar-el->el_line.buffer]) && c_hmatch(el, hp)) { found++; break; @@ -808,7 +808,7 @@ ed_search_prev_history(el, c) if (!found) { #ifdef SDEBUG - (void) fprintf(el->el_errfile, "not found\n"); + (void) fprintf(el->el_errfile, "not found\n"); #endif return CC_ERROR; } @@ -819,7 +819,7 @@ ed_search_prev_history(el, c) } -/* ed_search_next_history(): +/* ed_search_next_history(): * Search next in history for a line matching the current * [M-N] [J] */ @@ -853,9 +853,9 @@ ed_search_next_history(el, c) #ifdef SDEBUG (void) fprintf(el->el_errfile, "Comparing with \"%s\"\n", hp); #endif - if ((strncmp(hp, el->el_line.buffer, - el->el_line.lastchar - el->el_line.buffer) || - hp[el->el_line.lastchar-el->el_line.buffer]) && + if ((strncmp(hp, el->el_line.buffer, + el->el_line.lastchar - el->el_line.buffer) || + hp[el->el_line.lastchar-el->el_line.buffer]) && c_hmatch(el, hp)) found = h; hp = HIST_NEXT(el); @@ -864,7 +864,7 @@ ed_search_next_history(el, c) if (!found) { /* is it the current history number? */ if (!c_hmatch(el, el->el_history.buf)) { #ifdef SDEBUG - (void) fprintf(el->el_errfile, "not found\n"); + (void) fprintf(el->el_errfile, "not found\n"); #endif return CC_ERROR; } @@ -888,7 +888,7 @@ ed_prev_line(el, c) { char *ptr; int nchars = c_hpos(el); - + /* * Move to the line requested */ @@ -907,15 +907,15 @@ ed_prev_line(el, c) */ for (ptr--; ptr >= el->el_line.buffer && *ptr != '\n'; ptr--) continue; - + /* * Move to the character requested */ - for (ptr++; - nchars-- > 0 && ptr < el->el_line.lastchar && *ptr != '\n'; + for (ptr++; + nchars-- > 0 && ptr < el->el_line.lastchar && *ptr != '\n'; ptr++) continue; - + el->el_line.cursor = ptr; return CC_CURSOR; } @@ -948,16 +948,16 @@ ed_next_line(el, c) * Move to the character requested */ for (ptr++; - nchars-- > 0 && ptr < el->el_line.lastchar && *ptr != '\n'; + nchars-- > 0 && ptr < el->el_line.lastchar && *ptr != '\n'; ptr++) continue; - + el->el_line.cursor = ptr; return CC_CURSOR; } -/* ed_command(): +/* ed_command(): * Editline extended command * [M-X] [:] */ diff --git a/lib/libedit/el.c b/lib/libedit/el.c index 7314477a69ac..075a05357a26 100644 --- a/lib/libedit/el.c +++ b/lib/libedit/el.c @@ -86,7 +86,7 @@ el_init(prog, fin, fout) return NULL; } } - else + else #endif el->el_errfile = stderr; @@ -132,7 +132,7 @@ el_end(el) el_free((ptr_t) el->el_prog); el_free((ptr_t) el); -} /* end el_end */ +} /* end el_end */ /* el_reset(): @@ -170,7 +170,7 @@ el_set(va_alist) el = va_arg(va, EditLine *); op = va_arg(va, int); #endif - + switch (op) { case EL_PROMPT: rv = prompt_set(el, va_arg(va, el_pfunc_t)); @@ -237,7 +237,7 @@ el_set(va_alist) } } break; - + case EL_ADDFN: { char *name = va_arg(va, char *); @@ -291,7 +291,7 @@ el_source(el, fname) if (fname == NULL) { fname = &elpath[1]; if ((fp = fopen(fname, "r")) == NULL) { - if ((ptr = getenv("HOME")) == NULL) + if ((ptr = getenv("HOME")) == NULL) return -1; fname = strncpy(path, ptr, MAXPATHLEN); (void) strncat(path, elpath, MAXPATHLEN); @@ -299,7 +299,7 @@ el_source(el, fname) } } - if ((fp = fopen(fname, "r")) == NULL) + if ((fp = fopen(fname, "r")) == NULL) return -1; while ((ptr = fgetln(fp, &len)) != NULL) diff --git a/lib/libedit/emacs.c b/lib/libedit/emacs.c index 273de1079f7b..a3a19759f00c 100644 --- a/lib/libedit/emacs.c +++ b/lib/libedit/emacs.c @@ -38,7 +38,7 @@ static char sccsid[] = "@(#)emacs.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint && not SCCSID */ -/* +/* * emacs.c: Emacs functions */ #include "sys.h" @@ -90,7 +90,7 @@ em_delete_next_word(el, c) if (el->el_line.cursor == el->el_line.lastchar) return CC_ERROR; - cp = c__next_word(el->el_line.cursor, el->el_line.lastchar, + cp = c__next_word(el->el_line.cursor, el->el_line.lastchar, el->el_state.argument, ce__isword); for (p = el->el_line.cursor, kp = el->el_chared.c_kill.buf; p < cp; p++) @@ -120,8 +120,8 @@ em_yank(el, c) if (el->el_chared.c_kill.last == el->el_chared.c_kill.buf) return CC_ERROR; - if (el->el_line.lastchar + - (el->el_chared.c_kill.last - el->el_chared.c_kill.buf) >= + if (el->el_line.lastchar + + (el->el_chared.c_kill.last - el->el_chared.c_kill.buf) >= el->el_line.limit) return CC_ERROR; @@ -129,13 +129,13 @@ em_yank(el, c) cp = el->el_line.cursor; /* open the space, */ - c_insert(el, el->el_chared.c_kill.last - el->el_chared.c_kill.buf); + c_insert(el, el->el_chared.c_kill.last - el->el_chared.c_kill.buf); /* copy the chars */ - for (kp = el->el_chared.c_kill.buf; kp < el->el_chared.c_kill.last; kp++) + for (kp = el->el_chared.c_kill.buf; kp < el->el_chared.c_kill.last; kp++) *cp++ = *kp; /* if an arg, cursor at beginning else cursor at end */ - if (el->el_state.argument == 1) + if (el->el_state.argument == 1) el->el_line.cursor = cp; return CC_REFRESH; @@ -251,7 +251,7 @@ em_gosmacs_traspose(el, c) el->el_line.cursor[-1] = c; return CC_REFRESH; } - else + else return CC_ERROR; } @@ -269,11 +269,11 @@ em_next_word(el, c) if (el->el_line.cursor == el->el_line.lastchar) return CC_ERROR; - el->el_line.cursor = c__next_word(el->el_line.cursor, el->el_line.lastchar, + el->el_line.cursor = c__next_word(el->el_line.cursor, el->el_line.lastchar, el->el_state.argument, ce__isword); - if (el->el_map.type == MAP_VI) + if (el->el_map.type == MAP_VI) if (el->el_chared.c_vcmd.action & DELETE) { cv_delfini(el); return CC_REFRESH; @@ -294,7 +294,7 @@ em_upper_case(el, c) { char *cp, *ep; - ep = c__next_word(el->el_line.cursor, el->el_line.lastchar, + ep = c__next_word(el->el_line.cursor, el->el_line.lastchar, el->el_state.argument, ce__isword); for (cp = el->el_line.cursor; cp < ep; cp++) @@ -320,7 +320,7 @@ em_capitol_case(el, c) { char *cp, *ep; - ep = c__next_word(el->el_line.cursor, el->el_line.lastchar, + ep = c__next_word(el->el_line.cursor, el->el_line.lastchar, el->el_state.argument, ce__isword); for (cp = el->el_line.cursor; cp < ep; cp++) { @@ -353,7 +353,7 @@ em_lower_case(el, c) { char *cp, *ep; - ep = c__next_word(el->el_line.cursor, el->el_line.lastchar, + ep = c__next_word(el->el_line.cursor, el->el_line.lastchar, el->el_state.argument, ce__isword); for (cp = el->el_line.cursor; cp < ep; cp++) @@ -383,7 +383,7 @@ em_set_mark(el, c) /* em_exchange_mark(): - * Exchange the cursor and mark + * Exchange the cursor and mark * [^X^X] */ protected el_action_t @@ -427,7 +427,7 @@ em_meta_next(el, c) EditLine *el; int c; { - el->el_state.metanext = 1; + el->el_state.metanext = 1; return CC_ARGHACK; } @@ -441,7 +441,7 @@ em_toggle_overwrite(el, c) EditLine *el; int c; { - el->el_state.inputmode = + el->el_state.inputmode = (el->el_state.inputmode == MODE_INSERT) ? MODE_REPLACE : MODE_INSERT; return CC_NORM; } @@ -463,8 +463,8 @@ em_copy_prev_word(el, c) oldc = el->el_line.cursor; /* does a bounds check */ - cp = c__prev_word(el->el_line.cursor, el->el_line.buffer, - el->el_state.argument, ce__isword); + cp = c__prev_word(el->el_line.cursor, el->el_line.buffer, + el->el_state.argument, ce__isword); c_insert(el, oldc - cp); for (dp = oldc; cp < oldc && dp < el->el_line.lastchar; cp++) diff --git a/lib/libedit/hist.c b/lib/libedit/hist.c index 394df63e9d3e..27dacd1925b1 100644 --- a/lib/libedit/hist.c +++ b/lib/libedit/hist.c @@ -101,7 +101,7 @@ hist_get(el) if (el->el_history.eventno == 0) { /* if really the current line */ (void) strncpy(el->el_line.buffer, el->el_history.buf, EL_BUFSIZ); - el->el_line.lastchar = el->el_line.buffer + + el->el_line.lastchar = el->el_line.buffer + (el->el_history.last - el->el_history.buf); #ifdef KSHVI diff --git a/lib/libedit/history.c b/lib/libedit/history.c index e8665481977c..d60a7a968d2f 100644 --- a/lib/libedit/history.c +++ b/lib/libedit/history.c @@ -130,7 +130,7 @@ private void history_def_delete __P((history_t *, hentry_t *)); /* history_def_first(): * Default function to return the first event in the history. */ -private const HistEvent * +private const HistEvent * history_def_first(p) ptr_t p; { @@ -145,7 +145,7 @@ history_def_first(p) /* history_def_last(): * Default function to return the last event in the history. */ -private const HistEvent * +private const HistEvent * history_def_last(p) ptr_t p; { @@ -160,7 +160,7 @@ history_def_last(p) /* history_def_next(): * Default function to return the next event in the history. */ -private const HistEvent * +private const HistEvent * history_def_next(p) ptr_t p; { @@ -181,7 +181,7 @@ history_def_next(p) /* history_def_prev(): * Default function to return the previous event in the history. */ -private const HistEvent * +private const HistEvent * history_def_prev(p) ptr_t p; { @@ -202,7 +202,7 @@ history_def_prev(p) /* history_def_curr(): * Default function to return the current event in the history. */ -private const HistEvent * +private const HistEvent * history_def_curr(p) ptr_t p; { @@ -296,7 +296,7 @@ history_def_enter(p, str) * Always keep at least one entry. * This way we don't have to check for the empty list. */ - while (h->cur > h->max + 1) + while (h->cur > h->max + 1) history_def_delete(h, h->list.prev); return ev; } @@ -399,9 +399,9 @@ history_set_fun(h, first, next, last, prev, curr, enter, add, ptr) history_efun_t enter, add; ptr_t ptr; { - if (first == NULL || next == NULL || + if (first == NULL || next == NULL || last == NULL || prev == NULL || curr == NULL || - enter == NULL || add == NULL || + enter == NULL || add == NULL || ptr == NULL ) { if (h->h_next != history_def_next) { history_def_init(&h->h_ref, 0); @@ -514,7 +514,7 @@ history(va_alist) #if __STDC__ va_start(va, fun); #else - History *h; + History *h; int fun; va_start(va); h = va_arg(va, History *); @@ -584,7 +584,7 @@ history(va_alist) history_efun_t add = va_arg(va, history_efun_t); ptr_t ptr = va_arg(va, ptr_t); - if (history_set_fun(h, first, next, last, prev, + if (history_set_fun(h, first, next, last, prev, curr, enter, add, ptr) == 0) ev = &sev; } diff --git a/lib/libedit/key.c b/lib/libedit/key.c index 058da0e7f435..302b6bd68d54 100644 --- a/lib/libedit/key.c +++ b/lib/libedit/key.c @@ -42,10 +42,10 @@ static char sccsid[] = "@(#)key.c 8.1 (Berkeley) 6/4/93"; * key.c: This module contains the procedures for maintaining * the extended-key map. * - * An extended-key (key) is a sequence of keystrokes introduced - * with an sequence introducer and consisting of an arbitrary - * number of characters. This module maintains a map (the el->el_key.map) - * to convert these extended-key sequences into input strs + * An extended-key (key) is a sequence of keystrokes introduced + * with an sequence introducer and consisting of an arbitrary + * number of characters. This module maintains a map (the el->el_key.map) + * to convert these extended-key sequences into input strs * (XK_STR), editor functions (XK_CMD), or unix commands (XK_EXE). * * Warning: @@ -65,8 +65,8 @@ static char sccsid[] = "@(#)key.c 8.1 (Berkeley) 6/4/93"; #include "el.h" -/* - * The Nodes of the el->el_key.map. The el->el_key.map is a linked list +/* + * The Nodes of the el->el_key.map. The el->el_key.map is a linked list * of these node elements */ struct key_node_t { @@ -78,9 +78,9 @@ struct key_node_t { struct key_node_t *sibling; /* ptr to another key with same prefix */ }; -private int node_trav __P((EditLine *, key_node_t *, char *, +private int node_trav __P((EditLine *, key_node_t *, char *, key_value_t *)); -private int node__try __P((key_node_t *, char *, +private int node__try __P((key_node_t *, char *, key_value_t *, int)); private key_node_t *node__get __P((int)); private void node__put __P((key_node_t *)); @@ -104,7 +104,7 @@ key_init(el) el->el_key.map = NULL; key_reset(el); return 0; -} +} /* key_end(): @@ -118,7 +118,7 @@ key_end(el) el->el_key.buf = NULL; /* XXX: provide a function to clear the keys */ el->el_key.map = NULL; -} +} /* key_map_cmd(): @@ -167,7 +167,7 @@ key_reset(el) * Looks up *ch in map and then reads characters until a * complete match is found or a mismatch occurs. Returns the * type of the match found (XK_STR, XK_CMD, or XK_EXE). - * Returns NULL in val.str and XK_STR for no match. + * Returns NULL in val.str and XK_STR for no match. * The last character read is returned in *ch. */ protected int @@ -195,7 +195,7 @@ key_add(el, key, val, ntype) int ntype; { if (key[0] == '\0') { - (void) fprintf(el->el_errfile, + (void) fprintf(el->el_errfile, "key_add: Null extended-key not allowed.\n"); return; } @@ -211,7 +211,7 @@ key_add(el, key, val, ntype) el->el_key.map = node__get(key[0]); /* it is properly initialized */ /* Now recurse through el->el_key.map */ - (void) node__try(el->el_key.map, key, val, ntype); + (void) node__try(el->el_key.map, key, val, ntype); return; } @@ -226,9 +226,9 @@ key_clear(el, map, in) char *in; { if ((map[(unsigned char) *in] == ED_SEQUENCE_LEAD_IN) && - ((map == el->el_map.key && + ((map == el->el_map.key && el->el_map.alt[(unsigned char) *in] != ED_SEQUENCE_LEAD_IN) || - (map == el->el_map.alt && + (map == el->el_map.alt && el->el_map.key[(unsigned char) *in] != ED_SEQUENCE_LEAD_IN))) (void) key_delete(el, in); } @@ -244,7 +244,7 @@ key_delete(el, key) char *key; { if (key[0] == '\0') { - (void) fprintf(el->el_errfile, + (void) fprintf(el->el_errfile, "key_delete: Null extended-key not allowed.\n"); return -1; } @@ -515,7 +515,7 @@ node_lookup(el, str, ptr, cnt) /* If match put this char into el->el_key.buf. Recurse */ if (ptr->ch == *str) { /* match found */ - ncnt = key__decode_char(el->el_key.buf, cnt, + ncnt = key__decode_char(el->el_key.buf, cnt, (unsigned char) ptr->ch); if (ptr->next != NULL) /* not yet at leaf */ @@ -557,7 +557,7 @@ node_enum(el, ptr, cnt) if (cnt >= KEY_BUFSIZ - 5) { /* buffer too small */ el->el_key.buf[++cnt] = '"'; el->el_key.buf[++cnt] = '\0'; - (void) fprintf(el->el_errfile, + (void) fprintf(el->el_errfile, "Some extended keys too long for internal print buffer"); (void) fprintf(el->el_errfile, " \"%s...\"\n", el->el_key.buf); return 0; @@ -607,18 +607,18 @@ key_kprint(el, key, val, ntype) switch (ntype) { case XK_STR: case XK_EXE: - (void) fprintf(el->el_errfile, fmt, key, - key__decode_str(val->str, unparsbuf, + (void) fprintf(el->el_errfile, fmt, key, + key__decode_str(val->str, unparsbuf, ntype == XK_STR ? "\"\"" : "[]")); break; case XK_CMD: - for (fp = el->el_map.help; fp->name; fp++) + for (fp = el->el_map.help; fp->name; fp++) if (val->cmd == fp->func) { (void) fprintf(el->el_errfile, fmt, key, fp->name); break; } #ifdef DEBUG_KEY - if (fp->name == NULL) + if (fp->name == NULL) (void) fprintf(el->el_errfile, "BUG! Command not found.\n"); #endif @@ -708,7 +708,7 @@ key__decode_str(str, buf, sep) *b++ = '\\'; *b++ = *p; } - else if (*p == ' ' || (isprint((unsigned char) *p) && + else if (*p == ' ' || (isprint((unsigned char) *p) && !isspace((unsigned char) *p))) { *b++ = *p; } diff --git a/lib/libedit/key.h b/lib/libedit/key.h index 2ed3afc8fe08..eed081829c80 100644 --- a/lib/libedit/key.h +++ b/lib/libedit/key.h @@ -65,7 +65,7 @@ protected void key_end __P((EditLine *)); protected key_value_t * key_map_cmd __P((EditLine *, int)); protected key_value_t * key_map_str __P((EditLine *, char *)); protected void key_reset __P((EditLine *)); -protected int key_get __P((EditLine *, char *, +protected int key_get __P((EditLine *, char *, key_value_t *)); protected void key_add __P((EditLine *, char *, key_value_t *, int)); @@ -73,7 +73,7 @@ protected void key_clear __P((EditLine *, el_action_t *, char *)); protected int key_delete __P((EditLine *, char *)); protected void key_print __P((EditLine *, char *)); -protected void key_kprint __P((EditLine *, char *, +protected void key_kprint __P((EditLine *, char *, key_value_t *, int)); protected char *key__decode_str __P((char *, char *, char *)); diff --git a/lib/libedit/map.c b/lib/libedit/map.c index 3378217ff851..5f91c75789b8 100644 --- a/lib/libedit/map.c +++ b/lib/libedit/map.c @@ -39,7 +39,7 @@ static char sccsid[] = "@(#)map.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint && not SCCSID */ /* - * map.c: Editor function definitions + * map.c: Editor function definitions */ #include "sys.h" #include <stdlib.h> @@ -660,8 +660,8 @@ private el_action_t el_map_vi_command[] = { /* 41 */ ED_UNASSIGNED, /* ) */ /* 42 */ ED_UNASSIGNED, /* * */ /* 43 */ ED_NEXT_HISTORY, /* + */ - /* 44 */ VI_REPEAT_PREV_CHAR, /* , */ - /* 45 */ ED_PREV_HISTORY, /* - */ + /* 44 */ VI_REPEAT_PREV_CHAR, /* , */ + /* 45 */ ED_PREV_HISTORY, /* - */ /* 46 */ ED_UNASSIGNED, /* . */ /* 47 */ VI_SEARCH_PREV, /* / */ /* 48 */ VI_ZERO, /* 0 */ @@ -882,7 +882,7 @@ protected int map_init(el) EditLine *el; { - + /* * Make sure those are correct before starting. */ @@ -902,7 +902,7 @@ map_init(el) el->el_map.vii = el_map_vi_insert; el->el_map.help = (el_bindings_t *) el_malloc(sizeof(el_bindings_t) * EL_NUM_FCNS); - (void) memcpy(el->el_map.help, help__get(), + (void) memcpy(el->el_map.help, help__get(), sizeof(el_bindings_t) * EL_NUM_FCNS); el->el_map.func = (el_func_t *) el_malloc(sizeof(el_func_t) * EL_NUM_FCNS); memcpy(el->el_map.func, func__get(), sizeof(el_func_t) * EL_NUM_FCNS); @@ -948,8 +948,8 @@ map_init_nls(el) int i; el_action_t *map = el->el_map.key; - for (i = 0200; i <= 0377; i++) - if (isprint(i)) + for (i = 0200; i <= 0377; i++) + if (isprint(i)) map[i] = ED_INSERT; } @@ -977,12 +977,12 @@ map_init_meta(el) if (el->el_map.type == MAP_VI) map = alt; } - else + else map = alt; } buf[0] = (char) i; buf[2] = 0; - for (i = 0200; i <= 0377; i++) + for (i = 0200; i <= 0377; i++) switch (map[i]) { case ED_INSERT: case ED_UNASSIGNED: @@ -1064,14 +1064,14 @@ map_init_emacs(el) buf[2] = 0; buf[1] = CONTROL('X'); key_add(el, buf, key_map_cmd(el, EM_EXCHANGE_MARK), XK_CMD); - + tty_bind_char(el, 1); term_bind_arrow(el); } /* map_set_editor(): - * Set the editor + * Set the editor */ protected int map_set_editor(el, editor) @@ -1106,12 +1106,12 @@ map_print_key(el, map, in) (void) key__decode_str(in, outbuf, ""); for (bp = el->el_map.help; bp->name != NULL; bp++) if (bp->func == map[(unsigned char) *in]) { - (void) fprintf(el->el_outfile, + (void) fprintf(el->el_outfile, "%s\t->\t%s\n", outbuf, bp->name); return; } } - else + else key_print(el, in); } @@ -1144,13 +1144,13 @@ map_print_some_keys(el, map, first, last) if (bp->func == map[first]) { if (first == last) { (void) fprintf(el->el_outfile, "%-15s-> %s\n", - key__decode_str(firstbuf, unparsbuf, STRQQ), + key__decode_str(firstbuf, unparsbuf, STRQQ), bp->name); } else { (void) fprintf(el->el_outfile, "%-4s to %-7s-> %s\n", key__decode_str(firstbuf, unparsbuf, STRQQ), - key__decode_str(lastbuf, extrabuf, STRQQ), + key__decode_str(lastbuf, extrabuf, STRQQ), bp->name); } return; @@ -1160,13 +1160,13 @@ map_print_some_keys(el, map, first, last) if (map == el->el_map.key) { (void) fprintf(el->el_outfile, "BUG!!! %s isn't bound to anything.\n", key__decode_str(firstbuf, unparsbuf, STRQQ)); - (void) fprintf(el->el_outfile, "el->el_map.key[%d] == %d\n", + (void) fprintf(el->el_outfile, "el->el_map.key[%d] == %d\n", first, el->el_map.key[first]); } else { (void) fprintf(el->el_outfile, "BUG!!! %s isn't bound to anything.\n", key__decode_str(firstbuf, unparsbuf, STRQQ)); - (void) fprintf(el->el_outfile, "el->el_map.alt[%d] == %d\n", + (void) fprintf(el->el_outfile, "el->el_map.alt[%d] == %d\n", first, el->el_map.alt[first]); } #endif @@ -1268,8 +1268,8 @@ map_bind(el, argc, argv) return 0; case 'l': - for (bp = el->el_map.help; bp->name != NULL; bp++) - (void) fprintf(el->el_outfile, "%s\n\t%s\n", + for (bp = el->el_map.help; bp->name != NULL; bp++) + (void) fprintf(el->el_outfile, "%s\n\t%s\n", bp->name, bp->description); return 0; default: @@ -1298,11 +1298,11 @@ map_bind(el, argc, argv) (void) term_clear_arrow(el, in); return -1; } - if (in[1]) + if (in[1]) (void) key_delete(el, in); - else if (map[(unsigned char) *in] == ED_SEQUENCE_LEAD_IN) + else if (map[(unsigned char) *in] == ED_SEQUENCE_LEAD_IN) (void) key_delete(el, in); - else + else map[(unsigned char) *in] = ED_UNASSIGNED; return 0; } @@ -1326,7 +1326,7 @@ map_bind(el, argc, argv) case XK_STR: case XK_EXE: if ((out = parse__string(outbuf, argv[argc])) == NULL) { - (void) fprintf(el->el_errfile, + (void) fprintf(el->el_errfile, "%s: Invalid \\ or ^ in outstring.\n", argv[0]); return -1; } @@ -1339,7 +1339,7 @@ map_bind(el, argc, argv) case XK_CMD: if ((cmd = parse_cmd(el, argv[argc])) == -1) { - (void) fprintf(el->el_errfile, + (void) fprintf(el->el_errfile, "%s: Invalid command `%s'.\n", argv[0], argv[argc]); return -1; } @@ -1379,7 +1379,7 @@ map_addfunc(el, name, help, func) if (name == NULL || help == NULL || func == NULL) return -1; - el->el_map.func = (el_func_t *) + el->el_map.func = (el_func_t *) el_realloc(el->el_map.func, nf * sizeof(el_func_t)); el->el_map.help = (el_bindings_t *) el_realloc(el->el_map.help, nf * sizeof(el_bindings_t)); diff --git a/lib/libedit/map.h b/lib/libedit/map.h index 71c93b4a21e2..c0f16f10a0cd 100644 --- a/lib/libedit/map.h +++ b/lib/libedit/map.h @@ -71,7 +71,7 @@ protected void map_end __P((EditLine *)); protected void map_init_vi __P((EditLine *)); protected void map_init_emacs __P((EditLine *)); protected int map_set_editor __P((EditLine *, char *)); -protected int map_addfunc __P((EditLine *, const char *, +protected int map_addfunc __P((EditLine *, const char *, const char *, el_func_t)); #endif /* _h_el_map */ diff --git a/lib/libedit/parse.c b/lib/libedit/parse.c index 2fe746f370bc..a89539c9cd2f 100644 --- a/lib/libedit/parse.c +++ b/lib/libedit/parse.c @@ -131,7 +131,7 @@ parse__escape(ptr) p = *ptr; - if (p[1] == 0) + if (p[1] == 0) return -1; if (*p == '\\') { @@ -180,7 +180,7 @@ parse__escape(ptr) } c = (c << 3) | (ch - '0'); } - if ((c & 0xffffff00) != 0) + if ((c & 0xffffff00) != 0) return -1; --p; } diff --git a/lib/libedit/parse.h b/lib/libedit/parse.h index 263076b30a5a..060174655354 100644 --- a/lib/libedit/parse.h +++ b/lib/libedit/parse.h @@ -42,7 +42,7 @@ #ifndef _h_el_parse #define _h_el_parse -protected int parse_line __P((EditLine *, const char *)); +protected int parse_line __P((EditLine *, const char *)); protected int parse__escape __P((const char ** const)); protected char * parse__string __P((char *, const char *)); protected int parse_cmd __P((EditLine *, const char *)); diff --git a/lib/libedit/prompt.c b/lib/libedit/prompt.c index cea7ad7d1334..59ba200c7312 100644 --- a/lib/libedit/prompt.c +++ b/lib/libedit/prompt.c @@ -83,7 +83,7 @@ prompt_print(el) /* prompt_init(): * Initialize the prompt stuff */ -protected int +protected int prompt_init(el) EditLine *el; { @@ -98,7 +98,7 @@ prompt_init(el) * Clean up the prompt stuff */ protected void -/*ARGSUSED*/ +/*ARGSUSED*/ prompt_end(el) EditLine *el; { @@ -108,7 +108,7 @@ prompt_end(el) /* prompt_set(): * Install a prompt printing function */ -protected int +protected int prompt_set(el, prf) EditLine *el; el_pfunc_t prf; diff --git a/lib/libedit/read.c b/lib/libedit/read.c index ccfc88b8f59d..05049e81f908 100644 --- a/lib/libedit/read.c +++ b/lib/libedit/read.c @@ -104,7 +104,7 @@ read__fixio(fd, e) if (fcntl(fd, F_SETFL, e & ~O_NDELAY) == -1) return -1; - else + else e = 1; # endif /* F_SETFL && O_NDELAY */ @@ -233,7 +233,7 @@ read_getcmd(el, cmdnum, ch) break; } } - if (el->el_map.alt == NULL) + if (el->el_map.alt == NULL) el->el_map.current = el->el_map.key; } *cmdnum = cmd; @@ -261,9 +261,9 @@ el_getc(el, cp) if (!read_preread(el)) break; } - if (ma->level < 0) + if (ma->level < 0) break; - + if (*ma->macro[ma->level] == 0) { ma->level--; continue; @@ -347,7 +347,7 @@ el_gets(el, nread) if (cmdnum >= el->el_map.nfunc) { /* BUG CHECK command */ #ifdef DEBUG_EDIT - (void) fprintf(el->el_errfile, + (void) fprintf(el->el_errfile, "ERROR: illegal command from key 0%o\r\n", ch); #endif /* DEBUG_EDIT */ continue; /* try again */ @@ -399,7 +399,7 @@ el_gets(el, nread) break; case CC_NEWLINE: /* normal end of line */ - num = el->el_line.lastchar - el->el_line.buffer; + num = el->el_line.lastchar - el->el_line.buffer; break; case CC_FATAL: /* fatal error, reset to known state */ diff --git a/lib/libedit/refresh.c b/lib/libedit/refresh.c index 51fe769c5141..6ad552283317 100644 --- a/lib/libedit/refresh.c +++ b/lib/libedit/refresh.c @@ -51,9 +51,9 @@ static char sccsid[] = "@(#)refresh.c 8.1 (Berkeley) 6/4/93"; private void re_addc __P((EditLine *, int)); private void re_update_line __P((EditLine *, char *, char *, int)); -private void re_insert __P((EditLine *, char *, int, int, +private void re_insert __P((EditLine *, char *, int, int, char *, int)); -private void re_delete __P((EditLine *, char *, int, int, +private void re_delete __P((EditLine *, char *, int, int, int)); private void re_fastputc __P((EditLine *, int)); @@ -61,7 +61,7 @@ private void re__strncopy __P((char *, char *, size_t)); private void re__copy_and_pad __P((char *, char *, size_t)); #ifdef DEBUG_REFRESH -private void re_printstr __P((EditLine *, char *, char *, +private void re_printstr __P((EditLine *, char *, char *, char *)); # define __F el->el_errfile # define RE_DEBUG(a, b, c) do \ @@ -83,7 +83,7 @@ re_printstr(el, str, f, t) while (f < t) RE_DEBUG(1,(__F, "%c", *f++ & 0177),); RE_DEBUG(1,(__F, "\"\r\n"),); -} +} #else # define RE_DEBUG(a, b, c) #endif @@ -117,9 +117,9 @@ re_addc(el, c) } else if (iscntrl(c)) { re_putc(el, '^'); - if (c == '\177') + if (c == '\177') re_putc(el, '?'); - else + else /* uncontrolify it; works only for iso8859-1 like sets */ re_putc(el, (c | 0100)); } @@ -145,11 +145,11 @@ re_putc(el, c) el->el_vdisplay[el->el_refresh.r_cursor.v][el->el_refresh.r_cursor.h] = c; el->el_refresh.r_cursor.h++; /* advance to next place */ if (el->el_refresh.r_cursor.h >= el->el_term.t_size.h) { - el->el_vdisplay[el->el_refresh.r_cursor.v][el->el_term.t_size.h] = '\0'; + el->el_vdisplay[el->el_refresh.r_cursor.v][el->el_term.t_size.h] = '\0'; /* assure end of line */ el->el_refresh.r_cursor.h = 0; /* reset it. */ el->el_refresh.r_cursor.v++; - RE_DEBUG(el->el_refresh.r_cursor.v >= el->el_term.t_size.v, + RE_DEBUG(el->el_refresh.r_cursor.v >= el->el_term.t_size.v, (__F, "\r\nre_putc: overflow! r_cursor.v == %d > %d\r\n", el->el_refresh.r_cursor.v, el->el_term.t_size.v), abort()); } @@ -195,12 +195,12 @@ re_refresh(el) cur.v = el->el_refresh.r_cursor.v; } /* must be done BEFORE the NUL is written */ - el->el_refresh.r_newcv = el->el_refresh.r_cursor.v; + el->el_refresh.r_newcv = el->el_refresh.r_cursor.v; re_putc(el, '\0'); /* put NUL on end */ - RE_DEBUG(1,(__F, + RE_DEBUG(1,(__F, "term.h=%d vcur.h=%d vcur.v=%d vdisplay[0]=\r\n:%80.80s:\r\n", - el->el_term.t_size.h, el->el_refresh.r_cursor.h, + el->el_term.t_size.h, el->el_refresh.r_cursor.h, el->el_refresh.r_cursor.v, el->el_vdisplay[0]),); RE_DEBUG(1,(__F, "updating %d lines.\r\n", el->el_refresh.r_newcv),); @@ -214,14 +214,14 @@ re_refresh(el) * cursor by writing the character that is at the end of the * screen line, it won't be a NUL or some old leftover stuff. */ - re__copy_and_pad(el->el_display[i], el->el_vdisplay[i], + re__copy_and_pad(el->el_display[i], el->el_vdisplay[i], el->el_term.t_size.h); } RE_DEBUG(1,(__F, "\r\nel->el_refresh.r_cursor.v=%d,el->el_refresh.r_oldcv=%d i=%d\r\n", el->el_refresh.r_cursor.v, el->el_refresh.r_oldcv, i),); - if (el->el_refresh.r_oldcv > el->el_refresh.r_newcv) + if (el->el_refresh.r_oldcv > el->el_refresh.r_newcv) for (; i <= el->el_refresh.r_oldcv; i++) { term_move_to_line(el, i); term_move_to_char(el, 0); @@ -231,11 +231,11 @@ re_refresh(el) #endif /* DEBUG_REFRESH */ *el->el_display[i] = '\0'; } - + el->el_refresh.r_oldcv = el->el_refresh.r_newcv; /* set for next time */ - RE_DEBUG(1,(__F, + RE_DEBUG(1,(__F, "\r\ncursor.h = %d, cursor.v = %d, cur.h = %d, cur.v = %d\r\n", - el->el_refresh.r_cursor.h, el->el_refresh.r_cursor.v, + el->el_refresh.r_cursor.h, el->el_refresh.r_cursor.v, cur.h, cur.v),); term_move_to_line(el, cur.v); /* go to where the cursor is */ term_move_to_char(el, cur.h); @@ -243,7 +243,7 @@ re_refresh(el) /* re_goto_bottom(): - * used to go to last used screen line + * used to go to last used screen line */ protected void re_goto_bottom(el) @@ -259,7 +259,7 @@ re_goto_bottom(el) /* re_insert(): * insert num characters of s into d (in front of the character) - * at dat, maximum length of d is dlen + * at dat, maximum length of d is dlen */ private void /*ARGSUSED*/ @@ -289,7 +289,7 @@ re_insert(el, d, dat, dlen, s, num) *b-- = *a--; d[dlen] = '\0'; /* just in case */ } - RE_DEBUG(1,(__F, + RE_DEBUG(1,(__F, "re_insert() after insert: %d at %d max %d, d == \"%s\"\n", num, dat, dlen, d),); RE_DEBUG(1,(__F, "s == \"%s\"n", s),); @@ -305,7 +305,7 @@ re_insert(el, d, dat, dlen, s, num) /* re_delete(): - * delete num characters d at dat, maximum length of d is dlen + * delete num characters d at dat, maximum length of d is dlen */ private void /*ARGSUSED*/ @@ -400,7 +400,7 @@ re_update_line(el, old, new, i) */ while (*o) o++; - /* + /* * Remove any trailing blanks off of the end, being careful not to * back up past the beginning. */ @@ -411,7 +411,7 @@ re_update_line(el, old, new, i) } oe = o; *oe = '\0'; - + while (*n) n++; @@ -423,7 +423,7 @@ re_update_line(el, old, new, i) } ne = n; *ne = '\0'; - + /* * if no diff, continue to next line of redraw */ @@ -574,7 +574,7 @@ re_update_line(el, old, new, i) ofd - old, osb - old, ose - old, ols - old, oe - old),); RE_DEBUG(1,(__F, "nfd %d, nsb %d, nse %d, nls %d, ne %d\n", nfd - new, nsb - new, nse - new, nls - new, ne - new),); - RE_DEBUG(1,(__F, + RE_DEBUG(1,(__F, "xxx-xxx:\"00000000001111111111222222222233333333334\"\r\n"),); RE_DEBUG(1,(__F, "xxx-xxx:\"01234567890123456789012345678901234567890\"\r\n"),); @@ -602,14 +602,14 @@ re_update_line(el, old, new, i) /* * at this point we have something like this: - * + * * /old /ofd /osb /ose /ols /oe * v.....................v v..................v v........v * eddie> Oh, my fredded gruntle-buggy is to me, as foo var lurgid as * eddie> Oh, my fredded quiux buggy is to me, as gruntle-lurgid as - * ^.....................^ ^..................^ ^........^ + * ^.....................^ ^..................^ ^........^ * \new \nfd \nsb \nse \nls \ne - * + * * fx is the difference in length between the the chars between nfd and * nsb, and the chars between ofd and osb, and is thus the number of * characters to delete if < 0 (new is shorter than old, as above), @@ -739,7 +739,7 @@ re_update_line(el, old, new, i) * Again a duplicate test. */ if (sx < 0) { - RE_DEBUG(!EL_CAN_DELETE, + RE_DEBUG(!EL_CAN_DELETE, (__F, "ERROR: cannot delete in second diff\n"),); term_deletechars(el, -sx); } @@ -769,7 +769,7 @@ re_update_line(el, old, new, i) */ if (nsb != ne) { RE_DEBUG(1,(__F, "with stuff to keep at end\r\n"),); - /* + /* * We have to recalculate fx here because we set it * to zero above as a flag saying that we hadn't done * an early first insert. @@ -874,7 +874,7 @@ re_refresh_cursor(el) th = el->el_term.t_size.h; /* optimize for speed */ /* do input buffer to el->el_line.cursor */ - for (cp = el->el_line.buffer; cp < el->el_line.cursor; cp++) { + for (cp = el->el_line.buffer; cp < el->el_line.cursor; cp++) { c = *cp & 0xFF; h++; /* all chars at least this long */ @@ -927,7 +927,7 @@ re_fastputc(el, c) { term__putc(c); el->el_display[el->el_cursor.v][el->el_cursor.h++] = c; - if (el->el_cursor.h >= el->el_term.t_size.h) { + if (el->el_cursor.h >= el->el_term.t_size.h) { /* if we must overflow */ el->el_cursor.h = 0; el->el_cursor.v++; @@ -940,7 +940,7 @@ re_fastputc(el, c) /* re_fastaddc(): * we added just one char, handle it fast. - * Assumes that screen cursor == real cursor + * Assumes that screen cursor == real cursor */ protected void re_fastaddc(el) @@ -974,7 +974,7 @@ re_fastaddc(el) /* re_clear_display(): - * clear the screen buffers so that new new prompt starts fresh. + * clear the screen buffers so that new new prompt starts fresh. */ protected void re_clear_display(el) @@ -991,7 +991,7 @@ re_clear_display(el) /* re_clear_lines(): - * Make sure all lines are *really* blank + * Make sure all lines are *really* blank */ protected void re_clear_lines(el) diff --git a/lib/libedit/search.c b/lib/libedit/search.c index 7b622fdeaca7..bf6099de7156 100644 --- a/lib/libedit/search.c +++ b/lib/libedit/search.c @@ -91,7 +91,7 @@ search_end(el) /* regerror(): * Handle regular expression errors */ -public void +public void /*ARGSUSED*/ regerror(msg) const char *msg; @@ -156,25 +156,25 @@ c_hmatch(el, str) (void) fprintf(el->el_errfile, "match `%s' with `%s'\n", el->el_search.patbuf, str); #endif /* SDEBUG */ - + return el_match(str, el->el_search.patbuf); } -/* c_setpat(): +/* c_setpat(): * Set the history seatch pattern */ protected void c_setpat(el) EditLine *el; { - if (el->el_state.lastcmd != ED_SEARCH_PREV_HISTORY && + if (el->el_state.lastcmd != ED_SEARCH_PREV_HISTORY && el->el_state.lastcmd != ED_SEARCH_NEXT_HISTORY) { el->el_search.patlen = EL_CURSOR(el) - el->el_line.buffer; - if (el->el_search.patlen >= EL_BUFSIZ) + if (el->el_search.patlen >= EL_BUFSIZ) el->el_search.patlen = EL_BUFSIZ -1; if (el->el_search.patlen >= 0) { - (void) strncpy(el->el_search.patbuf, el->el_line.buffer, + (void) strncpy(el->el_search.patbuf, el->el_line.buffer, el->el_search.patlen); el->el_search.patbuf[el->el_search.patlen] = '\0'; } @@ -185,8 +185,8 @@ c_setpat(el) (void) fprintf(el->el_errfile, "\neventno = %d\n", el->el_history.eventno); (void) fprintf(el->el_errfile, "patlen = %d\n", el->el_search.patlen); (void) fprintf(el->el_errfile, "patbuf = \"%s\"\n", el->el_search.patbuf); - (void) fprintf(el->el_errfile, "cursor %d lastchar %d\n", - EL_CURSOR(el) - el->el_line.buffer, + (void) fprintf(el->el_errfile, "cursor %d lastchar %d\n", + EL_CURSOR(el) - el->el_line.buffer, el->el_line.lastchar - el->el_line.buffer); #endif } @@ -213,7 +213,7 @@ ce_inc_search(el, dir) newdir = dir, done, redo; - if (el->el_line.lastchar + sizeof(STRfwd) / sizeof(char) + 2 + + if (el->el_line.lastchar + sizeof(STRfwd) / sizeof(char) + 2 + el->el_search.patlen >= el->el_line.limit) return CC_ERROR; @@ -228,12 +228,12 @@ ce_inc_search(el, dir) } done = redo = 0; *el->el_line.lastchar++ = '\n'; - for (cp = newdir == ED_SEARCH_PREV_HISTORY ? STRbck : STRfwd; + for (cp = newdir == ED_SEARCH_PREV_HISTORY ? STRbck : STRfwd; *cp; *el->el_line.lastchar++ = *cp++) continue; *el->el_line.lastchar++ = pchar; - for (cp = &el->el_search.patbuf[1]; - cp < &el->el_search.patbuf[el->el_search.patlen]; + for (cp = &el->el_search.patbuf[1]; + cp < &el->el_search.patbuf[el->el_search.patlen]; *el->el_line.lastchar++ = *cp++) continue; *el->el_line.lastchar = '\0'; @@ -268,7 +268,7 @@ ce_inc_search(el, dir) case ED_DELETE_PREV_CHAR: if (el->el_search.patlen > 1) done++; - else + else term_beep(el); break; @@ -284,15 +284,15 @@ ce_inc_search(el, dir) for (cp = &el->el_search.patbuf[1]; ; cp++) if (cp >= &el->el_search.patbuf[el->el_search.patlen]) { el->el_line.cursor += el->el_search.patlen - 1; - cp = c__next_word(el->el_line.cursor, + cp = c__next_word(el->el_line.cursor, el->el_line.lastchar, 1, ce__isword); - while (el->el_line.cursor < cp && + while (el->el_line.cursor < cp && *el->el_line.cursor != '\n') { if (el->el_search.patlen > EL_BUFSIZ - 3) { term_beep(el); break; } - el->el_search.patbuf[el->el_search.patlen++] = + el->el_search.patbuf[el->el_search.patlen++] = *el->el_line.cursor; *el->el_line.lastchar++ = *el->el_line.cursor++; } @@ -305,10 +305,10 @@ ce_inc_search(el, dir) break; } break; - + default: /* Terminate and execute cmd */ endcmd[0] = ch; - el_push(el, endcmd); + el_push(el, endcmd); /*FALLTHROUGH*/ case 0033: /* ESC: Terminate */ @@ -319,7 +319,7 @@ ce_inc_search(el, dir) break; } - while (el->el_line.lastchar > el->el_line.buffer && + while (el->el_line.lastchar > el->el_line.buffer && *el->el_line.lastchar != '\n') *el->el_line.lastchar-- = '\0'; *el->el_line.lastchar = '\0'; @@ -327,7 +327,7 @@ ce_inc_search(el, dir) if (!done) { /* Can't search if unmatched '[' */ - for (cp = &el->el_search.patbuf[el->el_search.patlen-1], ch = ']'; + for (cp = &el->el_search.patbuf[el->el_search.patlen-1], ch = ']'; cp > el->el_search.patbuf; cp--) if (*cp == '[' || *cp == ']') { ch = *cp; @@ -337,7 +337,7 @@ ce_inc_search(el, dir) if (el->el_search.patlen > 1 && ch != '[') { if (redo && newdir == dir) { if (pchar == '?') { /* wrap around */ - el->el_history.eventno = + el->el_history.eventno = newdir == ED_SEARCH_PREV_HISTORY ? 0 : 0x7fffffff; if (hist_get(el) == CC_ERROR) /* el->el_history.eventno was fixed by first call */ @@ -345,7 +345,7 @@ ce_inc_search(el, dir) el->el_line.cursor = newdir == ED_SEARCH_PREV_HISTORY ? el->el_line.lastchar : el->el_line.buffer; } else - el->el_line.cursor += + el->el_line.cursor += newdir == ED_SEARCH_PREV_HISTORY ? -1 : 1; } #ifdef ANCHOR @@ -353,19 +353,19 @@ ce_inc_search(el, dir) el->el_search.patbuf[el->el_search.patlen++] = '*'; #endif el->el_search.patbuf[el->el_search.patlen] = '\0'; - if (el->el_line.cursor < el->el_line.buffer || + if (el->el_line.cursor < el->el_line.buffer || el->el_line.cursor > el->el_line.lastchar || - (ret = ce_search_line(el, &el->el_search.patbuf[1], + (ret = ce_search_line(el, &el->el_search.patbuf[1], newdir)) == CC_ERROR) { /* avoid c_setpat */ - el->el_state.lastcmd = (el_action_t) newdir; + el->el_state.lastcmd = (el_action_t) newdir; ret = newdir == ED_SEARCH_PREV_HISTORY ? - ed_search_prev_history(el, 0) : + ed_search_prev_history(el, 0) : ed_search_next_history(el, 0); if (ret != CC_ERROR) { el->el_line.cursor = newdir == ED_SEARCH_PREV_HISTORY ? el->el_line.lastchar : el->el_line.buffer; - (void) ce_search_line(el, &el->el_search.patbuf[1], + (void) ce_search_line(el, &el->el_search.patbuf[1], newdir); } } @@ -386,7 +386,7 @@ ce_inc_search(el, dir) ret = ce_inc_search(el, newdir); - if (ret == CC_ERROR && pchar == '?' && oldpchar == ':') + if (ret == CC_ERROR && pchar == '?' && oldpchar == ':') /* break abort of failed search at last non-failed */ ret = CC_NORM; @@ -484,7 +484,7 @@ cv_search(el, dir) } el->el_state.lastcmd = (el_action_t) dir; /* avoid c_setpat */ el->el_line.cursor = el->el_line.lastchar = el->el_line.buffer; - if ((dir == ED_SEARCH_PREV_HISTORY ? ed_search_prev_history(el, 0) : + if ((dir == ED_SEARCH_PREV_HISTORY ? ed_search_prev_history(el, 0) : ed_search_next_history(el, 0)) == CC_ERROR) { re_refresh(el); return CC_ERROR; @@ -522,7 +522,7 @@ ce_search_line(el, pattern, dir) } return CC_ERROR; } else { - for (cp = el->el_line.cursor; *cp != '\0' && + for (cp = el->el_line.cursor; *cp != '\0' && cp < el->el_line.limit; cp++) if (el_match(cp, pattern)) { el->el_line.cursor = cp; @@ -542,7 +542,7 @@ cv_repeat_srch(el, c) int c; { #ifdef SDEBUG - (void) fprintf(el->el_errfile, "dir %d patlen %d patbuf %s\n", + (void) fprintf(el->el_errfile, "dir %d patlen %d patbuf %s\n", c, el->el_search.patlen, el->el_search.patbuf); #endif @@ -572,9 +572,9 @@ cv_csearch_back(el, ch, count, tflag) cp = el->el_line.cursor; while (count--) { - if (*cp == ch) + if (*cp == ch) cp--; - while (cp > el->el_line.buffer && *cp != ch) + while (cp > el->el_line.buffer && *cp != ch) cp--; } @@ -609,9 +609,9 @@ cv_csearch_fwd(el, ch, count, tflag) cp = el->el_line.cursor; while (count--) { - if(*cp == ch) + if(*cp == ch) cp++; - while (cp < el->el_line.lastchar && *cp != ch) + while (cp < el->el_line.lastchar && *cp != ch) cp++; } diff --git a/lib/libedit/search.h b/lib/libedit/search.h index 51c58b4ab5ee..346b38c25866 100644 --- a/lib/libedit/search.h +++ b/lib/libedit/search.h @@ -39,8 +39,8 @@ /* * el.search.h: Line and history searching utilities */ -#ifndef _h_el_search -#define _h_el_search +#ifndef _h_el_search +#define _h_el_search #include "histedit.h" diff --git a/lib/libedit/sig.c b/lib/libedit/sig.c index 94ab4bb8380b..a16f5f161165 100644 --- a/lib/libedit/sig.c +++ b/lib/libedit/sig.c @@ -91,7 +91,7 @@ sig_handler(signo) break; } - for (i = 0; sighdl[i] != -1; i++) + for (i = 0; sighdl[i] != -1; i++) if (signo == sighdl[i]) break; @@ -120,7 +120,7 @@ sig_init(el) #define SIGSIZE (sizeof(sighdl) / sizeof(sighdl[0]) * sizeof(sig_t)) el->el_signal = (sig_t *) el_malloc(SIGSIZE); - for (i = 0; sighdl[i] != -1; i++) + for (i = 0; sighdl[i] != -1; i++) el->el_signal[i] = BADSIG; (void) sigprocmask(SIG_SETMASK, &oset, NULL); @@ -184,7 +184,7 @@ sig_clr(el) #undef _DO (void) sigprocmask(SIG_BLOCK, &nset, &oset); - for (i = 0; sighdl[i] != -1; i++) + for (i = 0; sighdl[i] != -1; i++) if (el->el_signal[i] != BADSIG) (void) signal(sighdl[i], el->el_signal[i]); diff --git a/lib/libedit/term.c b/lib/libedit/term.c index 053f052b1d1a..8d641f0e075e 100644 --- a/lib/libedit/term.c +++ b/lib/libedit/term.c @@ -177,7 +177,7 @@ private struct termcapstr { { "ho", "home cursor" }, #define T_ic 13 { "ic", "insert character" }, -#define T_im 14 +#define T_im 14 { "im", "start insert mode" }, #define T_ip 15 { "ip", "insert padding" }, @@ -251,7 +251,7 @@ private void term_rebuffer_display __P((EditLine *)); private void term_free_display __P((EditLine *)); private void term_alloc_display __P((EditLine *)); private void term_alloc __P((EditLine *, - struct termcapstr *, char *)); + struct termcapstr *, char *)); private void term_init_arrow __P((EditLine *)); private void term_reset_arrow __P((EditLine *)); @@ -267,7 +267,7 @@ term_setflags(el) EditLine *el; { EL_FLAGS = 0; - if (el->el_tty.t_tabs) + if (el->el_tty.t_tabs) EL_FLAGS |= (Val(T_pt) && !Val(T_xt)) ? TERM_CAN_TAB : 0; EL_FLAGS |= (Val(T_km) || Val(T_MT)) ? TERM_HAS_META : 0; @@ -485,7 +485,7 @@ term_free_display(el) protected void term_move_to_line(el, where) EditLine *el; - int where; + int where; { int del, i; @@ -494,7 +494,7 @@ term_move_to_line(el, where) if (where > el->el_term.t_size.v) { #ifdef DEBUG_SCREEN - (void) fprintf(el->el_errfile, + (void) fprintf(el->el_errfile, "term_move_to_line: where is ridiculous: %d\r\n", where); #endif /* DEBUG_SCREEN */ return; @@ -538,7 +538,7 @@ mc_again: if (where > (el->el_term.t_size.h + 1)) { #ifdef DEBUG_SCREEN - (void) fprintf(el->el_errfile, + (void) fprintf(el->el_errfile, "term_move_to_char: where is riduculous: %d\r\n", where); #endif /* DEBUG_SCREEN */ return; @@ -563,7 +563,7 @@ mc_again: if (EL_CAN_TAB) { /* if I can do tabs, use them */ if ((el->el_cursor.h & 0370) != (where & 0370)) { /* if not within tab stop */ - for (i = (el->el_cursor.h & 0370); + for (i = (el->el_cursor.h & 0370); i < (where & 0370); i += 8) term__putc('\t'); /* then tab over */ el->el_cursor.h = where & 0370; @@ -572,8 +572,8 @@ mc_again: /* it's usually cheaper to just write the chars, so we do. */ /* NOTE THAT term_overwrite() WILL CHANGE el->el_cursor.h!!! */ - term_overwrite(el, - &el->el_display[el->el_cursor.v][el->el_cursor.h], + term_overwrite(el, + &el->el_display[el->el_cursor.v][el->el_cursor.h], where - el->el_cursor.h); } @@ -644,7 +644,7 @@ term_deletechars(el, num) if (num > el->el_term.t_size.h) { #ifdef DEBUG_SCREEN - (void) fprintf(el->el_errfile, + (void) fprintf(el->el_errfile, "term_deletechars: num is riduculous: %d\r\n", num); #endif /* DEBUG_SCREEN */ return; @@ -669,11 +669,11 @@ term_deletechars(el, num) /* term_insertwrite(): - * Puts terminal in insert character mode or inserts num - * characters in the line + * Puts terminal in insert character mode or inserts num + * characters in the line */ protected void -term_insertwrite(el, cp, num) +term_insertwrite(el, cp, num) EditLine *el; char *cp; int num; @@ -705,7 +705,7 @@ term_insertwrite(el, cp, num) (void) tputs(Str(T_im), 1, term__putc); el->el_cursor.h += num; - do + do term__putc(*cp++); while (--num); @@ -732,10 +732,10 @@ term_insertwrite(el, cp, num) /* term_clear_EOL(): - * clear to end of line. There are num characters to clear + * clear to end of line. There are num characters to clear */ protected void -term_clear_EOL(el, num) +term_clear_EOL(el, num) EditLine *el; int num; { @@ -752,7 +752,7 @@ term_clear_EOL(el, num) /* term_clear_screen(): - * Clear the screen + * Clear the screen */ protected void term_clear_screen(el) @@ -839,14 +839,14 @@ term_set(el, term) i = tgetent(el->el_term.t_cap, term); if (i <= 0) { - if (i == -1) + if (i == -1) #ifdef __FreeBSD__ (void) fprintf(el->el_errfile, "Cannot open /usr/share/misc/termcap.\n"); #else (void) fprintf(el->el_errfile, "Cannot open /etc/termcap.\n"); #endif - else if (i == 0) - (void) fprintf(el->el_errfile, + else if (i == 0) + (void) fprintf(el->el_errfile, "No entry for terminal type \"%s\"\n", term); (void) fprintf(el->el_errfile, "using dumb terminal settings.\n"); Val(T_co) = 80; /* do a dumb terminal */ @@ -889,7 +889,7 @@ term_set(el, term) /* term_get_size(): * Return the new window size in lines and cols, and - * true if the size was changed. + * true if the size was changed. */ protected int term_get_size(el, lins, cols) @@ -977,7 +977,7 @@ term_init_arrow(el) * Reset arrow key bindings */ private void -term_reset_arrow(el) +term_reset_arrow(el) EditLine *el; { fkey_t *arrow = el->el_term.t_fkey; @@ -1101,8 +1101,8 @@ term_bind_arrow(el) /* * Assign the arrow keys only if: * - * 1. They are multi-character arrow keys and the user - * has not re-assigned the leading character, or + * 1. They are multi-character arrow keys and the user + * has not re-assigned the leading character, or * has re-assigned the leading character to be * ED_SEQUENCE_LEAD_IN * 2. They are single arrow keys pointing to an unassigned key. @@ -1110,7 +1110,7 @@ term_bind_arrow(el) if (arrow[i].type == XK_NOD) key_clear(el, map, p); else { - if (p[1] && (dmap[j] == map[j] || + if (p[1] && (dmap[j] == map[j] || map[j] == ED_SEQUENCE_LEAD_IN)) { key_add(el, p, &arrow[i].fun, arrow[i].type); map[j] = ED_SEQUENCE_LEAD_IN; @@ -1167,21 +1167,21 @@ term_telltc(el, argc, argv) (void) fprintf(el->el_outfile, "\tfollowing characteristics:\n\n"); (void) fprintf(el->el_outfile, "\tIt has %d columns and %d lines\n", Val(T_co), Val(T_li)); - (void) fprintf(el->el_outfile, + (void) fprintf(el->el_outfile, "\tIt has %s meta key\n", EL_HAS_META ? "a" : "no"); - (void) fprintf(el->el_outfile, + (void) fprintf(el->el_outfile, "\tIt can%suse tabs\n", EL_CAN_TAB ? " " : "not "); #ifdef notyet - (void) fprintf(el->el_outfile, "\tIt %s automatic margins\n", + (void) fprintf(el->el_outfile, "\tIt %s automatic margins\n", (T_Margin&MARGIN_AUTO)? "has": "does not have"); if (T_Margin & MARGIN_AUTO) - (void) fprintf(el->el_outfile, "\tIt %s magic margins\n", + (void) fprintf(el->el_outfile, "\tIt %s magic margins\n", (T_Margin&MARGIN_MAGIC)?"has":"does not have"); #endif for (t = tstr, ts = el->el_term.t_str; t->name != NULL; t++, ts++) - (void) fprintf(el->el_outfile, "\t%25s (%s) == %s\n", t->long_name, - t->name, *ts && **ts ? + (void) fprintf(el->el_outfile, "\t%25s (%s) == %s\n", t->long_name, + t->name, *ts && **ts ? key__decode_str(*ts, upbuf, "") : "(empty)"); (void) fputc('\n', el->el_outfile); return 0; @@ -1229,7 +1229,7 @@ term_settc(el, argc, argv) break; if (tv->name != NULL) { - if (tv == &tval[T_pt] || tv == &tval[T_km] + if (tv == &tval[T_pt] || tv == &tval[T_km] #ifdef notyet || tv == &tval[T_am] || tv == &tval[T_xn] #endif @@ -1309,12 +1309,12 @@ term_echotc(el, argc, argv) } #ifdef notyet else if (strcmp(*argv, "xn") == 0) { - (void) fprintf(el->el_outfile, fmts, T_Margin & MARGIN_MAGIC ? + (void) fprintf(el->el_outfile, fmts, T_Margin & MARGIN_MAGIC ? "yes" : "no"); return 0; } else if (strcmp(*argv, "am") == 0) { - (void) fprintf(el->el_outfile, fmts, T_Margin & MARGIN_AUTO ? + (void) fprintf(el->el_outfile, fmts, T_Margin & MARGIN_AUTO ? "yes" : "no"); return 0; } @@ -1339,7 +1339,7 @@ term_echotc(el, argc, argv) return 0; } - /* + /* * Try to use our local definition first */ scap = NULL; @@ -1352,7 +1352,7 @@ term_echotc(el, argc, argv) scap = tgetstr(*argv, &area); if (!scap || scap[0] == '\0') { if (!silent) - (void) fprintf(el->el_errfile, + (void) fprintf(el->el_errfile, "echotc: Termcap parameter `%s' not found.\n", *argv); return -1; } @@ -1383,7 +1383,7 @@ term_echotc(el, argc, argv) * hpux has lot's of them... */ if (verbose) - (void) fprintf(el->el_errfile, + (void) fprintf(el->el_errfile, "echotc: Warning: unknown termcap %% `%c'.\n", *cap); /* This is bad, but I won't complain */ break; @@ -1394,7 +1394,7 @@ term_echotc(el, argc, argv) argv++; if (*argv && *argv[0]) { if (!silent) - (void) fprintf(el->el_errfile, + (void) fprintf(el->el_errfile, "echotc: Warning: Extra argument `%s'.\n", *argv); return -1; } @@ -1404,7 +1404,7 @@ term_echotc(el, argc, argv) argv++; if (!*argv || *argv[0] == '\0') { if (!silent) - (void) fprintf(el->el_errfile, + (void) fprintf(el->el_errfile, "echotc: Warning: Missing argument.\n"); return -1; } @@ -1413,7 +1413,7 @@ term_echotc(el, argc, argv) argv++; if (*argv && *argv[0]) { if (!silent) - (void) fprintf(el->el_errfile, + (void) fprintf(el->el_errfile, "echotc: Warning: Extra argument `%s'.\n", *argv); return -1; } @@ -1422,15 +1422,15 @@ term_echotc(el, argc, argv) default: /* This is wrong, but I will ignore it... */ if (verbose) - (void) fprintf(el->el_errfile, - "echotc: Warning: Too many required arguments (%d).\n", + (void) fprintf(el->el_errfile, + "echotc: Warning: Too many required arguments (%d).\n", arg_need); /*FALLTHROUGH*/ case 2: argv++; if (!*argv || *argv[0] == '\0') { if (!silent) - (void) fprintf(el->el_errfile, + (void) fprintf(el->el_errfile, "echotc: Warning: Missing argument.\n"); return -1; } @@ -1438,7 +1438,7 @@ term_echotc(el, argc, argv) argv++; if (!*argv || *argv[0] == '\0') { if (!silent) - (void) fprintf(el->el_errfile, + (void) fprintf(el->el_errfile, "echotc: Warning: Missing argument.\n"); return -1; } @@ -1446,7 +1446,7 @@ term_echotc(el, argc, argv) argv++; if (*argv && *argv[0]) { if (!silent) - (void) fprintf(el->el_errfile, + (void) fprintf(el->el_errfile, "echotc: Warning: Extra argument `%s'.\n", *argv); return -1; } diff --git a/lib/libedit/term.h b/lib/libedit/term.h index 416e73ee8faa..26da7c30d43c 100644 --- a/lib/libedit/term.h +++ b/lib/libedit/term.h @@ -92,7 +92,7 @@ protected int term_init __P((EditLine *)); protected void term_bind_arrow __P((EditLine *)); protected void term_print_arrow __P((EditLine *, char *)); protected int term_clear_arrow __P((EditLine *, char *)); -protected int term_set_arrow __P((EditLine *, char *, +protected int term_set_arrow __P((EditLine *, char *, key_value_t *, int)); protected void term_end __P((EditLine *)); protected int term_set __P((EditLine *, char *)); diff --git a/lib/libedit/tokenizer.c b/lib/libedit/tokenizer.c index 41095fa980f6..bbe847e2cab2 100644 --- a/lib/libedit/tokenizer.c +++ b/lib/libedit/tokenizer.c @@ -155,7 +155,7 @@ tok_end(tok) * 3: Quoted return * 2: Unmatched double quote * 1: Unmatched single quote - * 0: Ok + * 0: Ok */ public int tok_line(tok, line, argc, argv) @@ -225,7 +225,7 @@ tok_line(tok, line, argc, argv) *tok->wptr++ = *ptr; break; - default: + default: return(-1); } break; @@ -242,7 +242,7 @@ tok_line(tok, line, argc, argv) tok->quote = Q_doubleone;/* Quote next character */ break; - case Q_one: + case Q_one: *tok->wptr++ = *ptr; tok->quote = Q_none; /* Quote this, restore state */ break; @@ -274,7 +274,7 @@ tok_line(tok, line, argc, argv) case Q_double: *tok->wptr++ = *ptr; /* Add the return */ break; - + case Q_doubleone: tok->flags |= TOK_EAT; tok->quote = Q_double; /* Back to double, eat the '\n' */ @@ -377,7 +377,7 @@ tok_line(tok, line, argc, argv) if (tok->argc >= tok->amax - 4) { tok->amax += AINCR; - tok->argv = (char **) tok_realloc(tok->argv, + tok->argv = (char **) tok_realloc(tok->argv, tok->amax * sizeof(char*)); } diff --git a/lib/libedit/tokenizer.h b/lib/libedit/tokenizer.h index d495dc69ab02..86911e15d5f3 100644 --- a/lib/libedit/tokenizer.h +++ b/lib/libedit/tokenizer.h @@ -47,7 +47,7 @@ typedef struct tokenizer Tokenizer; Tokenizer *tok_init __P((const char *)); void tok_reset __P((Tokenizer *)); void tok_end __P((Tokenizer *)); -int tok_line __P((Tokenizer *, const char *, +int tok_line __P((Tokenizer *, const char *, int *, char ***)); #endif /* _h_tokenizer */ diff --git a/lib/libedit/tty.c b/lib/libedit/tty.c index ac99843b7746..6fdf5ea4491d 100644 --- a/lib/libedit/tty.c +++ b/lib/libedit/tty.c @@ -38,7 +38,7 @@ static char sccsid[] = "@(#)tty.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint && not SCCSID */ -/* +/* * tty.c: tty interface stuff */ #include "sys.h" @@ -57,7 +57,7 @@ typedef struct ttymap_t { } ttymap_t; -private ttyperm_t ttyperm = { +private ttyperm_t ttyperm = { { { "iflag:", ICRNL, (INLCR|IGNCR) }, { "oflag:", (OPOST|ONLCR), ONLRET }, @@ -87,8 +87,8 @@ private ttyperm_t ttyperm = { private ttychar_t ttychar = { { - CINTR, CQUIT, CERASE, CKILL, - CEOF, CEOL, CEOL2, CSWTCH, + CINTR, CQUIT, CERASE, CKILL, + CEOF, CEOL, CEOL2, CSWTCH, CDSWTCH, CERASE2, CSTART, CSTOP, CWERASE, CSUSP, CDSUSP, CREPRINT, CDISCARD, CLNEXT, CSTATUS, CPAGE, @@ -96,15 +96,15 @@ private ttychar_t ttychar = { CTIME }, { - CINTR, CQUIT, CERASE, CKILL, - _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, - _POSIX_VDISABLE, CERASE2, CSTART, CSTOP, - _POSIX_VDISABLE, CSUSP, _POSIX_VDISABLE, _POSIX_VDISABLE, - CDISCARD, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, + CINTR, CQUIT, CERASE, CKILL, + _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, + _POSIX_VDISABLE, CERASE2, CSTART, CSTOP, + _POSIX_VDISABLE, CSUSP, _POSIX_VDISABLE, _POSIX_VDISABLE, + CDISCARD, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, 1, 0 }, - { + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -117,38 +117,38 @@ private ttychar_t ttychar = { private ttymap_t tty_map[] = { #ifdef VERASE - { C_ERASE, VERASE, + { C_ERASE, VERASE, { ED_DELETE_PREV_CHAR, VI_DELETE_PREV_CHAR, ED_PREV_CHAR } }, #endif /* VERASE */ #ifdef VERASE2 - { C_ERASE2, VERASE2, + { C_ERASE2, VERASE2, { ED_DELETE_PREV_CHAR, VI_DELETE_PREV_CHAR, ED_PREV_CHAR } }, #endif /* VERASE2 */ #ifdef VKILL - { C_KILL, VKILL, + { C_KILL, VKILL, { EM_KILL_LINE, VI_KILL_LINE_PREV, ED_UNASSIGNED } }, #endif /* VKILL */ #ifdef VKILL2 - { C_KILL2, VKILL2, + { C_KILL2, VKILL2, { EM_KILL_LINE, VI_KILL_LINE_PREV, ED_UNASSIGNED } }, #endif /* VKILL2 */ #ifdef VEOF - { C_EOF, VEOF, + { C_EOF, VEOF, { EM_DELETE_OR_LIST, VI_LIST_OR_EOF, ED_UNASSIGNED } }, #endif /* VEOF */ #ifdef VWERASE - { C_WERASE, VWERASE, + { C_WERASE, VWERASE, { ED_DELETE_PREV_WORD, ED_DELETE_PREV_WORD, ED_PREV_WORD } }, #endif /* VWERASE */ #ifdef VREPRINT - { C_REPRINT, VREPRINT, + { C_REPRINT, VREPRINT, { ED_REDISPLAY, ED_INSERT, ED_REDISPLAY } }, #endif /* VREPRINT */ #ifdef VLNEXT - { C_LNEXT, VLNEXT, + { C_LNEXT, VLNEXT, { ED_QUOTED_INSERT, ED_QUOTED_INSERT, ED_UNASSIGNED } }, #endif /* VLNEXT */ - { -1, -1, + { -1, -1, { ED_UNASSIGNED, ED_UNASSIGNED, ED_UNASSIGNED } } }; @@ -359,7 +359,7 @@ private ttymodes_t ttymodes[] = { { "extproc",EXTPROC, M_LIN }, # endif /* EXTPROC */ -# if defined(VINTR) +# if defined(VINTR) { "intr", C_SH(C_INTR), M_CHAR }, # endif /* VINTR */ # if defined(VQUIT) @@ -422,7 +422,7 @@ private ttymodes_t ttymodes[] = { # if defined(VPGOFF) { "pgoff", C_SH(C_PGOFF), M_CHAR }, # endif /* VPGOFF */ -# if defined(VKILL2) +# if defined(VKILL2) { "kill2", C_SH(C_KILL2), M_CHAR }, # endif /* VKILL2 */ # if defined(VBRK) @@ -440,7 +440,7 @@ private ttymodes_t ttymodes[] = { #define tty_getty(el, td) tcgetattr((el)->el_infd, (td)) -#define tty_setty(el, td) tcsetattr((el)->el_infd, TCSADRAIN, (td)) +#define tty_setty(el, td) tcsetattr((el)->el_infd, TCSADRAIN, (td)) #define tty__gettabs(td) ((((td)->c_oflag & TAB3) == TAB3) ? 0 : 1) #define tty__geteightbit(td) (((td)->c_cflag & CSIZE) == CS8) @@ -457,14 +457,14 @@ private int tty_setup __P((EditLine *)); /* tty_setup(): * Get the tty parameters and initialize the editing state */ -private int +private int tty_setup(el) EditLine *el; { int rst = 1; if (tty_getty(el, &el->el_tty.t_ed) == -1) { #ifdef DEBUG_TTY - (void) fprintf(el->el_errfile, + (void) fprintf(el->el_errfile, "tty_setup: tty_getty: %s\n", strerror(errno)); #endif /* DEBUG_TTY */ return(-1); @@ -509,7 +509,7 @@ tty_setup(el) tty__setchar(&el->el_tty.t_ex, el->el_tty.t_c[EX_IO]); if (tty_setty(el, &el->el_tty.t_ex) == -1) { #ifdef DEBUG_TTY - (void) fprintf(el->el_errfile, "tty_setup: tty_setty: %s\n", + (void) fprintf(el->el_errfile, "tty_setup: tty_setty: %s\n", strerror(errno)); #endif /* DEBUG_TTY */ return(-1); @@ -580,7 +580,7 @@ private void tty__getchar(td, s) struct termios *td; unsigned char *s; -{ +{ # ifdef VINTR s[C_INTR] = td->c_cc[VINTR]; # endif /* VINTR */ @@ -663,7 +663,7 @@ private void tty__setchar(td, s) struct termios *td; unsigned char *s; -{ +{ # ifdef VINTR td->c_cc[VINTR] = s[C_INTR]; # endif /* VINTR */ @@ -810,7 +810,7 @@ tty_rawmode(el) el->el_tty.t_eight = tty__geteightbit(&el->el_tty.t_ts); el->el_tty.t_speed = tty__getspeed(&el->el_tty.t_ts); - if (tty__getspeed(&el->el_tty.t_ex) != el->el_tty.t_speed || + if (tty__getspeed(&el->el_tty.t_ex) != el->el_tty.t_speed || tty__getspeed(&el->el_tty.t_ed) != el->el_tty.t_speed) { (void) cfsetispeed(&el->el_tty.t_ex, el->el_tty.t_speed); (void) cfsetospeed(&el->el_tty.t_ex, el->el_tty.t_speed); @@ -819,7 +819,7 @@ tty_rawmode(el) } if (tty__cooked_mode(&el->el_tty.t_ts)) { - if (el->el_tty.t_ts.c_cflag != el->el_tty.t_ex.c_cflag) { + if (el->el_tty.t_ts.c_cflag != el->el_tty.t_ex.c_cflag) { el->el_tty.t_ex.c_cflag = el->el_tty.t_ts.c_cflag; el->el_tty.t_ex.c_cflag &= ~el->el_tty.t_t[EX_IO][M_CTL].t_clrmask; el->el_tty.t_ex.c_cflag |= el->el_tty.t_t[EX_IO][M_CTL].t_setmask; @@ -862,9 +862,9 @@ tty_rawmode(el) el->el_tty.t_ed.c_oflag |= el->el_tty.t_t[ED_IO][M_OUT].t_setmask; } - if (tty__gettabs(&el->el_tty.t_ex) == 0) + if (tty__gettabs(&el->el_tty.t_ex) == 0) el->el_tty.t_tabs = 0; - else + else el->el_tty.t_tabs = EL_CAN_TAB ? 1 : 0; { @@ -879,7 +879,7 @@ tty_rawmode(el) for (i = 0; i < C_NCC; i++) if (el->el_tty.t_c[TS_IO][i] != el->el_tty.t_c[EX_IO][i]) break; - + if (i != C_NCC) { /* * Propagate changes only to the unprotected chars @@ -910,7 +910,7 @@ tty_rawmode(el) if (tty_setty(el, &el->el_tty.t_ed) == -1) { #ifdef DEBUG_TTY - (void) fprintf(el->el_errfile, "tty_rawmode: tty_setty: %s\n", + (void) fprintf(el->el_errfile, "tty_rawmode: tty_setty: %s\n", strerror(errno)); #endif /* DEBUG_TTY */ return -1; @@ -932,7 +932,7 @@ tty_cookedmode(el) if (tty_setty(el, &el->el_tty.t_ex) == -1) { #ifdef DEBUG_TTY - (void) fprintf(el->el_errfile, "tty_cookedmode: tty_setty: %s\n", + (void) fprintf(el->el_errfile, "tty_cookedmode: tty_setty: %s\n", strerror(errno)); #endif /* DEBUG_TTY */ return -1; @@ -968,7 +968,7 @@ tty_quotemode(el) if (tty_setty(el, &el->el_tty.t_qu) == -1) { #ifdef DEBUG_TTY - (void) fprintf(el->el_errfile, "QuoteModeOn: tty_setty: %s\n", + (void) fprintf(el->el_errfile, "QuoteModeOn: tty_setty: %s\n", strerror(errno)); #endif /* DEBUG_TTY */ return -1; @@ -989,7 +989,7 @@ tty_noquotemode(el) return 0; if (tty_setty(el, &el->el_tty.t_ed) == -1) { #ifdef DEBUG_TTY - (void) fprintf(el->el_errfile, "QuoteModeOff: tty_setty: %s\n", + (void) fprintf(el->el_errfile, "QuoteModeOff: tty_setty: %s\n", strerror(errno)); #endif /* DEBUG_TTY */ return -1; @@ -1019,7 +1019,7 @@ tty_stty(el, argc, argv) return -1; name = *argv++; - while (argv && *argv && argv[0][0] == '-' && argv[0][2] == '\0') + while (argv && *argv && argv[0][0] == '-' && argv[0][2] == '\0') switch (argv[0][1]) { case 'a': aflag++; @@ -1048,7 +1048,7 @@ tty_stty(el, argc, argv) int len = 0, st = 0, cu; for (m = ttymodes; m->m_name; m++) { if (m->m_type != i) { - (void) fprintf(el->el_outfile, "%s%s", i != -1 ? "\n" : "", + (void) fprintf(el->el_outfile, "%s%s", i != -1 ? "\n" : "", el->el_tty.t_t[z][m->m_type].t_name); i = m->m_type; st = len = strlen(el->el_tty.t_t[z][m->m_type].t_name); @@ -1065,7 +1065,7 @@ tty_stty(el, argc, argv) (void) fprintf(el->el_outfile, "\n%*s", st, ""); len = st + cu; } - else + else len += cu; if (x != '\0') @@ -1131,7 +1131,7 @@ tty_printchar(el, s) int i; for (i = 0; i < C_NCC; i++) { - for (m = el->el_tty.t_t; m->m_name; m++) + for (m = el->el_tty.t_t; m->m_name; m++) if (m->m_type == M_CHAR && C_SH(i) == m->m_value) break; if (m->m_name) @@ -1139,6 +1139,6 @@ tty_printchar(el, s) if (i % 5 == 0) (void) fprintf(el->el_errfile, "\n"); } - (void) fprintf(el->el_errfile, "\n"); + (void) fprintf(el->el_errfile, "\n"); } #endif /* notyet */ diff --git a/lib/libedit/tty.h b/lib/libedit/tty.h index 12da50dcb5bd..14ba10911a0d 100644 --- a/lib/libedit/tty.h +++ b/lib/libedit/tty.h @@ -46,7 +46,7 @@ #include <termios.h> /* Define our own since everyone gets it wrong! */ -#define CONTROL(A) ((A) & 037) +#define CONTROL(A) ((A) & 037) /* * Aix compatible names @@ -444,7 +444,7 @@ #define M_CHAR 4 #define M_NN 5 -typedef struct { +typedef struct { char *t_name; int t_setmask; int t_clrmask; diff --git a/lib/libedit/vi.c b/lib/libedit/vi.c index 030ee2286b0d..1a467809dd88 100644 --- a/lib/libedit/vi.c +++ b/lib/libedit/vi.c @@ -59,7 +59,7 @@ cv_action(el, c) if (el->el_chared.c_vcmd.action & DELETE) { el->el_chared.c_vcmd.action = NOP; el->el_chared.c_vcmd.pos = 0; - + el->el_chared.c_undo.isize = 0; el->el_chared.c_undo.dsize = 0; kp = el->el_chared.c_undo.buf; @@ -67,14 +67,14 @@ cv_action(el, c) *kp++ = *cp; el->el_chared.c_undo.dsize++; } - + el->el_chared.c_undo.action = INSERT; el->el_chared.c_undo.ptr = el->el_line.buffer; el->el_line.lastchar = el->el_line.buffer; el->el_line.cursor = el->el_line.buffer; if (c & INSERT) el->el_map.current = el->el_map.key; - + return CC_REFRESH; } @@ -111,7 +111,7 @@ cv_paste(el, c) char *ptr; c_undo_t *un = &el->el_chared.c_undo; #ifdef DEBUG_PASTE - (void) fprintf(el->el_errfile, "Paste: %x \"%s\" +%d -%d\n", + (void) fprintf(el->el_errfile, "Paste: %x \"%s\" +%d -%d\n", un->action, un->buf, un->isize, un->dsize); #endif if (un->isize == 0) @@ -120,7 +120,7 @@ cv_paste(el, c) if (!c && el->el_line.cursor < el->el_line.lastchar) el->el_line.cursor++; ptr = el->el_line.cursor; - + c_insert(el, un->isize); if (el->el_line.cursor + un->isize > el->el_line.lastchar) return CC_ERROR; @@ -129,7 +129,7 @@ cv_paste(el, c) } -/* vi_paste_next(): +/* vi_paste_next(): * Vi paste previous deletion to the right of the cursor * [p] */ @@ -143,7 +143,7 @@ vi_paste_next(el, c) } -/* vi_paste_prev(): +/* vi_paste_prev(): * Vi paste previous deletion to the left of the cursor * [P] */ @@ -157,7 +157,7 @@ vi_paste_prev(el, c) } -/* vi_prev_space_word(): +/* vi_prev_space_word(): * Vi move to the previous space delimited word * [B] */ @@ -170,10 +170,10 @@ vi_prev_space_word(el, c) if (el->el_line.cursor == el->el_line.buffer) return CC_ERROR; - el->el_line.cursor = cv_prev_word(el, el->el_line.cursor, - el->el_line.buffer, - el->el_state.argument, - cv__isword); + el->el_line.cursor = cv_prev_word(el, el->el_line.cursor, + el->el_line.buffer, + el->el_state.argument, + cv__isword); if (el->el_chared.c_vcmd.action & DELETE) { cv_delfini(el); @@ -184,7 +184,7 @@ vi_prev_space_word(el, c) } -/* vi_prev_word(): +/* vi_prev_word(): * Vi move to the previous word * [B] */ @@ -197,10 +197,10 @@ vi_prev_word(el, c) if (el->el_line.cursor == el->el_line.buffer) return CC_ERROR; - el->el_line.cursor = cv_prev_word(el, el->el_line.cursor, - el->el_line.buffer, - el->el_state.argument, - ce__isword); + el->el_line.cursor = cv_prev_word(el, el->el_line.cursor, + el->el_line.buffer, + el->el_state.argument, + ce__isword); if (el->el_chared.c_vcmd.action & DELETE) { cv_delfini(el); @@ -211,7 +211,7 @@ vi_prev_word(el, c) } -/* vi_next_space_word(): +/* vi_next_space_word(): * Vi move to the next space delimited word * [W] */ @@ -224,9 +224,9 @@ vi_next_space_word(el, c) if (el->el_line.cursor == el->el_line.lastchar) return CC_ERROR; - el->el_line.cursor = cv_next_word(el, el->el_line.cursor, - el->el_line.lastchar, - el->el_state.argument, + el->el_line.cursor = cv_next_word(el, el->el_line.cursor, + el->el_line.lastchar, + el->el_state.argument, cv__isword); if (el->el_map.type == MAP_VI) @@ -238,7 +238,7 @@ vi_next_space_word(el, c) return CC_CURSOR; } -/* vi_next_word(): +/* vi_next_word(): * Vi move to the next word * [w] */ @@ -251,8 +251,8 @@ vi_next_word(el, c) if (el->el_line.cursor == el->el_line.lastchar) return CC_ERROR; - el->el_line.cursor = cv_next_word(el, el->el_line.cursor, - el->el_line.lastchar, + el->el_line.cursor = cv_next_word(el, el->el_line.cursor, + el->el_line.lastchar, el->el_state.argument, ce__isword); @@ -267,7 +267,7 @@ vi_next_word(el, c) -/* vi_change_case(): +/* vi_change_case(): * Vi change case of character under the cursor and advance one character * [~] */ @@ -291,7 +291,7 @@ vi_change_case(el, c) } -/* vi_change_meta(): +/* vi_change_meta(): * Vi change prefix command * [c] */ @@ -309,7 +309,7 @@ vi_change_meta(el, c) } -/* vi_insert_at_bol(): +/* vi_insert_at_bol(): * Vi enter insert mode at the beginning of line * [I] */ @@ -330,7 +330,7 @@ vi_insert_at_bol(el, c) } -/* vi_replace_char(): +/* vi_replace_char(): * Vi replace character under the cursor with the next character typed * [r] */ @@ -350,7 +350,7 @@ vi_replace_char(el, c) } -/* vi_replace_mode(): +/* vi_replace_mode(): * Vi enter replace mode * [R] */ @@ -370,7 +370,7 @@ vi_replace_mode(el, c) } -/* vi_substitute_char(): +/* vi_substitute_char(): * Vi replace character under the cursor and enter insert mode * [r] */ @@ -386,7 +386,7 @@ vi_substitute_char(el, c) } -/* vi_substitute_line(): +/* vi_substitute_line(): * Vi substitute entire line * [S] */ @@ -402,7 +402,7 @@ vi_substitute_line(el, c) } -/* vi_change_to_eol(): +/* vi_change_to_eol(): * Vi change to end of line * [C] */ @@ -439,7 +439,7 @@ vi_insert(el, c) /* vi_add(): - * Vi enter insert mode after the cursor + * Vi enter insert mode after the cursor * [a] */ protected el_action_t @@ -481,7 +481,7 @@ vi_add_at_eol(el, c) el->el_line.cursor = el->el_line.lastchar; /* Mark where insertion begins */ - el->el_chared.c_vcmd.ins = el->el_line.lastchar; + el->el_chared.c_vcmd.ins = el->el_line.lastchar; el->el_chared.c_undo.ptr = el->el_line.lastchar; el->el_chared.c_undo.action = DELETE; return CC_CURSOR; @@ -489,7 +489,7 @@ vi_add_at_eol(el, c) /* vi_delete_meta(): - * Vi delete prefix command + * Vi delete prefix command * [d] */ protected el_action_t @@ -503,8 +503,8 @@ vi_delete_meta(el, c) /* vi_end_word(): - * Vi move to the end of the current space delimited word - * [E] + * Vi move to the end of the current space delimited word + * [E] */ protected el_action_t /*ARGSUSED*/ @@ -515,7 +515,7 @@ vi_end_word(el, c) if (el->el_line.cursor == el->el_line.lastchar) return CC_ERROR; - el->el_line.cursor = cv__endword(el->el_line.cursor, el->el_line.lastchar, + el->el_line.cursor = cv__endword(el->el_line.cursor, el->el_line.lastchar, el->el_state.argument); if (el->el_chared.c_vcmd.action & DELETE) { @@ -541,7 +541,7 @@ vi_to_end_word(el, c) if (el->el_line.cursor == el->el_line.lastchar) return CC_ERROR; - el->el_line.cursor = cv__endword(el->el_line.cursor, el->el_line.lastchar, + el->el_line.cursor = cv__endword(el->el_line.cursor, el->el_line.lastchar, el->el_state.argument); if (el->el_chared.c_vcmd.action & DELETE) { @@ -570,12 +570,12 @@ vi_undo(el, c) c_undo_t *un = &el->el_chared.c_undo; #ifdef DEBUG_UNDO - (void) fprintf(el->el_errfile, "Undo: %x \"%s\" +%d -%d\n", + (void) fprintf(el->el_errfile, "Undo: %x \"%s\" +%d -%d\n", un->action, un->buf, un->isize, un->dsize); #endif switch (un->action) { case DELETE: - if (un->dsize == 0) + if (un->dsize == 0) return CC_NORM; (void) memcpy(un->buf, un->ptr, un->dsize); @@ -584,7 +584,7 @@ vi_undo(el, c) el->el_line.lastchar -= un->dsize; el->el_line.cursor = un->ptr; - + un->action = INSERT; un->isize = un->dsize; un->dsize = 0; @@ -592,9 +592,9 @@ vi_undo(el, c) case DELETE|INSERT: size = un->isize - un->dsize; - if (size > 0) + if (size > 0) i = un->dsize; - else + else i = un->isize; cp = un->ptr; kp = un->buf; @@ -627,7 +627,7 @@ vi_undo(el, c) break; case INSERT: - if (un->isize == 0) + if (un->isize == 0) return CC_NORM; el->el_line.cursor = un->ptr; @@ -639,11 +639,11 @@ vi_undo(el, c) break; case CHANGE: - if (un->isize == 0) + if (un->isize == 0) return CC_NORM; el->el_line.cursor = un->ptr; - size = (int) (el->el_line.cursor - el->el_line.lastchar); + size = (int) (el->el_line.cursor - el->el_line.lastchar); if (size < un->isize) size = un->isize; cp = un->ptr; @@ -677,7 +677,7 @@ vi_command_mode(el, c) int size; /* [Esc] cancels pending action */ el->el_chared.c_vcmd.ins = 0; - el->el_chared.c_vcmd.action = NOP; + el->el_chared.c_vcmd.action = NOP; el->el_chared.c_vcmd.pos = 0; el->el_state.doingarg = 0; @@ -700,7 +700,7 @@ vi_command_mode(el, c) } /* vi_zero(): - * Vi move to the beginning of line + * Vi move to the beginning of line * [0] */ protected el_action_t @@ -711,7 +711,7 @@ vi_zero(el, c) if (el->el_state.doingarg) { if (el->el_state.argument > 1000000) return CC_ERROR; - el->el_state.argument = + el->el_state.argument = (el->el_state.argument * 10) + (c - '0'); return CC_ARGHACK; } @@ -727,23 +727,23 @@ vi_zero(el, c) /* vi_delete_prev_char(): - * Vi move to previous character (backspace) + * Vi move to previous character (backspace) * [^H] - */ + */ protected el_action_t /*ARGSUSED*/ vi_delete_prev_char(el, c) EditLine *el; int c; { - if (el->el_chared.c_vcmd.ins == 0) + if (el->el_chared.c_vcmd.ins == 0) return CC_ERROR; - if (el->el_chared.c_vcmd.ins > + if (el->el_chared.c_vcmd.ins > el->el_line.cursor - el->el_state.argument) return CC_ERROR; - c_delbefore(el, el->el_state.argument); + c_delbefore(el, el->el_state.argument); el->el_line.cursor -= el->el_state.argument; return CC_REFRESH; @@ -761,7 +761,7 @@ vi_list_or_eof(el, c) int c; { #ifdef notyet - if (el->el_line.cursor == el->el_line.lastchar && + if (el->el_line.cursor == el->el_line.lastchar && el->el_line.cursor == el->el_line.buffer) { #endif term_overwrite(el, STReof, 4); /* then do a EOF */ @@ -779,7 +779,7 @@ vi_list_or_eof(el, c) /* vi_kill_line_prev(): - * Vi cut from beginning of line to cursor + * Vi cut from beginning of line to cursor * [^U] */ protected el_action_t @@ -839,7 +839,7 @@ vi_repeat_search_next(el, c) EditLine *el; int c; { - if (el->el_search.patlen == 0) + if (el->el_search.patlen == 0) return CC_ERROR; else return cv_repeat_srch(el, el->el_search.patdir); @@ -856,10 +856,10 @@ vi_repeat_search_prev(el, c) EditLine *el; int c; { - if (el->el_search.patlen == 0) + if (el->el_search.patlen == 0) return CC_ERROR; else - return cv_repeat_srch(el, + return cv_repeat_srch(el, el->el_search.patdir == ED_SEARCH_PREV_HISTORY ? ED_SEARCH_NEXT_HISTORY : ED_SEARCH_PREV_HISTORY); } @@ -961,8 +961,8 @@ vi_repeat_next_char(el, c) if (el->el_search.chacha == 0) return CC_ERROR; - return el->el_search.chadir == CHAR_FWD ? - cv_csearch_fwd(el, el->el_search.chacha, el->el_state.argument, 0) : + return el->el_search.chadir == CHAR_FWD ? + cv_csearch_fwd(el, el->el_search.chacha, el->el_state.argument, 0) : cv_csearch_back(el, el->el_search.chacha, el->el_state.argument, 0); } @@ -980,7 +980,7 @@ vi_repeat_prev_char(el, c) if (el->el_search.chacha == 0) return CC_ERROR; - return el->el_search.chadir == CHAR_BACK ? - cv_csearch_fwd(el, el->el_search.chacha, el->el_state.argument, 0) : + return el->el_search.chadir == CHAR_BACK ? + cv_csearch_fwd(el, el->el_search.chacha, el->el_state.argument, 0) : cv_csearch_back(el, el->el_search.chacha, el->el_state.argument, 0); } diff --git a/lib/libf2c/Makefile b/lib/libf2c/Makefile index 9baa64df20f6..63ad8082fe94 100644 --- a/lib/libf2c/Makefile +++ b/lib/libf2c/Makefile @@ -22,7 +22,7 @@ INT = i_abs.c i_dim.c i_dnnt.c i_indx.c i_len.c i_mod.c i_nint.c i_sign.c HALF = h_abs.c h_dim.c h_dnnt.c h_indx.c h_len.c h_mod.c h_nint.c h_sign.c CMP = l_ge.c l_gt.c l_le.c l_lt.c hl_ge.c hl_gt.c hl_le.c hl_lt.c EFL = ef1asc_.c ef1cmc_.c -CHAR = s_cat.c s_cmp.c s_copy.c +CHAR = s_cat.c s_cmp.c s_copy.c F77SRCS= $(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) \ $(HALF) $(CMP) $(EFL) $(CHAR) diff --git a/lib/libforms/bindings.c b/lib/libforms/bindings.c index d568da548800..947b5ee47bdd 100644 --- a/lib/libforms/bindings.c +++ b/lib/libforms/bindings.c @@ -6,8 +6,8 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer, - * verbatim and that no modifications are made prior to this + * notice, this list of conditions and the following disclaimer, + * verbatim and that no modifications are made prior to this * point in the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the diff --git a/lib/libforms/examples/example.c b/lib/libforms/examples/example.c index b08a4ea6e1f3..131ee04cb572 100644 --- a/lib/libforms/examples/example.c +++ b/lib/libforms/examples/example.c @@ -6,8 +6,8 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer, - * verbatim and that no modifications are made prior to this + * notice, this list of conditions and the following disclaimer, + * verbatim and that no modifications are made prior to this * point in the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the diff --git a/lib/libforms/forms.c b/lib/libforms/forms.c index 575608fd08a0..2c2a87a21754 100644 --- a/lib/libforms/forms.c +++ b/lib/libforms/forms.c @@ -6,8 +6,8 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer, - * verbatim and that no modifications are made prior to this + * notice, this list of conditions and the following disclaimer, + * verbatim and that no modifications are made prior to this * point in the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the @@ -65,7 +65,7 @@ struct intbind { struct intbind internal_bindings[] = { {"draw_box", &draw_box}, {"draw_shadow", &draw_shadow} -}; +}; /* Bind the internal function addresses */ diff --git a/lib/libforms/forms.h b/lib/libforms/forms.h index ceac28760690..d5bd723cf537 100644 --- a/lib/libforms/forms.h +++ b/lib/libforms/forms.h @@ -6,8 +6,8 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer, - * verbatim and that no modifications are made prior to this + * notice, this list of conditions and the following disclaimer, + * verbatim and that no modifications are made prior to this * point in the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the diff --git a/lib/libforms/internal.h b/lib/libforms/internal.h index ba38601f7b0f..e7c5b274c13d 100644 --- a/lib/libforms/internal.h +++ b/lib/libforms/internal.h @@ -6,8 +6,8 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer, - * verbatim and that no modifications are made prior to this + * notice, this list of conditions and the following disclaimer, + * verbatim and that no modifications are made prior to this * point in the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the diff --git a/lib/libforms/ncurses.c b/lib/libforms/ncurses.c index 5db4dd1182df..87ec478f89d1 100644 --- a/lib/libforms/ncurses.c +++ b/lib/libforms/ncurses.c @@ -6,8 +6,8 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer, - * verbatim and that no modifications are made prior to this + * notice, this list of conditions and the following disclaimer, + * verbatim and that no modifications are made prior to this * point in the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the @@ -147,7 +147,7 @@ ncurses_parse_attrs(OBJECT *object, char *string) AttrType attr_type; int len, y, x; int skip = 0; - + if ((!string) || (*string != '\\')) return (0); @@ -155,7 +155,7 @@ ncurses_parse_attrs(OBJECT *object, char *string) if (*(string + inc) == '\\') return (skip); - while ((!isspace(*(string + inc))) + while ((!isspace(*(string + inc))) && (*(string+inc) != '\\') && (*(string + inc) != '\0')) inc++; @@ -201,7 +201,7 @@ ncurses_parse_attrs(OBJECT *object, char *string) break; } - + skip += inc; string += inc; inc = 0; @@ -245,7 +245,7 @@ ncurses_print_string(OBJECT *object, char *string) } } return (OK); -} +} void ncurses_display_object(OBJECT *object) @@ -554,7 +554,7 @@ ncurses_process_input(OBJECT *object) --cursor; } } - } else if ((isprint(ch)) && (len < object->object.input->limit)){ + } else if ((isprint(ch)) && (len < object->object.input->limit)){ bcopy(object->object.input->input+abspos, object->object.input->input+abspos+1, len-abspos+1); object->object.input->input[abspos++] = ch; @@ -563,7 +563,7 @@ ncurses_process_input(OBJECT *object) ++disp_off; --cursor; } - } else + } else beep(); ncurses_print_string(object, object->object.input->input+disp_off); } diff --git a/lib/libforms/objects.c b/lib/libforms/objects.c index 335e4adbe362..0a51caeda958 100644 --- a/lib/libforms/objects.c +++ b/lib/libforms/objects.c @@ -6,8 +6,8 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer, - * verbatim and that no modifications are made prior to this + * notice, this list of conditions and the following disclaimer, + * verbatim and that no modifications are made prior to this * point in the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the @@ -116,13 +116,13 @@ __inline void clone_object(OBJECT *object, OBJECT *def) { int i; - + /* XXX - Should really check if strdup's succeed */ object->type = def->type; object->status = def->status; object->parent = def->parent; - /* + /* * Only copy sizes for fixed size objects, * otherwise inherit from parent. Always * inherit x and y. @@ -188,7 +188,7 @@ clone_object(OBJECT *object, OBJECT *def) if (!object->object.function) errx(-1, "Failed to allocate memory for copy of function object"); object->object.function->fn = strdup(def->object.function->fn); - break; + break; case OT_INPUT: object->object.input = malloc(sizeof (INPUT_OBJECT)); if (!object->object.input) @@ -204,7 +204,7 @@ clone_object(OBJECT *object, OBJECT *def) errx(-1, "Failed to allocate memory for copy of menu object"); object->object.menu->selected = def->object.menu->selected; for (i=0; i < def->object.menu->no_options; i++) { - object->object.menu->no_options = + object->object.menu->no_options = add_menu_option(object->object.menu, def->object.menu->options[i]); if (!object->object.menu->no_options) @@ -256,7 +256,7 @@ copy_bound_objects(char *key, void *data, void *arg) int use_defined_object(OBJECT *object, char *src) -{ +{ TUPLE *tuple; OBJECT *def; @@ -271,7 +271,7 @@ use_defined_object(OBJECT *object, char *src) /* Now recursively clone sub-objects */ hash_traverse(def->bind, ©_bound_objects, object); -} +} /* diff --git a/lib/libftp/FtpAbort.c b/lib/libftp/FtpAbort.c index 98d72b8004a3..80943e52425a 100644 --- a/lib/libftp/FtpAbort.c +++ b/lib/libftp/FtpAbort.c @@ -2,9 +2,9 @@ Library for ftpd clients.(libftp) Copyright by Oleg Orel All rights reserved. - -This library is desined for free, non-commercial software creation. -It is changeable and can be improved. The author would greatly appreciate + +This library is desined for free, non-commercial software creation. +It is changeable and can be improved. The author would greatly appreciate any advises, new components and patches of the existing programs. Commercial usage is also possible with participation of it's author. @@ -21,20 +21,20 @@ FtpAbort(FTP *ftp) fd_set fds; char msgc=IAC; String msg; - + FD_ZERO(&fds); FD_SET(fileno(FTPCMD(ftp)),&fds); - + FtpPutc(ftp, FTPCMD(ftp), IAC); FtpPutc(ftp, FTPCMD(ftp), IP); - + if ( send ( fileno(FTPCMD(ftp)), &msgc , 1 ,MSG_OOB) != 1 ) return EXIT(ftp,QUIT); - + FtpPutc(ftp, FTPCMD(ftp), DM); - + FtpSendMessage(ftp,"ABOR"); - + while (select ( getdtablesize(), &fds, 0,0, &(ftp->timeout) )>0) { FtpGetMessage(ftp,msg); diff --git a/lib/libftp/FtpArchie.c b/lib/libftp/FtpArchie.c index 7f039be06890..22a05e1745f9 100644 --- a/lib/libftp/FtpArchie.c +++ b/lib/libftp/FtpArchie.c @@ -2,9 +2,9 @@ Library for ftpd clients.(libftp) Copyright by Oleg Orel All rights reserved. - -This library is desined for free, non-commercial software creation. -It is changeable and can be improved. The author would greatly appreciate + +This library is desined for free, non-commercial software creation. +It is changeable and can be improved. The author would greatly appreciate any advises, new components and patches of the existing programs. Commercial usage is also possible with participation of it's author. @@ -21,18 +21,18 @@ int FtpArchie ( char *what, ARCHIE *result, int len) FILE *archie; String cmd,tmp; int i; - + bzero(result,sizeof(result[0])*len); - + sprintf(cmd,"archie -l -m %d %s",len,what); - + if ((archie = popen(cmd,"r"))==NULL) return 0; for(i=0;i<len;i++) { char *p, *pp; - + if (fgets(tmp,sizeof (tmp), archie)==NULL) break; @@ -42,15 +42,15 @@ int FtpArchie ( char *what, ARCHIE *result, int len) result[i].createtime.tm_hour = C2I (tmp[6 ])*10 + C2I(tmp[7]); result[i].createtime.tm_min = C2I (tmp[8 ])*10 + C2I(tmp[9]); result[i].createtime.tm_sec = C2I (tmp[10])*10 + C2I(tmp[11]); - + for(p=tmp; *p!=' '; p++); for(; *p==' '; p++); - + result[i].size = atoi(p); for(; *p!=' '; p++); for(; *p==' '; p++); - + for (pp=result[i].host;*p!=' ';p++,pp++) *pp=*p; *pp=0; for(; *p==' '; p++); @@ -58,6 +58,6 @@ int FtpArchie ( char *what, ARCHIE *result, int len) *pp=0; } - + return i; } diff --git a/lib/libftp/FtpBye.c b/lib/libftp/FtpBye.c index f664cf6ddf5d..7094843ac0dc 100644 --- a/lib/libftp/FtpBye.c +++ b/lib/libftp/FtpBye.c @@ -2,9 +2,9 @@ Library for ftpd clients.(libftp) Copyright by Oleg Orel All rights reserved. - -This library is desined for free, non-commercial software creation. -It is changeable and can be improved. The author would greatly appreciate + +This library is desined for free, non-commercial software creation. +It is changeable and can be improved. The author would greatly appreciate any advises, new components and patches of the existing programs. Commercial usage is also possible with participation of it's author. @@ -23,11 +23,11 @@ STATUS FtpBye(FTP *ftp) free(ftp); return 0; } - + STATUS FtpQuickBye(FTP *ftp) { if (ftp == NULL) return 0; - + if (FTPDATA(ftp)!=NULL) { shutdown(fileno(FTPDATA(ftp)),2); diff --git a/lib/libftp/FtpClose.c b/lib/libftp/FtpClose.c index 26dbc519c2ca..a14658e438db 100644 --- a/lib/libftp/FtpClose.c +++ b/lib/libftp/FtpClose.c @@ -1,9 +1,9 @@ /* Library for ftpd clients.(libftp) Copyright by Oleg Orel All rights reserved. - -This library is desined for free, non-commercial software creation. -It is changeable and can be improved. The author would greatly appreciate + +This library is desined for free, non-commercial software creation. +It is changeable and can be improved. The author would greatly appreciate any advises, new components and patches of the existing programs. Commercial usage is also possible with participation of it's author. */ @@ -18,7 +18,7 @@ STATUS FtpClose(FTP *ftp) fflush(FTPDATA(ftp)); shutdown(fileno(FTPDATA(ftp)),2); fclose(FTPDATA(ftp)); - + FtpAssert(ftp,i=FtpGetMessage(ftp,S1)); if ( i != 226 ) return EXIT(ftp,-i); diff --git a/lib/libftp/FtpCommand.c b/lib/libftp/FtpCommand.c index 94e85949720e..25fd46060d35 100644 --- a/lib/libftp/FtpCommand.c +++ b/lib/libftp/FtpCommand.c @@ -2,9 +2,9 @@ Library for ftpd clients.(libftp) Copyright by Oleg Orel All rights reserved. - -This library is desined for free, non-commercial software creation. -It is changeable and can be improved. The author would greatly appreciate + +This library is desined for free, non-commercial software creation. +It is changeable and can be improved. The author would greatly appreciate any advises, new components and patches of the existing programs. Commercial usage is also possible with participation of it's author. @@ -24,7 +24,7 @@ STATUS FtpCommand(va_alist) va_list args; String S1; int i,counter=0; - + va_start(args); con = va_arg(args,FTP *); @@ -41,21 +41,21 @@ STATUS FtpCommand(va_alist) } va_end(args); - - + + sprintf(S1,command,param); if ( FtpSendMessage(con,S1) == QUIT ) return EXIT(con,QUIT); - + if ( (i=FtpGetMessage(con,S1)) == QUIT ) return EXIT(con,QUIT); - + if ( ! FtpGood1 ( i , Answer )) return EXIT(con,-i); return EXIT(con,i); } - - - + + + diff --git a/lib/libftp/FtpConnect.c b/lib/libftp/FtpConnect.c index e114a50395bb..4de95ab04c5d 100644 --- a/lib/libftp/FtpConnect.c +++ b/lib/libftp/FtpConnect.c @@ -2,9 +2,9 @@ Library for ftpd clients.(libftp) Copyright by Oleg Orel All rights reserved. - -This library is desined for free, non-commercial software creation. -It is changeable and can be improved. The author would greatly appreciate + +This library is desined for free, non-commercial software creation. +It is changeable and can be improved. The author would greatly appreciate any advises, new components and patches of the existing programs. Commercial usage is also possible with participation of it's author. @@ -22,22 +22,22 @@ STATUS FtpConnect(FTP **con,char * hostname) register int new_socket; String S1; STATUS x; - + *con = FtpCreateObject(); - + if ((host=FtpGetHost(hostname))==NULL) return EXIT((*con),QUIT); - + strcpy((*con) -> title,host -> h_name); /* Default title for FtpLog */ - + unit.sin_family = host -> h_addrtype; /* AF_INET */ - + bcopy(host-> h_addr_list[0],(char *)&unit.sin_addr,host->h_length); if ( ( new_socket = socket ( unit.sin_family , SOCK_STREAM , 0)) < 0) return EXIT((*con),QUIT); unit.sin_port = htons((*con)->port); - + while ( connect ( new_socket , (struct sockaddr *)&unit , sizeof unit ) < 0 ) { host -> h_addr_list ++; @@ -53,7 +53,7 @@ STATUS FtpConnect(FTP **con,char * hostname) return EXIT((*con),QUIT); } } - + FTPCMD(*con) = fdopen(new_socket,"r+"); if ( (x=FtpGetMessage(*con,S1)) == QUIT ) @@ -64,7 +64,7 @@ STATUS FtpConnect(FTP **con,char * hostname) return EXIT((*con),-x); } if ( (*con)->mode != 'A' ) FtpType(*con,(*con)->mode); - + return EXIT((*con),x); } diff --git a/lib/libftp/FtpCopy.c b/lib/libftp/FtpCopy.c index d09fd364c0d0..db582d2ab7d2 100644 --- a/lib/libftp/FtpCopy.c +++ b/lib/libftp/FtpCopy.c @@ -2,9 +2,9 @@ Library for ftpd clients.(libftp) Copyright by Oleg Orel All rights reserved. - -This library is desined for free, non-commercial software creation. -It is changeable and can be improved. The author would greatly appreciate + +This library is desined for free, non-commercial software creation. +It is changeable and can be improved. The author would greatly appreciate any advises, new components and patches of the existing programs. Commercial usage is also possible with participation of it's author. @@ -21,19 +21,19 @@ STATUS FtpCopy (FTP * ftp1 , FTP * ftp2 ,char *in , char * out) if (!*out) out=in; - if ( FtpTestFlag(ftp1,FTP_REST) && FtpTestFlag(ftp2,FTP_REST) + if ( FtpTestFlag(ftp1,FTP_REST) && FtpTestFlag(ftp2,FTP_REST) && (size=FtpSize(ftp1,in))>0 && FtpCommand(ftp1,"REST 0",0,0,EOF)==350 && FtpCommand(ftp2,"REST 0",0,0,EOF)==350 ) ftp1->seek=ftp2->seek=size; else ftp1->seek=ftp2->seek=0; - + FtpAssert(ftp1,FtpData(ftp1,"RETR %s",in,"r")); FtpAssert(ftp2,FtpData(ftp2,"STOR %s",out,"w")); while ((size=FtpReadBlock(ftp1,buffer,FTPBUFSIZ))>0) { - if (FtpWriteBlock(ftp2,buffer,size)!=size) + if (FtpWriteBlock(ftp2,buffer,size)!=size) return EXIT(ftp2,QUIT); } diff --git a/lib/libftp/FtpData.c b/lib/libftp/FtpData.c index c1bbdb8d5576..066671f5243b 100644 --- a/lib/libftp/FtpData.c +++ b/lib/libftp/FtpData.c @@ -2,9 +2,9 @@ Library for ftpd clients.(libftp) Copyright by Oleg Orel All rights reserved. - -This library is desined for free, non-commercial software creation. -It is changeable and can be improved. The author would greatly appreciate + +This library is desined for free, non-commercial software creation. +It is changeable and can be improved. The author would greatly appreciate any advises, new components and patches of the existing programs. Commercial usage is also possible with participation of it's author. @@ -26,17 +26,17 @@ STATUS FtpData(FTP * con,char * command , char * file ,char * mode) FREE(data); FREE(from); - + if ( gethostname( hostname , sizeof hostname ) == -1 ) return EXIT(con,QUIT); - + if ((host=(struct hostent *)gethostbyname(hostname))==0) return EXIT(con,QUIT); - + data.sin_family = host -> h_addrtype; - + bcopy(host-> h_addr_list[0],(char *)&data.sin_addr,host->h_length); - + if ((NewSocket = socket ( AF_INET , SOCK_STREAM , 0 ))<0) return EXIT(con,QUIT); @@ -54,7 +54,7 @@ STATUS FtpData(FTP * con,char * command , char * file ,char * mode) if ( getsockname ( NewSocket , (struct sockaddr *)&data , &len ) < 0 ) return EXIT(con,QUIT); - + if ( listen ( NewSocket , 1 ) < 0 ) return EXIT(con,QUIT); @@ -69,10 +69,10 @@ STATUS FtpData(FTP * con,char * command , char * file ,char * mode) if ((i = FtpCommand ( con, "REST %d" , con -> seek , 0, EOF)) != 350 ) return -i; } - - FtpAssert(con, FtpCommand ( con , command , file , + + FtpAssert(con, FtpCommand ( con , command , file , 200, 120 , 150 , 125 , 250 , EOF )); - + if (( Accepted_Socket = accept (NewSocket , (struct sockaddr *)&from , &fromlen )) < 0) { close(NewSocket); diff --git a/lib/libftp/FtpDebug.c b/lib/libftp/FtpDebug.c index 98686b90b38a..d2b5af92f751 100644 --- a/lib/libftp/FtpDebug.c +++ b/lib/libftp/FtpDebug.c @@ -2,9 +2,9 @@ Library for ftpd clients.(libftp) Copyright by Oleg Orel All rights reserved. - -This library is desined for free, non-commercial software creation. -It is changeable and can be improved. The author would greatly appreciate + +This library is desined for free, non-commercial software creation. +It is changeable and can be improved. The author would greatly appreciate any advises, new components and patches of the existing programs. Commercial usage is also possible with participation of it's author. @@ -29,22 +29,22 @@ STATUS FtpDebugDebug(FTP *ftp,int n, char * Message) { String tmp; - + strcpy(tmp,Message); - + if (strncmp(tmp,"PASS ",5)==0) { char *p=tmp+5; while ( *p != '\0') *p++='*'; }; - + FtpLog(ftp->title,tmp); return 1; } STATUS FtpDebugError(FTP *ftp,int n, char * Message) { - + FtpLog("FtpDebugError",""); FtpLog(ftp->title,Message); if ( ! FtpTestFlag(ftp,FTP_NOEXIT)) @@ -74,7 +74,7 @@ STATUS FtpLog(char *name,char *str) int FtpHash(FTP *ftp, unsigned long chars) { - + if (chars==0) return ftp->counter=0; ftp->counter+=chars; fprintf(stdout,"%10u bytes transfered\r",(unsigned int)ftp->counter); @@ -88,7 +88,7 @@ STATUS FtpBadReply550(char *s) if( (strstr(s,"unreachable")!=NULL) || (strstr(s,"Broken pipe")!=NULL) - ) + ) return 0; return 1; } diff --git a/lib/libftp/FtpFilenameChecker.c b/lib/libftp/FtpFilenameChecker.c index 0d486c443bf9..99946eb99f6e 100644 --- a/lib/libftp/FtpFilenameChecker.c +++ b/lib/libftp/FtpFilenameChecker.c @@ -1,9 +1,9 @@ /* Library for ftpd clients.(libftp) Copyright by Oleg Orel All rights reserved. - -This library is desined for free, non-commercial software creation. -It is changeable and can be improved. The author would greatly appreciate + +This library is desined for free, non-commercial software creation. +It is changeable and can be improved. The author would greatly appreciate any advises, new components and patches of the existing programs. Commercial usage is also possible with participation of it's author. */ @@ -13,12 +13,12 @@ Commercial usage is also possible with participation of it's author. static char * simplename(char *s) { char *p; - + if ( (p=(char *)strrchr(s,'/')) == NULL ) return s; return p+1; } - + diff --git a/lib/libftp/FtpFull.c b/lib/libftp/FtpFull.c index e2e6a56ae832..51c87dc0f8f0 100644 --- a/lib/libftp/FtpFull.c +++ b/lib/libftp/FtpFull.c @@ -2,9 +2,9 @@ Library for ftpd clients.(libftp) Copyright by Oleg Orel All rights reserved. - -This library is desined for free, non-commercial software creation. -It is changeable and can be improved. The author would greatly appreciate + +This library is desined for free, non-commercial software creation. +It is changeable and can be improved. The author would greatly appreciate any advises, new components and patches of the existing programs. Commercial usage is also possible with participation of it's author. @@ -39,8 +39,8 @@ FILE * FtpFullOpen(char * file , char * mode ) switch(mode[0]) { - case 'r': - if (FtpError(FtpOpenRead(ftp,RemoteFile))) + case 'r': + if (FtpError(FtpOpenRead(ftp,RemoteFile))) return NULL; ftp_table[fileno(FTPDATA(ftp))] = ftp; return FTPDATA(ftp); @@ -80,16 +80,16 @@ STATUS FtpFullSyntax ( String source , { char *in,*out; String tmp; - + host[0] = user[0] = passwd[0] = file[0] = '\0'; - + for ( in=source, out = user; *in !='\0' && *in != '/' && *in!='@' && *in!=':' ; *out++ = *in++); *out = '\0'; - + if ( *in == '\0' ) return 0; - + if ( *in == ':' ) { strcpy(host,user); @@ -98,7 +98,7 @@ STATUS FtpFullSyntax ( String source , sprintf(passwd,"%s@%s", getpwuid(getuid())->pw_name,gethostbyname(tmp)->h_name); goto file; - } + } if ( *in == '/' ) { @@ -114,25 +114,25 @@ STATUS FtpFullSyntax ( String source , sprintf(passwd,"%s@%s", getpwuid(getuid())->pw_name,gethostbyname(tmp)->h_name); } - - + + for ( in++, out = host; *in !='\0' && *in!=':' ; *out++ = *in++); *out = '\0'; - + if ( *in == '\0' ) return 0; file: - + for ( in++, out = file; *in !='\0'; *out++ = *in++); *out = '\0'; - + return 1; } - + diff --git a/lib/libftp/FtpGetHost.c b/lib/libftp/FtpGetHost.c index 3dca113ab3d4..7171ba31e185 100644 --- a/lib/libftp/FtpGetHost.c +++ b/lib/libftp/FtpGetHost.c @@ -2,9 +2,9 @@ Library for ftpd clients.(libftp) Copyright by Oleg Orel All rights reserved. - -This library is desined for free, non-commercial software creation. -It is changeable and can be improved. The author would greatly appreciate + +This library is desined for free, non-commercial software creation. +It is changeable and can be improved. The author would greatly appreciate any advises, new components and patches of the existing programs. Commercial usage is also possible with participation of it's author. @@ -37,7 +37,7 @@ struct hostent *FtpGetHost(char *host) _host.h_addrtype=AF_INET; return &_host; } - + return gethostbyname(host); } diff --git a/lib/libftp/FtpGood.c b/lib/libftp/FtpGood.c index e64959d6edd6..20af4e07a7e0 100644 --- a/lib/libftp/FtpGood.c +++ b/lib/libftp/FtpGood.c @@ -2,9 +2,9 @@ Library for ftpd clients.(libftp) Copyright by Oleg Orel All rights reserved. - -This library is desined for free, non-commercial software creation. -It is changeable and can be improved. The author would greatly appreciate + +This library is desined for free, non-commercial software creation. +It is changeable and can be improved. The author would greatly appreciate any advises, new components and patches of the existing programs. Commercial usage is also possible with participation of it's author. @@ -22,11 +22,11 @@ STATUS FtpGood(va_alist) int Number; int Answer[MAX_ANSWERS]; int counter=0; - + va_start(args); Number = va_arg(args,int); - + while ( 1 ) { if (counter == MAX_ANSWERS) @@ -37,7 +37,7 @@ STATUS FtpGood(va_alist) } va_end(args); - + return FtpGood1(Number,Answer); } diff --git a/lib/libftp/FtpIO.c b/lib/libftp/FtpIO.c index ee701001d52c..b7f6af5dc6d1 100644 --- a/lib/libftp/FtpIO.c +++ b/lib/libftp/FtpIO.c @@ -1,9 +1,9 @@ /* Library for ftpd clients.(libftp) Copyright by Oleg Orel All rights reserved. - -This library is desined for free, non-commercial software creation. -It is changeable and can be improved. The author would greatly appreciate + +This library is desined for free, non-commercial software creation. +It is changeable and can be improved. The author would greatly appreciate any advises, new components and patches of the exist ing programs. Commercial usage is also possible with participation of it's author. @@ -18,23 +18,23 @@ Commercial usage is also possible with participation of it's author. int FtpRead(FTP *con) { int c; - + if ( con -> mode == 'I' ) return FtpGetc(con,FTPDATA(con)); - + if ( con->ch != EOF ) { c=con->ch; con->ch=EOF; return c; } - + c=FtpGetc(con,FTPDATA(con)); - + if ( c == Ctrl('M') ) { c = FtpGetc(con,FTPDATA(con)); - + if ( c == Ctrl('J') ) return '\n'; con->ch = c; @@ -45,20 +45,20 @@ int FtpRead(FTP *con) int FtpWrite(FTP *ftp,char c) { - + if ( ftp -> mode == 'I' || c != '\n' ) return FtpPutc(ftp,FTPDATA(ftp),c); - + FtpPutc(ftp,FTPDATA(ftp),Ctrl('M')); return FtpPutc(ftp,FTPDATA(ftp),Ctrl('J')); } - + int FtpGetc(FTP *ftp,FILE *fp) { fd_set fds; char c; - + FD_ZERO(&fds); FD_SET(fileno(fp),&fds); @@ -67,9 +67,9 @@ int FtpGetc(FTP *ftp,FILE *fp) if (read(fileno(fp),&c,1)<1) return EOF; - + if (ftp->hash!=NULL) (*ftp->hash)(ftp,1); - + return (int)c; } @@ -77,13 +77,13 @@ int FtpGetc(FTP *ftp,FILE *fp) STATUS FtpPutc(FTP *ftp,FILE *fp,char c) { fd_set fds; - + FD_ZERO(&fds); FD_SET(fileno(fp),&fds); - + if (select(getdtablesize(), 0, &fds, 0, &(ftp->timeout))<1) return EXIT(ftp,QUIT); - + if (write(fileno(fp),&c,1)!=1) return EXIT(ftp,QUIT); @@ -96,19 +96,19 @@ STATUS FtpReadBlock(FTP *ftp, char *buffer, int size) { fd_set fds; register int rsize; - + FD_ZERO(&fds); FD_SET(fileno(FTPDATA(ftp)),&fds); - + if (select(getdtablesize(), &fds,0, 0, &(ftp->timeout))<1) return EXIT(ftp,QUIT); - - + + if ((rsize=read(fileno(FTPDATA(ftp)),buffer,size))<0) return EXIT(ftp,QUIT); - + if (ftp->hash!=NULL && rsize!=0) (*ftp->hash)(ftp,rsize); - + if (ftp->mode == 'A') { char buffer2[size]; @@ -119,7 +119,7 @@ STATUS FtpReadBlock(FTP *ftp, char *buffer, int size) buffer2[ii]='\n',i++; else buffer2[ii]=buffer[i]; - + rsize=ii; bcopy(buffer2,buffer,rsize); } @@ -132,14 +132,14 @@ STATUS FtpWriteBlock(FTP *ftp, char *buffer, int size) fd_set fds; register int wsize; char buffer2[size*2]; - + FD_ZERO(&fds); FD_SET(fileno(FTPDATA(ftp)),&fds); - + if (select(getdtablesize(), 0, &fds, 0, &(ftp->timeout))<1) return EXIT(ftp,QUIT); - - + + if (ftp->mode=='A') { register int i,ii; @@ -152,17 +152,17 @@ STATUS FtpWriteBlock(FTP *ftp, char *buffer, int size) buffer=buffer2; size=ii; } - - if ((wsize=write(fileno(FTPDATA(ftp)),buffer,size))!=size) + + if ((wsize=write(fileno(FTPDATA(ftp)),buffer,size))!=size) return EXIT(ftp,QUIT); - + if ( ftp->hash!=NULL && wsize!=0 ) (*ftp->hash)(ftp,wsize); - + return wsize; } - + diff --git a/lib/libftp/FtpInit.c b/lib/libftp/FtpInit.c index 184f7fb8881c..4e43c8c0b39f 100644 --- a/lib/libftp/FtpInit.c +++ b/lib/libftp/FtpInit.c @@ -2,9 +2,9 @@ Library for ftpd clients.(libftp) Copyright by Oleg Orel All rights reserved. - -This library is desined for free, non-commercial software creation. -It is changeable and can be improved. The author would greatly appreciate + +This library is desined for free, non-commercial software creation. +It is changeable and can be improved. The author would greatly appreciate any advises, new components and patches of the existing programs. Commercial usage is also possible with participation of it's author. diff --git a/lib/libftp/FtpLibrary.h b/lib/libftp/FtpLibrary.h index d834e3b1cd41..754e5a1517f8 100644 --- a/lib/libftp/FtpLibrary.h +++ b/lib/libftp/FtpLibrary.h @@ -2,16 +2,16 @@ Library for ftpd clients.(libftp) Copyright by Oleg Orel All rights reserved. - -This library is desined for free, non-commercial software creation. -It is changeable and can be improved. The author would greatly appreciate + +This library is desined for free, non-commercial software creation. +It is changeable and can be improved. The author would greatly appreciate any advises, new components and patches of the existing programs. Commercial usage is also possible with participation of it's author. */ - + #ifndef __FTPLIBRARY_H #define __FTPLIBRARY_H @@ -43,20 +43,20 @@ extern int errno; /* Standard Macros & Definitions */ - - + + #define EXIT(con,e) \ ( con -> errno = e, \ ((e==QUIT||e==LQUIT)&&(con->IO != NULL))?(*(con->IO))(con,e,sys_errlist[errno]):0,\ ((con->error != NULL) && (e < 0) )?(*(con->error))(con,e,FtpMessage(e)):0,\ e) - - + + #define MAX_ANSWERS 10 /* Number of known goodest answers for reqest */ #define NFDS 64 #define FTPBUFSIZ BUFSIZ #define LQUIT (-6) -#define QUIT (-5) /* Few time ago QUIT character been +#define QUIT (-5) /* Few time ago QUIT character been equivalence to zero, changed for clear conflicts with reading functions */ #define Ctrl(x) ((x) - '@') @@ -90,28 +90,28 @@ typedef struct/* All structure initialize from edited struct FtpInit */ char mode; /* Binary, Ascii, ......... */ int errno; /* Last error code */ int ch; /* Help character for ascii streams */ - + STATUS (*error)(); STATUS (*debug)(); STATUS (*IO)(); STATUS (*hash)(); /* Call with reading/writing next "int" characters - from stream */ + from stream */ int seek; /* Warning! If server not supported REST-command, then seek variable automaticaly turn to zero */ - int flags; /* FTP_REST, + int flags; /* FTP_REST, FTP_NOEXIT */ struct timeval timeout; - /* How long must be waiting next character + /* How long must be waiting next character from server */ int port; String title; /* Using for FtpLog, FtpConnect lets hostname */ - unsigned long counter; + unsigned long counter; /* Using by FtpHash */ } FTP; -typedef struct +typedef struct { struct tm createtime; unsigned long size; @@ -136,7 +136,7 @@ extern FTP FtpInit; ((ftp)->timeout.tv_sec=tim,(ftp)->timeout.tv_usec=0) #define FtpSetPort(ftp,prt) ((ftp)->port=(prt)) -/* Connect & disconnect */ +/* Connect & disconnect */ STATUS FtpConnect(FTP **con,char *hostname); #define FtpUser(ftp,user) FtpCommand(ftp,"USER %s",user,230,331,332,EOF) @@ -207,7 +207,7 @@ int FtpNumber ( char * Message ); /* Debug */ #define FtpSetErrorHandler(con,f) (con)->error = f -#define FtpSetDebugHandler(con,f) (con)->debug = f +#define FtpSetDebugHandler(con,f) (con)->debug = f #define FtpSetIOHandler(con,f) (con)->IO =f #define FtpSetHashHandler(con,f) (con)->hash =f #define FtplibDebug(t) FtpDebug(&FtpInit) @@ -239,7 +239,7 @@ int FtpArchie(char *what, ARCHIE *, int number); #ifdef __cplusplus } #endif - + /* Additional definitions */ diff --git a/lib/libftp/FtpLogin.c b/lib/libftp/FtpLogin.c index 27e43ae60780..e066d5513c33 100644 --- a/lib/libftp/FtpLogin.c +++ b/lib/libftp/FtpLogin.c @@ -2,9 +2,9 @@ Library for ftpd clients.(libftp) Copyright by Oleg Orel All rights reserved. - -This library is desined for free, non-commercial software creation. -It is changeable and can be improved. The author would greatly appreciate + +This library is desined for free, non-commercial software creation. +It is changeable and can be improved. The author would greatly appreciate any advises, new components and patches of the existing programs. Commercial usage is also possible with participation of it's author. @@ -14,10 +14,10 @@ Commercial usage is also possible with participation of it's author. #include "FtpLibrary.h" -STATUS FtpLogin ( FTP ** con, char * host , char * user , +STATUS FtpLogin ( FTP ** con, char * host , char * user , char * password , char * account) { - + FtpAssert((*con),FtpConnect(con,host)); FtpAssert((*con),FtpUser((*con),user)); if (((*con)->errno)==230 ) diff --git a/lib/libftp/FtpMessage.c b/lib/libftp/FtpMessage.c index 90106b14bc9c..8009d052cdaa 100644 --- a/lib/libftp/FtpMessage.c +++ b/lib/libftp/FtpMessage.c @@ -2,9 +2,9 @@ Library for ftpd clients.(libftp) Copyright by Oleg Orel All rights reserved. - -This library is desined for free, non-commercial software creation. -It is changeable and can be improved. The author would greatly appreciate + +This library is desined for free, non-commercial software creation. +It is changeable and can be improved. The author would greatly appreciate any advises, new components and patches of the existing programs. Commercial usage is also possible with participation of it's author. @@ -26,28 +26,28 @@ INLINE static char *___gets(char *s, int maxchars, FTP *ftp) { if ((c = FtpGetc(ftp,FTPCMD(ftp))) == EOF) return NULL; - + if ( c == '\n' && *(p-1) == '\r' ) { p--; *p='\0'; return s; } - + if ( (p-s) > maxchars ) return NULL; - + *p++=(char)c; } } - - + + int FtpGetMessage(FTP *con , char * Message ) { int n; char tmp[1024]; - + while(1) { if (___gets(tmp,sizeof tmp,con)==NULL) @@ -60,7 +60,7 @@ int FtpGetMessage(FTP *con , char * Message ) (*con->debug)(con,0,tmp); } - strcpy(Message,tmp); + strcpy(Message,tmp); FtpInitMessageList(); FtpMessageList[n=FtpNumber(Message)] = ( char * ) malloc ( strlen(Message) + 1); @@ -74,10 +74,10 @@ int FtpGetMessage(FTP *con , char * Message ) STATUS FtpSendMessage(FTP *ftp,char * Message ) { char *msg=Message; - - while (*Message) + + while (*Message) FtpAssert(ftp,FtpPutc(ftp,FTPCMD(ftp),*Message++)); - + FtpAssert(ftp,FtpPutc(ftp,FTPCMD(ftp),'\015')); FtpAssert(ftp,FtpPutc(ftp,FTPCMD(ftp),'\012')); @@ -90,9 +90,9 @@ char *FtpMessage(int number) { extern int sys_nerr,errno; #ifndef __FreeBSD__ - extern char *sys_errlist[]; + extern char *sys_errlist[]; #endif - + FtpInitMessageList(); if ( number == 0 ) return (char *)sys_errlist[errno]; @@ -105,7 +105,7 @@ STATUS FtpInitMessageList() { int i; static u = 0; - + if ( u ) return 1; diff --git a/lib/libftp/FtpMove.c b/lib/libftp/FtpMove.c index 31d6c25fb132..8037b6b66def 100644 --- a/lib/libftp/FtpMove.c +++ b/lib/libftp/FtpMove.c @@ -2,9 +2,9 @@ Library for ftpd clients.(libftp) Copyright by Oleg Orel All rights reserved. - -This library is desined for free, non-commercial software creation. -It is changeable and can be improved. The author would greatly appreciate + +This library is desined for free, non-commercial software creation. +It is changeable and can be improved. The author would greatly appreciate any advises, new components and patches of the existing programs. Commercial usage is also possible with participation of it's author. diff --git a/lib/libftp/FtpNumber.c b/lib/libftp/FtpNumber.c index 56411f8e8b3c..a6d711446188 100644 --- a/lib/libftp/FtpNumber.c +++ b/lib/libftp/FtpNumber.c @@ -2,9 +2,9 @@ Library for ftpd clients.(libftp) Copyright by Oleg Orel All rights reserved. - -This library is desined for free, non-commercial software creation. -It is changeable and can be improved. The author would greatly appreciate + +This library is desined for free, non-commercial software creation. +It is changeable and can be improved. The author would greatly appreciate any advises, new components and patches of the existing programs. Commercial usage is also possible with participation of it's author. diff --git a/lib/libftp/FtpOpenDir.c b/lib/libftp/FtpOpenDir.c index 2d3e56e80f6f..3f2bcf1b5529 100644 --- a/lib/libftp/FtpOpenDir.c +++ b/lib/libftp/FtpOpenDir.c @@ -2,9 +2,9 @@ Library for ftpd clients.(libftp) Copyright by Oleg Orel All rights reserved. - -This library is desined for free, non-commercial software creation. -It is changeable and can be improved. The author would greatly appreciate + +This library is desined for free, non-commercial software creation. +It is changeable and can be improved. The author would greatly appreciate any advises, new components and patches of the existing programs. Commercial usage is also possible with participation of it's author. diff --git a/lib/libftp/FtpPasv.c b/lib/libftp/FtpPasv.c index 3db132afcbc9..3dd52fef4b49 100644 --- a/lib/libftp/FtpPasv.c +++ b/lib/libftp/FtpPasv.c @@ -1,9 +1,9 @@ /* Library for ftpd clients.(libftp) Copyright by Oleg Orel All rights reserved. - -This library is desined for free, non-commercial software creation. -It is changeable and can be improved. The author would greatly appreciate + +This library is desined for free, non-commercial software creation. +It is changeable and can be improved. The author would greatly appreciate any advises, new components and patches of the exist ing programs. Commercial usage is also possible with participation of it's author. @@ -21,27 +21,27 @@ char * FtpPasv (FTP *ftp) char *msg; static String PORT; char *p=PORT; - - if FtpError(FtpCommand(ftp,"PASV","",227,EOF)) + + if FtpError(FtpCommand(ftp,"PASV","",227,EOF)) return ""; - + msg = FtpMessage (227); msg+=3; - - while (!isdigit(*msg++)); + + while (!isdigit(*msg++)); msg--; while (isdigit(*msg)||*msg==',') *p++=*msg++; *p=0; - + return PORT; } STATUS FtpLink(FTP *ftp1, FTP *ftp2) { - + String PORT; strcpy(PORT,FtpPasv(ftp1)); @@ -62,12 +62,12 @@ STATUS FtpPassiveTransfer(FTP *ftp1, FTP *ftp2, char *f1, char *f2) FtpAssert(ftp2,FtpCommand(ftp2,"STOR %s",f2, 200, 120 , 150 , 125 , 250 , EOF )); FtpAssert(ftp1,FtpCommand(ftp1,"RETR %s",f1, 200, 120 , 150 , 125 , 250 , EOF )); - + FD_ZERO(&fds); - + FD_SET(fileno(FTPCMD(ftp1)),&fds); FD_SET(fileno(FTPCMD(ftp2)),&fds); - + if (select(getdtablesize(),&fds,0,0,0)<0) { if (ftp1->error!=NULL) @@ -76,7 +76,7 @@ STATUS FtpPassiveTransfer(FTP *ftp1, FTP *ftp2, char *f1, char *f2) return (*(ftp2->error))(ftp1,QUIT,sys_errlist[errno]); return QUIT; } - + if (FD_ISSET(fileno(FTPCMD(ftp1)),&fds)) { FtpGetMessage(ftp1,tmp); diff --git a/lib/libftp/FtpPort.c b/lib/libftp/FtpPort.c index c6b0ca2b3cb5..eb15ac05c1f4 100644 --- a/lib/libftp/FtpPort.c +++ b/lib/libftp/FtpPort.c @@ -2,9 +2,9 @@ Library for ftpd clients.(libftp) Copyright by Oleg Orel All rights reserved. - -This library is desined for free, non-commercial software creation. -It is changeable and can be improved. The author would greatly appreciate + +This library is desined for free, non-commercial software creation. +It is changeable and can be improved. The author would greatly appreciate any advises, new components and patches of the existing programs. Commercial usage is also possible with participation of it's author. @@ -24,7 +24,7 @@ STATUS FtpPort(FTP *con,int a,int b,int c,int d,int e,int f) return QUIT; if ( (i=FtpGetMessage(con,cmd)) == QUIT) return QUIT; - + if ( ! FtpGood ( i , 200 , EOF )) return EXIT(con,-i); diff --git a/lib/libftp/FtpPwd.c b/lib/libftp/FtpPwd.c index 4299bccf1288..59c792dfdfcf 100644 --- a/lib/libftp/FtpPwd.c +++ b/lib/libftp/FtpPwd.c @@ -2,9 +2,9 @@ Library for ftpd clients.(libftp) Copyright by Oleg Orel All rights reserved. - -This library is desined for free, non-commercial software creation. -It is changeable and can be improved. The author would greatly appreciate + +This library is desined for free, non-commercial software creation. +It is changeable and can be improved. The author would greatly appreciate any advises, new components and patches of the existing programs. Commercial usage is also possible with participation of it's author. @@ -19,12 +19,12 @@ char * FtpPwd(FTP * con) String tmp; static String tmp1; int i; - + if ( FtpSendMessage(con,"PWD") == QUIT ) return (char *) EXIT(con,QUIT); if ( (i=FtpGetMessage(con,tmp)) == QUIT ) return (char *) EXIT(con,QUIT); - + if ( i != 257 ) return (char *) EXIT(con,-i); diff --git a/lib/libftp/FtpRetr.c b/lib/libftp/FtpRetr.c index eb19c16c448b..ced19b8c982b 100644 --- a/lib/libftp/FtpRetr.c +++ b/lib/libftp/FtpRetr.c @@ -2,9 +2,9 @@ Library for ftpd clients.(libftp) Copyright by Oleg Orel All rights reserved. - -This library is desined for free, non-commercial software creation. -It is changeable and can be improved. The author would greatly appreciate + +This library is desined for free, non-commercial software creation. +It is changeable and can be improved. The author would greatly appreciate any advises, new components and patches of the existing programs. Commercial usage is also possible with participation of it's author. @@ -24,7 +24,7 @@ STATUS FtpRetr (FTP * con , char * command , struct stat st; char buffer[FTPBUFSIZ]; register int size; - + FtpFilenameChecker(&in,&out); if ( FtpTestFlag(con,FTP_REST) && stat(out,&st)==0) @@ -39,28 +39,28 @@ STATUS FtpRetr (FTP * con , char * command , if ((o=Ftpfopen(out,"w+"))==NULL) return EXIT(con,LQUIT); } - + if ( FtpError(FtpData(con,command,in,"r"))) { if (con->seek==0) return EXIT(con,con->errno); - + con -> seek = 0; fclose(o); - + if ( FtpError(FtpData(con,command,in,"r")) ) { return EXIT(con,con->errno); } - + if ((o=Ftpfopen(out,"w+"))==NULL) return EXIT(con,LQUIT); } - - + + fseek(o,con->seek,0); - + while((size=FtpReadBlock(con,buffer,FTPBUFSIZ))>0) { if (write(fileno(o),buffer,size)!=size) diff --git a/lib/libftp/FtpSize.c b/lib/libftp/FtpSize.c index 040e16bddf40..581e18641d15 100644 --- a/lib/libftp/FtpSize.c +++ b/lib/libftp/FtpSize.c @@ -2,9 +2,9 @@ Library for ftpd clients.(libftp) Copyright by Oleg Orel All rights reserved. - -This library is desined for free, non-commercial software creation. -It is changeable and can be improved. The author would greatly appreciate + +This library is desined for free, non-commercial software creation. +It is changeable and can be improved. The author would greatly appreciate any advises, new components and patches of the existing programs. Commercial usage is also possible with participation of it's author. @@ -21,12 +21,12 @@ int FtpSize(FTP * con, char *filename) strcpy(tmp,"SIZE "); strcat(tmp,filename); - + if ( FtpSendMessage(con,tmp) == QUIT ) return EXIT(con,QUIT); if ( (i=FtpGetMessage(con,tmp)) == QUIT ) return EXIT(con,QUIT); - + if ( i != 213 ) return con -> errno = (-i); diff --git a/lib/libftp/FtpStor.c b/lib/libftp/FtpStor.c index 9ddb32681c30..9cd0e4eb557a 100644 --- a/lib/libftp/FtpStor.c +++ b/lib/libftp/FtpStor.c @@ -2,9 +2,9 @@ Library for ftpd clients.(libftp) Copyright by Oleg Orel All rights reserved. - -This library is desined for free, non-commercial software creation. -It is changeable and can be improved. The author would greatly appreciate + +This library is desined for free, non-commercial software creation. +It is changeable and can be improved. The author would greatly appreciate any advises, new components and patches of the existing programs. Commercial usage is also possible with participation of it's author. @@ -27,11 +27,11 @@ STATUS FtpStor (FTP * con , char * command , if ( (i=Ftpfopen(in,"rb")) == NULL ) return EXIT(con,LQUIT); - if ( FtpTestFlag(con,FTP_REST) && + if ( FtpTestFlag(con,FTP_REST) && (con->seek=FtpSize(con,out))<0 ) con->seek=0; - - + + if ( FtpError(FtpData(con,command,out,"w"))) { if (con->seek==0) return EXIT(con,con->errno); @@ -40,12 +40,12 @@ STATUS FtpStor (FTP * con , char * command , if ( FtpError(FtpData(con,command,out,"w")) ) return EXIT(con,con->errno); } - + if (con->seek) fseek(i,con->seek,0); - - while ( (size=read ( fileno(i) , buffer, FTPBUFSIZ ))>0) + + while ( (size=read ( fileno(i) , buffer, FTPBUFSIZ ))>0) FtpWriteBlock(con,buffer,size); - + Ftpfclose(i); return FtpClose(con); } diff --git a/lib/libftp/FtpSyscalls.c b/lib/libftp/FtpSyscalls.c index 649d16f779b6..67fa4cae08eb 100644 --- a/lib/libftp/FtpSyscalls.c +++ b/lib/libftp/FtpSyscalls.c @@ -2,9 +2,9 @@ Library for ftpd clients.(libftp) Copyright by Oleg Orel All rights reserved. - -This library is desined for free, non-commercial software creation. -It is changeable and can be improved. The author would greatly appreciate + +This library is desined for free, non-commercial software creation. +It is changeable and can be improved. The author would greatly appreciate any advises, new components and patches of the existing programs. Commercial usage is also possible with participation of it's author. diff --git a/lib/libftp/FtpType.c b/lib/libftp/FtpType.c index 6c32016aeb67..ae0d0ea00b11 100644 --- a/lib/libftp/FtpType.c +++ b/lib/libftp/FtpType.c @@ -2,9 +2,9 @@ Library for ftpd clients.(libftp) Copyright by Oleg Orel All rights reserved. - -This library is desined for free, non-commercial software creation. -It is changeable and can be improved. The author would greatly appreciate + +This library is desined for free, non-commercial software creation. +It is changeable and can be improved. The author would greatly appreciate any advises, new components and patches of the existing programs. Commercial usage is also possible with participation of it's author. @@ -17,10 +17,10 @@ Commercial usage is also possible with participation of it's author. STATUS FtpType(FTP *ftp, char type) { STATUS p; - + if ((p=FtpCommand(ftp,"TYPE %c",type,200,EOF))>0) ftp->mode=(int)type; return p; } - + diff --git a/lib/libftp/Ftpfopen.c b/lib/libftp/Ftpfopen.c index b7b96d59f56d..9b89bb3e7835 100644 --- a/lib/libftp/Ftpfopen.c +++ b/lib/libftp/Ftpfopen.c @@ -2,9 +2,9 @@ Library for ftpd clients.(libftp) Copyright by Oleg Orel All rights reserved. - -This library is desined for free, non-commercial software creation. -It is changeable and can be improved. The author would greatly appreciate + +This library is desined for free, non-commercial software creation. +It is changeable and can be improved. The author would greatly appreciate any advises, new components and patches of the existing programs. Commercial usage is also possible with participation of it's author. @@ -24,9 +24,9 @@ enum {T_EMPTY=0,T_FILE,T_STREAM,T_PIPE,T_FULL}; FILE *Ftpfopen(char *filename,char *mode) { FILE *fp; - + if (!init) - { + { bzero(fds_types,NFDS*sizeof(fds_types[0])); init=1; } @@ -36,22 +36,22 @@ FILE *Ftpfopen(char *filename,char *mode) fds_types[fileno(stdin)]=T_STREAM; return stdin; } - + if (!strcmp(filename,"*STDOUT*") || (!strcmp(filename,"-") && (mode[0]=='w'))) { fds_types[fileno(stdout)]=T_STREAM; return stdout; } - + if (strcmp(filename,"*STDERR*")==0) { fds_types[fileno(stderr)]=T_STREAM; return stderr; } - - if (*filename=='|') + + if (*filename=='|') { fp=popen(filename+1,mode); if (fp==NULL) return fp; @@ -63,33 +63,33 @@ FILE *Ftpfopen(char *filename,char *mode) if (fp==NULL) return fp; fds_types[fileno(fp)]=T_FILE; return fp; - + } int Ftpfclose(FILE *fp) { if (!init) - { + { bzero(fds_types,NFDS*sizeof(fds_types[0])); init=1; } switch (fds_types[fileno(fp)]) { - + case T_FILE: - + return FtpFullClose(fp); - + case T_STREAM: return fflush(fp); - + case T_PIPE: - + return pclose(fp); - + default: return -1; diff --git a/lib/libftp/doc/example.c b/lib/libftp/doc/example.c index 7f0928725ad8..0606592deea3 100644 --- a/lib/libftp/doc/example.c +++ b/lib/libftp/doc/example.c @@ -1,7 +1,7 @@ /* Include standard libftp's header */ -#include <FtpLibrary.h> +#include <FtpLibrary.h> @@ -10,25 +10,25 @@ main(int argc, char *argv[]) FILE *input,*output; int c; - + if (argc<3) exit(fprintf(stderr,"Usage: %s input-file output-file\n",argv[0])); FtplibDebug(yes); - + if ((input=Ftpfopen(argv[1],"r"))==NULL) { perror(argv[1]); exit(1); } - + if ((output=Ftpfopen(argv[2],"w"))==NULL) { perror(argv[2]); exit(1); } - + while ( (c=getc(input)) != EOF && (putc(c,output)!=EOF) ); if (ferror(input)) @@ -36,7 +36,7 @@ main(int argc, char *argv[]) perror(argv[1]); exit(1); } - + if (ferror(output)) { perror(argv[1]); @@ -47,5 +47,5 @@ main(int argc, char *argv[]) Ftpfclose(output); exit(0); - + } diff --git a/lib/libftp/utils/Makefile b/lib/libftp/utils/Makefile index d750ca7b5a45..bae516bf448c 100644 --- a/lib/libftp/utils/Makefile +++ b/lib/libftp/utils/Makefile @@ -25,10 +25,10 @@ uftp: uftp.o uftpcmd.o libetc.a mirror: mirror.o $(CC) $(CFLAGS) -o mirror mirror.o ${LDADD} -lftp -clean: +clean: rm -f ftptry mirror uftp *~ *.o *.a -LIBOBJS= readline.o glob.o -libetc.a: $(LIBOBJS) +LIBOBJS= readline.o glob.o +libetc.a: $(LIBOBJS) ar qc libetc.a $(LIBOBJS) ranlib libetc.a diff --git a/lib/libftp/utils/ftptry.c b/lib/libftp/utils/ftptry.c index 623d0da8e4ae..7dfb130d4b3b 100644 --- a/lib/libftp/utils/ftptry.c +++ b/lib/libftp/utils/ftptry.c @@ -2,9 +2,9 @@ Library for ftpd clients.(libftp) Copyright by Oleg Orel All rights reserved. - -This library is desined for free, non-commercial software creation. -It is changeable and can be improved. The author would greatly appreciate + +This library is desined for free, non-commercial software creation. +It is changeable and can be improved. The author would greatly appreciate any advises, new components and patches of the existing programs. Commercial usage is also possible with participation of it's author. @@ -27,7 +27,7 @@ will be described in usage, if the program is started without them.\n\ \n\ The libftp you may transfer from host lpuds.oea.ihep.su via ftp-anonymous.\n\ All question are sent to author via e-mail (orel@oea.ihep.su)\n\ - "; + "; #include <FtpLibrary.h> #include <sys/types.h> @@ -95,7 +95,7 @@ main(int argc,char **argv) if (setjmp(trap)!=0) exit(1); - + signal(SIGHUP,sighup); signal(SIGTRAP,done); signal(SIGINT,done); @@ -106,13 +106,13 @@ main(int argc,char **argv) gethost()); progname=argv[0]; - + FtpDebug(&FtpInit); FtpSetErrorHandler(&FtpInit,my_abort); FtpSetIOHandler(&FtpInit,my_IO); FtpSetFlag(&FtpInit,FTP_REST); FtpSetTimeout(&FtpInit,DEFAULT_TIMEOUT); - + setoptions(); optind=1; options(argc,argv); @@ -122,7 +122,7 @@ main(int argc,char **argv) { case lm_file: - + if (fork()) quit("Deattaching....."); close(0);close(1);close(2); @@ -133,7 +133,7 @@ main(int argc,char **argv) } else strcpy(tmp,logfile); - + open(tmp,O_TRUNC|O_CREAT|O_WRONLY,0600); dup(0); dup(0); @@ -142,23 +142,23 @@ main(int argc,char **argv) case lm_mail: - + if (fork()) quit("Deattaching....."); - + close(0);close(1);close(2); if (popen("/usr/lib/sendmail -t","w")==NULL) perror("sendmail"), quit(""); - + dup(0); dup(0); - + printf("From: %s@%s\n",USERNAME,gethost()); printf("To: %s@%s\n",USERNAME,gethost()); - printf("Subject: ftptry session log\n\n"); - + printf("Subject: ftptry session log\n\n"); + fflush(stdout); - + break; } @@ -174,12 +174,12 @@ main(int argc,char **argv) INLINE noargs(int argc, char **argv, int optind) { int i; - + for (i=optind;i<argc;i++) if (argv[i]!=NULL) return 0; return 1; } - + /* Main loop */ @@ -192,15 +192,15 @@ loop(int argc, char **argv, int optind /* First args as filename */ ) String filename; String localfilename; char *p1; - + for(i=optind;;(i==argc-1)?i=optind, sprintf(tmp,"Sleeping %d secs",sleeptime),log(tmp),sleep(sleeptime): i++) { if (noargs(argc,argv,optind)) quit("Nothing doing"); - - if (strchr(argv[i],':')==NULL) + + if (strchr(argv[i],':')==NULL) { if (find_archie(argv[i],machine,filename,localfilename)==0) argv[i]=NULL; @@ -226,19 +226,19 @@ transfer(char *machine, char *file, char *localfile) { int r; String tmp; - + if ((r=setjmp(stack))!=0) return r; - + sprintf(tmp,"Start transfer, machine is %s, remote file is %s, local file is %s", machine, file, localfile); DEBUG(tmp); - + FtpLogin(&ftp,machine,user,password,NULL); if (type==binary) FtpBinary(ftp); - + switch (mode) { @@ -260,11 +260,11 @@ transfer(char *machine, char *file, char *localfile) case multiget: domultiget(file); break; - + } - + FtpBye(ftp); - + DEBUG("Transfer complete"); return OK_; } @@ -288,11 +288,11 @@ quit(char *s) log(s); longjmp(trap,1); } - + my_IO(FTP *ftp, int n, char *s ) { - + DEBUG(s); leave(BREAK_); } @@ -312,7 +312,7 @@ domultiget(char *file) { String list,localname,tmp_name; char *p1; - + sprintf(list,"/tmp/ftptry-%s-multiget.XXXXXX",USERNAME); mktemp(list); @@ -405,7 +405,7 @@ void done(sig) options(int argc,char **argv) { char c; - + while((c=getopt(argc,argv,"GOIBDru:p:Pdbs:o:l:t:cm"))!=EOF) { switch(c) @@ -414,16 +414,16 @@ options(int argc,char **argv) case 'G': mode=multiget; break; - + case 'c': if (localfile==NULL) localfile="*STDOUT*"; break; - + case 'I': fprintf(stderr,intro); exit(0); - + case 'r': mode=put; @@ -444,12 +444,12 @@ options(int argc,char **argv) localfile=optarg; break; - + case 'D': debug=true; break; - + case 'u': user=optarg; @@ -464,7 +464,7 @@ options(int argc,char **argv) password=(char *)getpass("Password:"); break; - + case 'b': type=binary; @@ -480,14 +480,14 @@ options(int argc,char **argv) logmode=lm_file; logfile=optarg; break; - + case 'm': logmode=lm_mail; break; - + case 'B': - + logmode=lm_file; logfile=NULL; break; @@ -495,8 +495,8 @@ options(int argc,char **argv) default: usage(); - - } + + } } } @@ -510,14 +510,14 @@ setoptions() - + if ((p=(char *)getenv(FTPTRY))!=NULL && *p!=0) strcpy(x,p); else return; - - + + for (argv[0]="",p=x,sp=x,argc=1; *p!=0 ; p++) { if (*p==' ') @@ -529,7 +529,7 @@ setoptions() } argv[argc++]=sp; - + options(argc,argv); } @@ -562,7 +562,7 @@ find_archie(char *what,char *machine, char *filename, char *localfilename) static String oldwhat={'\0'}; char *p1; int i; - + if (!init || strcmp(oldwhat,what)!=0 || last==0) { String cmd; @@ -571,10 +571,10 @@ find_archie(char *what,char *machine, char *filename, char *localfilename) for (i=0;i<MAXHOPS;i++) result[i][0]=0; sprintf(cmd,"archie -l -m %d %s",MAXHOPS,what); DEBUG(cmd); - + if ((archie = popen(cmd,"r"))==NULL) quit("Archie can't execute"); - + for(i=0;i<MAXHOPS;i++) { if (fgets(result[i],sizeof (result[i]), archie)==NULL) @@ -582,17 +582,17 @@ find_archie(char *what,char *machine, char *filename, char *localfilename) result[i][strlen(result[i])-1]=0; DEBUG(result[i]); } - - + + last=i; - if ( last==0 ) + if ( last==0 ) { DEBUG("archie not found need file"); return(0); } - - + + init=1; first=0; strcpy(oldwhat,what); @@ -606,23 +606,23 @@ find_archie(char *what,char *machine, char *filename, char *localfilename) first=i+1; break; } - + DEBUG("Archie select is ... (see next line)"); DEBUG(result[i]); - + if (sscanf ( result[i] , "%*[^ ] %*[^ ] %[^ ] %s", machine, filename )!=2) { DEBUG("Bad archie output format"); last=0; return(0); } - - + + if ( (p1=strrchr(filename,'/'))!= NULL) strcpy(localfilename,p1+1); else strcpy(localfilename,filename); - + return(1); } diff --git a/lib/libftp/utils/glob.c b/lib/libftp/utils/glob.c index d80b1462fc20..efaeaa6a1cbc 100644 --- a/lib/libftp/utils/glob.c +++ b/lib/libftp/utils/glob.c @@ -58,7 +58,7 @@ static char sccsid[] = "@(#)glob.c 8.3 (Berkeley) 10/13/93"; * GLOB_TILDE: * expand ~user/foo to the /home/dir/of/user/foo * GLOB_BRACE: - * expand {1,2}{a,b} to 1a 1b 2a 2b + * expand {1,2}{a,b} to 1a 1b 2a 2b * gl_matchc: * Number of matches in the current invocation of glob. */ @@ -173,7 +173,7 @@ glob(pattern, flags, errfunc, pglob) bufend = bufnext + MAXPATHLEN; if (flags & GLOB_QUOTE) { /* Protect the quoted characters. */ - while (bufnext < bufend && (c = *patnext++) != EOS) + while (bufnext < bufend && (c = *patnext++) != EOS) if (c == QUOTE) { if ((c = *patnext++) == EOS) { c = QUOTE; @@ -184,8 +184,8 @@ glob(pattern, flags, errfunc, pglob) else *bufnext++ = c; } - else - while (bufnext < bufend && (c = *patnext++) != EOS) + else + while (bufnext < bufend && (c = *patnext++) != EOS) *bufnext++ = c; *bufnext = EOS; @@ -246,7 +246,7 @@ static int globexp2(ptr, pattern, pglob, rv) for (pm = pe++; *pe != RBRACKET && *pe != EOS; pe++) continue; if (*pe == EOS) { - /* + /* * We could not find a matching RBRACKET. * Ignore and just look for RBRACE */ @@ -274,7 +274,7 @@ static int globexp2(ptr, pattern, pglob, rv) for (pl = pm++; *pm != RBRACKET && *pm != EOS; pm++) continue; if (*pm == EOS) { - /* + /* * We could not find a matching RBRACKET. * Ignore and just look for RBRACE */ @@ -299,7 +299,7 @@ static int globexp2(ptr, pattern, pglob, rv) /* Append the current string */ for (lm = ls; (pl < pm); *lm++ = *pl++) continue; - /* + /* * Append the rest of the pattern after the * closing brace */ @@ -344,15 +344,15 @@ globtilde(pattern, patbuf, pglob) return pattern; /* Copy up to the end of the string or / */ - for (p = pattern + 1, h = (char *) patbuf; *p && *p != SLASH; + for (p = pattern + 1, h = (char *) patbuf; *p && *p != SLASH; *h++ = *p++) continue; *h = EOS; if (((char *) patbuf)[0] == EOS) { - /* - * handle a plain ~ or ~/ by expanding $HOME + /* + * handle a plain ~ or ~/ by expanding $HOME * first and then trying the password file */ if ((h = getenv("HOME")) == NULL) { @@ -375,14 +375,14 @@ globtilde(pattern, patbuf, pglob) /* Copy the home directory */ for (b = patbuf; *h; *b++ = *h++) continue; - + /* Append the rest of the pattern */ while ((*b++ = *p++) != EOS) continue; return patbuf; } - + /* * The main glob() routine: compiles the pattern (optionally processing @@ -440,7 +440,7 @@ glob0(pattern, pglob) break; case STAR: pglob->gl_flags |= GLOB_MAGCHAR; - /* collapse adjacent stars to one, + /* collapse adjacent stars to one, * to avoid exponential behavior */ if (bufnext == patbuf || bufnext[-1] != M_ALL) @@ -460,17 +460,17 @@ glob0(pattern, pglob) return(err); /* - * If there was no match we are going to append the pattern + * If there was no match we are going to append the pattern * if GLOB_NOCHECK was specified or if GLOB_NOMAGIC was specified * and the pattern did not contain any magic characters * GLOB_NOMAGIC is there just for compatibility with csh. */ - if (pglob->gl_pathc == oldpathc && - ((pglob->gl_flags & GLOB_NOCHECK) || + if (pglob->gl_pathc == oldpathc && + ((pglob->gl_flags & GLOB_NOCHECK) || ((pglob->gl_flags & GLOB_NOMAGIC) && !(pglob->gl_flags & GLOB_MAGCHAR)))) return(globextend(pattern, pglob)); - else if (!(pglob->gl_flags & GLOB_NOSORT)) + else if (!(pglob->gl_flags & GLOB_NOSORT)) qsort(pglob->gl_pathv + pglob->gl_offs + oldpathc, pglob->gl_pathc - oldpathc, sizeof(char *), compare); return(0); @@ -519,7 +519,7 @@ glob2(pathbuf, pathend, pattern, pglob) *pathend = EOS; if (g_lstat(pathbuf, &sb, pglob)) return(0); - + if (((pglob->gl_flags & GLOB_MARK) && pathend[-1] != SEP) && (S_ISDIR(sb.st_mode) #ifdef S_ISLNK @@ -576,7 +576,7 @@ glob3(pathbuf, pathend, pattern, restpattern, pglob) *pathend = EOS; errno = 0; - + if ((dirp = g_opendir(pathbuf, pglob)) == NULL) { /* TODO: don't call for ENOENT or ENOTDIR? */ if (pglob->gl_errfunc) { @@ -602,7 +602,7 @@ glob3(pathbuf, pathend, pattern, restpattern, pglob) /* Initial DOT must be matched literally. */ if (dp->d_name[0] == DOT && *pattern != DOT) continue; - for (sc = (u_char *) dp->d_name, dc = pathend; + for (sc = (u_char *) dp->d_name, dc = pathend; (*dc++ = *sc++) != EOS;) continue; if (!match(pathend, pattern, restpattern)) { @@ -648,7 +648,7 @@ globextend(path, pglob) const Char *p; newsize = sizeof(*pathv) * (2 + pglob->gl_pathc + pglob->gl_offs); - pathv = pglob->gl_pathv ? + pathv = pglob->gl_pathv ? realloc((char *)pglob->gl_pathv, newsize) : malloc(newsize); if (pathv == NULL) @@ -690,7 +690,7 @@ match(name, pat, patend) case M_ALL: if (pat == patend) return(1); - do + do if (match(name, pat, patend)) return(1); while (*name++ != EOS); @@ -829,7 +829,7 @@ g_Ctoc(str, buf) } #ifdef DEBUG -static void +static void qprintf(str, s) const char *str; register Char *s; diff --git a/lib/libftp/utils/glob.h b/lib/libftp/utils/glob.h index bffb28c7252c..b0432b717e98 100644 --- a/lib/libftp/utils/glob.h +++ b/lib/libftp/utils/glob.h @@ -58,7 +58,7 @@ typedef struct { * and lstat(2). */ void (*gl_closedir) __P((void *)); - struct dirent *(*gl_readdir) __P((void *)); + struct dirent *(*gl_readdir) __P((void *)); void *(*gl_opendir) __P((const char *)); int (*gl_lstat) __P((const char *, struct stat *)); int (*gl_stat) __P((const char *, struct stat *)); diff --git a/lib/libftp/utils/mirror.c b/lib/libftp/utils/mirror.c index babd840e6820..a0d329c1d2de 100644 --- a/lib/libftp/utils/mirror.c +++ b/lib/libftp/utils/mirror.c @@ -9,7 +9,7 @@ #include <syslog.h> #include <FtpLibrary.h> -/* Usage: mirror <local_dir> <host> <user> <passwd> <remote_dir> */ +/* Usage: mirror <local_dir> <host> <user> <passwd> <remote_dir> */ FTP *ftp; main(int a,char **b) @@ -24,7 +24,7 @@ main(int a,char **b) if ( a < 5 ) quit("Usage: mirror <local_dir> <host> <user> <passwd> <remote_dir>"); - + FtplibDebug(yes); FtpLogin(&ftp,HOST,USER,PASSWD,NULL); FtpChdir(ftp,REMOTE_DIR); @@ -53,7 +53,7 @@ doit(char *dirname) continue; sprintf(fn,"%s/%s",dirname,de->d_name); - + if ( stat(fn,&st) != 0 ) { log(fn); continue; @@ -72,7 +72,7 @@ doit(char *dirname) } closedir(dp); - + } diff --git a/lib/libftp/utils/readline.c b/lib/libftp/utils/readline.c index 34612ba8b339..e019bc1aaae0 100644 --- a/lib/libftp/utils/readline.c +++ b/lib/libftp/utils/readline.c @@ -1,5 +1,5 @@ #ifndef lint -static char *RCSid = "$Id: readline.c%v 3.50.1.9 1993/08/05 05:38:59 woo Exp $"; +static char *RCSid = "$Id: readline.c,v 1.1.1.1 1995/04/25 15:05:09 jkh Exp $"; #endif @@ -8,17 +8,17 @@ static char *RCSid = "$Id: readline.c%v 3.50.1.9 1993/08/05 05:38:59 woo Exp $"; * Copyright (C) 1986 - 1993 Thomas Williams, Colin Kelley * * Permission to use, copy, and distribute this software and its - * documentation for any purpose with or without fee is hereby granted, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear + * documentation for any purpose with or without fee is hereby granted, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear * in supporting documentation. * * Permission to modify the software is granted, but not the right to - * distribute the modified code. Modifications are to be distributed + * distribute the modified code. Modifications are to be distributed * as patches to released version. - * + * * This software is provided "as is" without express or implied warranty. - * + * * * AUTHORS * @@ -27,10 +27,10 @@ static char *RCSid = "$Id: readline.c%v 3.50.1.9 1993/08/05 05:38:59 woo Exp $"; * * Msdos port and some enhancements: * Gershon Elber and many others. - * + * * There is a mailing list for gnuplot users. Note, however, that the - * newsgroup - * comp.graphics.gnuplot + * newsgroup + * comp.graphics.gnuplot * is identical to the mailing list (they * both carry the same set of messages). We prefer that you read the * messages through that newsgroup, to subscribing to the mailing list. @@ -40,9 +40,9 @@ static char *RCSid = "$Id: readline.c%v 3.50.1.9 1993/08/05 05:38:59 woo Exp $"; * * The address for mailing to list members is * info-gnuplot@dartmouth.edu - * and for mailing administrative requests is + * and for mailing administrative requests is * info-gnuplot-request@dartmouth.edu - * The mailing list for bug reports is + * The mailing list for bug reports is * bug-gnuplot@dartmouth.edu * The list of those interested in beta-test versions is * info-gnuplot-beta@dartmouth.edu @@ -57,7 +57,7 @@ static char *RCSid = "$Id: readline.c%v 3.50.1.9 1993/08/05 05:38:59 woo Exp $"; #endif /* a small portable version of GNU's readline */ -/* this is not the BASH or GNU EMACS version of READLINE due to Copyleft +/* this is not the BASH or GNU EMACS version of READLINE due to Copyleft restrictions */ /* do not need any terminal capabilities except backspace, */ /* and space overwrites a character */ @@ -123,7 +123,7 @@ static struct ltchars s_ltchars; #ifdef ISC22 #ifndef ONOCR /* taken from sys/termio.h */ #define ONOCR 0000020 /* true at least for ISC 2.2 */ -#endif +#endif #ifndef IUCLC #define IUCLC 0001000 #endif @@ -226,7 +226,7 @@ void reset_termio(); /* user_putc and user_puts should be used in the place of * fputc(ch,stderr) and fputs(str,stderr) for all output - * of user typed characters. This allows MS-Windows to + * of user typed characters. This allows MS-Windows to * display user input in a different color. */ int user_putc(ch) @@ -265,7 +265,7 @@ backspace() { user_putc(BACKSPACE); } - + char * readline(prompt) char *prompt; @@ -322,7 +322,7 @@ char *prompt; } } #endif /*OS2*/ - if((isprint(cur_char) + if((isprint(cur_char) #if defined(ATARI) || defined(_Windows) || defined(MSDOS) || defined(DOS386) /* this should be used for all 8bit ASCII machines, I guess */ || ((unsigned char)cur_char > 0x7f) @@ -455,7 +455,7 @@ char *prompt; if(cur_entry != NULL) { cur_entry = cur_entry->next; clear_line(prompt); - if(cur_entry != NULL) + if(cur_entry != NULL) copy_line(cur_entry->line); else cur_pos = max_pos = 0; @@ -714,12 +714,12 @@ msdos_getch() /* Convert Arrow keystrokes to Control characters: TOS version */ -/* the volatile could be necessary to keep gcc from reordering +/* the volatile could be necessary to keep gcc from reordering the two Super calls */ #define CONTERM ((/*volatile*/ char *)0x484L) -static void +static void remove_conterm() { void *ssp=(void*)Super(0L); @@ -929,7 +929,7 @@ set_termio() } #endif /* !MSDOS && !ATARI && !defined(_Windows) */ } - + void reset_termio() { diff --git a/lib/libftp/utils/uftp.c b/lib/libftp/utils/uftp.c index fe64ffd23dfe..4c8961ffcd6e 100644 --- a/lib/libftp/utils/uftp.c +++ b/lib/libftp/utils/uftp.c @@ -37,25 +37,25 @@ main(int argc, char **argv) register char *p1; FILE *fp; String tmp; - - if (setjmp(start)!=0) + + if (setjmp(start)!=0) goto main_loop; - + setsignals(); - - + + FtpSetErrorHandler(&FtpInit,my_error); FtpSetIOHandler(&FtpInit,my_error); - + strcpy(defaultuser,getpwuid(getuid())->pw_name); - + memset(ftp,0,sizeof(FTP*)*NFRAMES); memset(iftp,0,sizeof(LINKINFO)*NFRAMES); - - + + batch(SYSTEMRC); if (access(getrcname(),F_OK)) @@ -69,16 +69,16 @@ main(int argc, char **argv) else { - + fprintf(out,"set timeout 120\nset hash\nset debug\nset bin\n"); fprintf(out,"set prompt \"%%T %%u@%%h:%%d\\> \"\n"); fprintf(out,"alias a alias\na ed ! emacs\nalias tn ! telnet\n"); - + fclose(out); } } - + batch(getrcname()); batch(getaliasrcname()); @@ -88,7 +88,7 @@ main(int argc, char **argv) strcat(tmp,argv[i]); if (i+1!=argc) strcat(tmp," "); } - + if (tmp[0]!=0) { String new; @@ -99,8 +99,8 @@ main(int argc, char **argv) else */ strcpy(new,"open "); - - if (ifalias(tmp)) + + if (ifalias(tmp)) execute (tmp); else strcat(new,tmp), @@ -111,25 +111,25 @@ main(int argc, char **argv) main_loop: setsignals(); - + while (1) { - + setjmp(start); if (lastcmd) exit(0); - + if (isatty(fileno(stdin))) p1=readline(getprompt()); else p1=gets(cmd); - - if (p1==NULL) + + if (p1==NULL) { putchar('\n'); exit(0); } - + strcpy(cmd,p1); if (cmd[0]) add_history(cmd); @@ -144,15 +144,15 @@ INLINE char *findspace(char *str) } - + char *word(char *str, int n) { String new; register char *p1, *p2; register int i; - + strcpy(new,str); - + p1=new; while (isspace(*p1)) p1++; @@ -160,7 +160,7 @@ char *word(char *str, int n) if (n>1 ) for (i=0;i<n-1;i++) /* Skip n-1 words */ { - if ((*p1=='"')||(*p1=='\'')) + if ((*p1=='"')||(*p1=='\'')) { p1=strchr(p1+1,*p1); if (p1==NULL) return ""; @@ -181,7 +181,7 @@ char *word(char *str, int n) *p2=0; return p1+1; } - + if ((p2=findspace(p1)) != NULL ) { *p2=0; @@ -191,8 +191,8 @@ char *word(char *str, int n) } -/* Exacute few command separated by ';' . The character ' must use for mark complex - works*/ +/* Exacute few command separated by ';' . The character ' must use for mark complex + works*/ execute (char *cmd) { @@ -208,13 +208,13 @@ execute (char *cmd) { *p++=*cmd++; while ( *cmd != '\'' && *cmd != 0 ) *p++=*cmd++; - if ( *cmd == 0 ) + if ( *cmd == 0 ) return puts("Unbalanced \', please corrected!\n"); *p++=*cmd; continue; } - - if ( *cmd == ';' ) + + if ( *cmd == ';' ) { *p=0; execute(newcmd); @@ -224,11 +224,11 @@ execute (char *cmd) *p++=*cmd; } - + *p=0; cmd=newcmd; - - if ( *cmd=='\\' ) + + if ( *cmd=='\\' ) cmd++; else { @@ -238,17 +238,17 @@ execute (char *cmd) return execute(new); } - if ( *cmd == '!' ) + if ( *cmd == '!' ) { int pid,_pid; int status; - + if (!(pid=fork())) { execlp((getenv("SHELL")==NULL)?"/bin/sh":(char *)getenv("SHELL"), "shell","-c",cmd+1,NULL); } - + while(1) { _pid=wait(&status); @@ -256,8 +256,8 @@ execute (char *cmd) return; } } - - + + redir(cmd); if (cmd[strlen(cmd)-1]=='&') @@ -271,14 +271,14 @@ execute (char *cmd) strcpy(cmd,tmp); } - + strcpy(w1,word(cmd,1)); strcpy(w2,word(cmd,2)); strcpy(w3,word(cmd,3)); strcpy(w4,word(cmd,4)); strcpy(w5,word(cmd,5)); strcpy(w6,word(cmd,6)); - + return executev(w1,w2,w3,w4,w5,w6); } @@ -286,18 +286,18 @@ executev(ARGS) { CMDS *xcmd=&cmds[0]; String tmp; - + if (isdigit(*w1)) - return + return atoi(w1)<NFRAMES?frame=atoi(w1):0, executev(w2,w3,w4,w5,w6,""); - + while ( xcmd -> cmd != NULL ) { if ( !strcmp(xcmd->cmd,w1) && (xcmd -> func != NULL) ) { int status; - + if ( xcmd -> need && LINK == NULL) return puts("Need connection to server"); iftp[frame].lock=1; unsetsignals(); @@ -308,11 +308,11 @@ executev(ARGS) } xcmd++; } - - + + if (LINK!=NULL && glassmode) return FtpCommand(LINK,cmd,"",0,EOF); - + printf("%s: unknown command\n",w1); fflush(stdout); return -1; @@ -332,7 +332,7 @@ void intr(int sig) newframe(int connecteble) { register int i; - + if (connecteble) for (i=0; i<NFRAMES; i++) if (ftp[i]!=NULL) return frame=i; for (i=0; i<NFRAMES; i++) if (ftp[i]==NULL) return frame=i; @@ -345,7 +345,7 @@ STATUS my_error(FTP *ftp, int code, char *msg) if (code==LQUIT||(ftp==NULL)) log(msg); else FtpLog(ftp->title,msg); - + if ( abs(code) == 530 && (strstr(msg,"anonymous")!=NULL)) { Ftp_reopen(); @@ -358,7 +358,7 @@ char *getrcname() { static String rcpath; struct passwd *pwd=getpwuid(getuid()); - + sprintf(rcpath,"%s/.uftprc",pwd->pw_dir); return rcpath; } @@ -367,7 +367,7 @@ char *getaliasrcname() { static String rcpath; struct passwd *pwd=getpwuid(getuid()); - + sprintf(rcpath,"%s/.uftp_aliases",pwd->pw_dir); return rcpath; } @@ -378,14 +378,14 @@ char *makestr(va_alist) char *p1; va_list args; String new={0}; - + va_start(args); while(1) { p1=va_arg(args,char *); if (p1==NULL) break; - if (*p1!=0) + if (*p1!=0) { if (new[0]!=0) strcat(new," "); strcat(new,p1); @@ -395,7 +395,7 @@ char *makestr(va_alist) return new; } - + #define ADD(str,chr) (*str++=chr,*str=0) INLINE ADDSTR(char **str, char *str1) @@ -409,59 +409,59 @@ char *expandalias(char *str) String new={0},w1={0}; char *p,*p1=new,*args; int dollar=0; - + strcpy(w1,word(str,1)); if ( (p=strchr(str,' '))!=NULL ) args=p+1; else args=""; - - while (a) + + while (a) { if (!strcmp(a->name,w1)) break; a=a->next; } - - if (!a) + + if (!a) return str; - + for ( p=a->str; *p; p++) { - if ( *p != '$' ) + if ( *p != '$' ) { ADD(p1,*p); continue; } - + dollar=1; p++; - - if (isdigit(*p)) + + if (isdigit(*p)) { ADDSTR(&p1,word(str,(*p)-'0'+1)); continue; } - switch (*p) - { - + switch (*p) + { + case '\0': case '$': ADD(p1,'$');continue; case '*': ADDSTR(&p1,args);continue; default: ADD(p1,'$');ADD(p1,*p);continue; } } - - if (!dollar) + + if (!dollar) { ADD(p1,' '); ADDSTR(&p1,args); } *p=0; - + return new; } @@ -481,12 +481,12 @@ ifalias(char *cmd) } return 0; } - + char *getprompt() { - + static String _prompt; String tmp; char *s; @@ -499,22 +499,22 @@ char *getprompt() case '%': switch (*++s) { - - case 'H': + + case 'H': strcat(_prompt,iftp[frame].host); break; - + case 'h': strcpy(tmp,iftp[frame].host); if (strchr(tmp,'.')!=NULL) *(char *)strchr(tmp,'.')=0; strcat(_prompt,tmp); break; - case 'M': + case 'M': gethostname(tmp, sizeof tmp); strcat(_prompt,gethostbyname(tmp)->h_name); break; - + case 'm': gethostname(tmp, sizeof tmp); strcpy(tmp,gethostbyname(tmp)->h_name); @@ -525,7 +525,7 @@ char *getprompt() case 'u': strcat(_prompt,iftp[frame].user); break; - + case 'd': strcat(_prompt,iftp[frame].pwd); break; @@ -543,16 +543,16 @@ char *getprompt() sprintf(tmp,"%d",(LINK==NULL)?0:LINK->port); strcat(_prompt,tmp); break; - + case 't': - + sprintf(tmp,"%d",(LINK==NULL)?0:LINK->timeout.tv_sec); strcat(_prompt,tmp); break; - + case 'T': - + { time_t t=time((time_t *)0); struct tm *lt=localtime(&t); @@ -567,7 +567,7 @@ char *getprompt() sprintf(tmp,"%d",getpid()); strcat(_prompt,tmp); break; - + default: sprintf(tmp,"%%%c",*s); strcat(_prompt,tmp); @@ -576,7 +576,7 @@ char *getprompt() break; case '^': - + ++s; if (isalpha(*s)) { @@ -584,17 +584,17 @@ char *getprompt() strcat(_prompt,tmp); } break; - + default: - + sprintf(tmp,"%c",*s); strcat(_prompt,tmp); break; } return _prompt; } - - + + void noop() { int i; @@ -603,26 +603,26 @@ void noop() if (noopinterval==0) return; - + curtime = time((time_t *)0); - + signal(SIGALRM,noop); - - if (prevtime==0) + + if (prevtime==0) { prevtime=curtime; alarm(noopinterval); return; } - - if (curtime-prevtime < noopinterval) + + if (curtime-prevtime < noopinterval) { alarm(prevtime+noopinterval-curtime); return; } - + printf("Waiting...");fflush(stdout); - + for (i=0;i<NFRAMES;i++) { if ( ftp[i]==NULL || FTPCMD(ftp[i]) == NULL || iftp[i].lock ) @@ -633,7 +633,7 @@ void noop() func3=ftp[i]->IO; ftp[i]->IO=NULL; save = ftp[i]->timeout.tv_sec; ftp[i]->timeout.tv_sec = nooptimeout; - + FtpCommand(ftp[i],"NOOP","",0,EOF); ftp[i]->timeout.tv_sec = save; @@ -642,10 +642,10 @@ void noop() ftp[i]->IO=func1; } - + alarm(noopinterval); prevtime=curtime; - + for (i=0;i<10;i++) putchar(8),putchar(' '),putchar(8); fflush(stdout); } @@ -667,7 +667,7 @@ unsetsignals() int myhash(FTP *ftp,unsigned int chars) { - + if (hashmode) { if (chars==0) return ftp -> counter=0; @@ -676,7 +676,7 @@ int myhash(FTP *ftp,unsigned int chars) fflush(stdout); } - if (!lastcmd) + if (!lastcmd) { noop(); alarm(0); @@ -688,7 +688,7 @@ int myhash(FTP *ftp,unsigned int chars) char *makefilename(char *f1, char *f2) { char *p; - + if (*f2!=0) return f2; @@ -702,21 +702,21 @@ redir(char *cmdline) char *p=cmdline; String result; char *r=result; - + for ( ; *p ; p++ , r++ ) { - if ( *p == '\\' ) + if ( *p == '\\' ) { *r = * ++ p ; continue; } - + if ( *p == '>' || *p == '<' ) { String filename; char *q=filename; char c=*p; - + for (p++;isspace(*p)&&*p!=0;p++); if (*p=='"') { @@ -725,10 +725,10 @@ redir(char *cmdline) } else for (; !isspace(*p) && *p!=0 ; p++,q++) *q=*p; - + *q=0; - - if ( c == '>' ) + + if ( c == '>' ) output(filename); else input(filename); @@ -745,7 +745,7 @@ FILE *is=NULL,*os=NULL; input(char *filename) { - + if ((is=Ftpfopen(filename,"r"))==NULL) { perror(filename); @@ -761,13 +761,13 @@ input(char *filename) output(char *filename) { - + if ((os=Ftpfopen(filename,"w"))==NULL) { perror(filename); return; } - + fflush(stdout); otty=dup(1); close(1); @@ -803,10 +803,10 @@ batch(char *filename) { FILE *fp; String tmp; - + if ((fp=fopen(filename,"r"))!=NULL) { - + while ( fgets(tmp, sizeof tmp, fp) != NULL) { tmp[strlen(tmp)-1]=0; @@ -816,7 +816,7 @@ batch(char *filename) fclose(fp); } } - + diff --git a/lib/libftp/utils/uftpcmd.c b/lib/libftp/utils/uftpcmd.c index 959de4030e65..2eb3cb246186 100644 --- a/lib/libftp/utils/uftpcmd.c +++ b/lib/libftp/utils/uftpcmd.c @@ -10,61 +10,61 @@ Ftp_connect_hook(FTP *ftp,int code, char *msg) { FtpLog(ftp->title,msg); longjmp(connectstack,1); - + } - -Ftp_connect(ARGS) + +Ftp_connect(ARGS) { STATUS (*func1)(),(*func2)(); if (*w2==0) w2=readline("Host:"); - if (FtpGetHost(w2)==NULL && FtpInit.IO != NULL) + if (FtpGetHost(w2)==NULL && FtpInit.IO != NULL) { char *msg; extern int h_errno; - + switch(h_errno) { case HOST_NOT_FOUND: msg = "Host unknown"; break; case TRY_AGAIN: msg = "Hostname lookup failure";break; - default: msg = "gethostbyname failure"; + default: msg = "gethostbyname failure"; } return (*FtpInit.IO)(LINK,QUIT,msg); } - + newframe(0); - + func1 = FtpInit.error; func2 = FtpInit.IO; - - if (trymode) + + if (trymode) { FtpSetErrorHandler(&FtpInit,Ftp_connect_hook); FtpSetIOHandler(&FtpInit,Ftp_connect_hook); setjmp(connectstack); } - + FtpConnect(&LINK,w2); strcpy(iftp[frame].host,FtpGetHost(w2)->h_name); - + FtpSetErrorHandler(LINK,func1); FtpSetErrorHandler(&FtpInit,func1); FtpSetIOHandler(LINK,func2); FtpSetIOHandler(&FtpInit,func2); - + return; } Ftp_user(ARGS) { - + if (*w2==0) { sprintf(tmp,"login (default %s):",defaultuser); w2=readline(tmp); - if (*w2==0) + if (*w2==0) w2=defaultuser; } strcpy(iftp[frame].user,w2); @@ -74,11 +74,11 @@ Ftp_user(ARGS) Ftp_pass(ARGS) { - if (*w2==0) + if (*w2==0) { String pass; String host; - + gethostname(host, sizeof host); strcpy(host,FtpGetHost(host)->h_name); sprintf(pass,"%s@%s",getpwuid(getuid())->pw_name,host); @@ -86,7 +86,7 @@ Ftp_pass(ARGS) w2=getpass(tmp); if (*w2==0) w2=pass; } - + strcpy(iftp[frame].pass,w2); FtpPassword(LINK,w2); strcpy(iftp[frame].pwd,FtpPwd(LINK)); @@ -96,11 +96,11 @@ Ftp_open(ARGS) { register char *p1; STATUS (*err)(); - + Ftp_connect("",w2,"","","",""); Ftp_user("",w3,w4,"","","" ); if (ifalias("autologin")) execute("autologin"); - if (*w5) + if (*w5) Ftp_cd("cd",w5,"","","",""); } @@ -121,11 +121,11 @@ Ftp_ftp(ARGS) { String pass; String host; - + gethostname(host, sizeof host); strcpy(host,FtpGetHost(host)->h_name); sprintf(pass,"%s@%s",getpwuid(getuid())->pw_name,host); - + Ftp_open("",w2,"anonymous",pass,w3,""); return; } @@ -147,14 +147,14 @@ Ftp_lcd(ARGS) glob_t gl; bzero(&gl,sizeof gl); - + glob(w2,GLOB_BRACE|GLOB_TILDE|GLOB_QUOTE, Ftp_mput_handler, &gl); - - + + if (gl.gl_matchc<1 || chdir(*gl.gl_pathv)) perror(w2); - + printf("Local directory is \"%s\"\n",getwd(tmp)); } @@ -163,35 +163,35 @@ Ftp_dir(ARGS) char *cmd1; String cmd; char mode=LINK->mode; - - if ( !strcmp(w1,"dir") ) + + if ( !strcmp(w1,"dir") ) cmd1="LIST"; else cmd1="NLST"; - + strcpy(cmd,makestr(cmd1,w2,w3,w4,w5,w6,NULL)); if ( LINK->mode != 'A' ) FtpAscii(LINK); FtpRetr(LINK,cmd,"","-"); if ( LINK->mode != mode ) FtpType(LINK,mode); - + } Ftp_close(ARGS) { register int i; - - if (isdigit(*w2)) + + if (isdigit(*w2)) { i=atoi(w2); } - else + else { i=frame; } - + FtpQuickBye(ftp[i]); - + iftp[i].host[0]=0; iftp[i].pwd[0]=0; ftp[i]=NULL; @@ -203,19 +203,19 @@ INLINE SetLogicalVar(char arg, int * var, char *msg) { switch(arg) { - + case 'y': - + *var=1; break; - + case 'n': - + *var=0; break; - + default: - + (*var)?(*var=0):(*var=1); break; } @@ -227,7 +227,7 @@ Ftp_set(ARGS) { if (!strcmp("frame",w2)) return atoi(w3)<NFRAMES?frame=atoi(w3):0; - + if (!strcmp("timeout",w2)) { FtpSetTimeout(&FtpInit,atoi(w3)); @@ -235,17 +235,17 @@ Ftp_set(ARGS) FtpSetTimeout(LINK,atoi(w3)); return; } - + if (!strcmp("sleep",w2)) { sleeptime=atoi(w3); return; } - + if (!strcmp("debug",w2)) { - if ( *w3=='y' || *w3==0) - { + if ( *w3=='y' || *w3==0) + { if (LINK!=NULL) FtpSetDebugHandler(LINK,FtpDebugDebug); FtpSetDebugHandler(&FtpInit,FtpDebugDebug); return puts("Debuging on for current and next session"); @@ -257,11 +257,11 @@ Ftp_set(ARGS) return puts("Debuging off for current and next session"); } } - + if (!strcmp("bin",w2)) { - if ( *w3=='y' || *w3==0) - { + if ( *w3=='y' || *w3==0) + { FtpInit.mode='I'; return puts("Binary mode enable"); } @@ -271,7 +271,7 @@ Ftp_set(ARGS) return puts("Binary mode disable"); } } - + if (!strcmp("try",w2)) return SetLogicalVar(*w3,&trymode,"Try mode"); if (!strcmp("hash",w2)) @@ -280,16 +280,16 @@ Ftp_set(ARGS) return SetLogicalVar(*w3,&glassmode,"Glass mode"); if (!strcmp("rest",w2)||!strcmp(w2,"restore")) return SetLogicalVar(*w3,&restmode,"Restore mode"); - + if (!strcmp("prompt",w2)) { strcpy(prompt,w3); return; } - + if (!strcmp("port",w2)) { - if ( isdigit(*w3)) + if ( isdigit(*w3)) return FtpSetPort(&FtpInit,atoi(w3)); puts("Port must be number"); fflush(stdout); @@ -298,7 +298,7 @@ Ftp_set(ARGS) if (!strcmp("noopinterval",w2)||!strcmp("noop",w2)) { - if ( isdigit(*w3)) + if ( isdigit(*w3)) return noopinterval=(time_t)atoi(w3); puts("Time must be number"); fflush(stdout); @@ -307,21 +307,21 @@ Ftp_set(ARGS) if (!strcmp("nooptimeout",w2)) { - if ( isdigit(*w3)) + if ( isdigit(*w3)) return nooptimeout=(time_t)atoi(w3); puts("Time must be number"); fflush(stdout); return; } - + if (!strcmp("user",w2)||!strcmp("login",w2)) { strcpy(defaultuser,w3); return; } - + if (!strcmp("",w2)) { @@ -342,8 +342,8 @@ Ftp_set(ARGS) fflush(stdout); return; } - return puts("arg 2 unknown"); - + return puts("arg 2 unknown"); + } jmp_buf getstack; @@ -351,13 +351,13 @@ jmp_buf getstack; Ftp_get_hook(FTP *con,int code, char *msg) { - if ( abs(code)==550 && FtpBadReply550(msg) ) + if ( abs(code)==550 && FtpBadReply550(msg) ) { FtpLog(con->title,msg); log("Transfer cancel"); longjmp(getstack,2); } - + if ( code == LQUIT ) { log(msg); @@ -366,7 +366,7 @@ Ftp_get_hook(FTP *con,int code, char *msg) } - + FtpLog(con->title,msg); FtpQuickBye(LINK); LINK=NULL; @@ -374,11 +374,11 @@ Ftp_get_hook(FTP *con,int code, char *msg) log("sleeping......"); sleep(sleeptime); log("try again..."); - + longjmp(getstack,1); - + } - + void Ftp_get_intr(int sig) { signal(SIGINT,intr); @@ -393,19 +393,19 @@ Ftp_get(ARGS) int back=0; int code; int status=0; - + OldInit=FtpInit; - + if (strstr(w1,"put")!=NULL) back=1; - - + + if (restmode || ((*w1=='r')&&(*(w1+1)=='e')) ) FtpSetFlag(LINK,FTP_REST); else - FtpClearFlag(LINK,FTP_REST); - - - + FtpClearFlag(LINK,FTP_REST); + + + if (trymode) { FtpSetErrorHandler(LINK,Ftp_get_hook); @@ -414,28 +414,28 @@ Ftp_get(ARGS) FTPCMD(&FtpInit)=FTPCMD(&OldInit); FTPDATA(&FtpInit)=FTPDATA(&OldInit); } - + signal(SIGINT,Ftp_get_intr); FtpSetHashHandler(LINK,NULL); - - - if ((status=setjmp(getstack))==2||status==3) + + + if ((status=setjmp(getstack))==2||status==3) goto done; - + if ((LINK==NULL)||(LINK->sock==FtpInit.sock)) { FtpLogin(&LINK,iftp[frame].host,iftp[frame].user, - iftp[frame].pass,NULL); + iftp[frame].pass,NULL); FtpChdir(LINK,iftp[frame].pwd); } - + if (hashmode && isatty(fileno(stdout))) FtpSetHashHandler(LINK,myhash); else FtpSetHashHandler(LINK,NULL); - + myhash(LINK,0); - + if (!back) FtpGet(LINK,w2,makefilename(w2,w3)); else @@ -443,15 +443,15 @@ Ftp_get(ARGS) log("Transfer compliete"); - - + + done: - - + + FtpSetHashHandler(LINK,NULL); FtpSetErrorHandler(LINK,my_error); FtpSetIOHandler(LINK,my_error); - FtpClearFlag(LINK,FTP_REST); + FtpClearFlag(LINK,FTP_REST); FtpInit=OldInit; } @@ -459,7 +459,7 @@ Ftp_mget(ARGS) { FILE *list; char mode=LINK->mode; - + sprintf(tmp,"/tmp/uftplist-%s.XXXXXX",getpwuid(getuid())->pw_name); mktemp(tmp); @@ -487,10 +487,10 @@ Ftp_mget(ARGS) Ftp_mput(ARGS) { glob_t gl; - + glob(w2,GLOB_BRACE|GLOB_TILDE|GLOB_QUOTE, Ftp_mput_handler, &gl); - + while(gl.gl_matchc--) { Ftp_get("put",*gl.gl_pathv,"","","",""); @@ -501,51 +501,51 @@ Ftp_mput(ARGS) Ftp_bget(ARGS) { - + String fn,lfn; char *p; newframe(0); - + if (!FtpFullSyntax(w2,iftp[frame].host,iftp[frame].user, iftp[frame].pass,fn)) return puts("Filename syntax error"); - + strcpy(iftp[frame].pwd,"/"); - - if ((p=strrchr(fn,'/'))!=NULL) + + if ((p=strrchr(fn,'/'))!=NULL) strcpy(lfn,p+1); else strcpy(lfn,fn); - + FtpQuickBye(LINK); LINK=FtpCreateObject(); LINK->sock=NULL; - + Ftp_get("get",fn,(*w3==0)?lfn:w3,"","",""); } Ftp_bput(ARGS) { - + String fn,lfn; char *p; if (!FtpFullSyntax((*w3==0)?w2:w3,iftp[frame].host,iftp[frame].user, iftp[frame].pass,fn)) return puts("Filename syntax error"); - + strcpy(iftp[frame].pwd,"/"); - - if ((p=strrchr(fn,'/'))!=NULL) + + if ((p=strrchr(fn,'/'))!=NULL) strcpy(lfn,p+1); else strcpy(lfn,fn); - + FtpQuickBye(LINK); LINK=FtpCreateObject(); LINK->sock=NULL; - + Ftp_get("put",(*w3==0)?lfn:w2,fn,"","",""); } @@ -553,10 +553,10 @@ Ftp_copy(ARGS) { char *p; int in,out; - + if ( !*w2 || !*w3 ) return puts("Must pass two args"); - - if ((p=strchr(w2,'!'))!=NULL) + + if ((p=strchr(w2,'!'))!=NULL) { *p=0; in=atoi(w2); @@ -565,7 +565,7 @@ Ftp_copy(ARGS) else in=frame; - if ((p=strchr(w3,'!'))!=NULL) + if ((p=strchr(w3,'!'))!=NULL) { *p=0; out=atoi(w3); @@ -573,9 +573,9 @@ Ftp_copy(ARGS) } else in=frame; - + if (in==out) return puts("Files must been from different frames"); - + FtpCopy(ftp[in],ftp[out],w2,w3); } @@ -583,10 +583,10 @@ Ftp_ccopy(ARGS) { char *p; int in,out; - + if ( !*w2 || !*w3 ) return puts("Must pass two args"); - - if ((p=strchr(w2,'!'))!=NULL) + + if ((p=strchr(w2,'!'))!=NULL) { *p=0; in=atoi(w2); @@ -595,7 +595,7 @@ Ftp_ccopy(ARGS) else in=frame; - if ((p=strchr(w3,'!'))!=NULL) + if ((p=strchr(w3,'!'))!=NULL) { *p=0; out=atoi(w3); @@ -603,9 +603,9 @@ Ftp_ccopy(ARGS) } else in=frame; - + if (in==out) return puts("Files must been from different frames"); - + FtpPassiveTransfer(ftp[in],ftp[out],w2,w3); } @@ -628,17 +628,17 @@ Ftp_cd(ARGS) Ftp_dup(ARGS) -{ +{ LINKINFO oldinfo; FTP oldftp; - + oldinfo=iftp[frame]; oldftp=*LINK; - + newframe(0); puts("Make alternative connection..."); Ftp_open("",oldinfo.host,oldinfo.user,oldinfo.pass,"",""); - if (strcmp(oldinfo.pwd,iftp[frame].pwd)) + if (strcmp(oldinfo.pwd,iftp[frame].pwd)) Ftp_cd("",oldinfo.pwd,"","","",""); if (LINK->mode!=oldftp.mode) FtpType(LINK,oldftp.mode); @@ -649,23 +649,23 @@ Ftp_dup(ARGS) FtpSetIOHandler(LINK,oldftp.IO); FtpSetHashHandler(LINK,oldftp.hash); } - - + + Ftp_bg(ARGS) { if (fork()) { - + log("Backgrounding..."); return; } else { int i=frame; - + lastcmd=1; - + /* Ignoring keypad */ alarm (0); @@ -680,7 +680,7 @@ Ftp_bg(ARGS) /* Droping output */ - + sprintf(tmp,"/tmp/uftp-%s.XXXXXX",getpwuid(getuid())->pw_name); mktemp(tmp); close(0);close(1);close(2); @@ -693,21 +693,21 @@ Ftp_bg(ARGS) free(ftp[i]); ftp[i]=NULL; } - + return executev(w2,w3,w4,w5,w6,""); } } - + Ftp_list() { register int i; - -#define _FMT "%-5s %-15s %-10s %-25s %-7s %-4s\n" -#define FMT "%-5d %-15s %-10s %-25s %-7d %-4d\n" - + +#define _FMT "%-5s %-15s %-10s %-25s %-7s %-4s\n" +#define FMT "%-5d %-15s %-10s %-25s %-7d %-4d\n" + printf(_FMT,"Frame","Host name","User's name","Working directory","Timeout","Port"); - + for ( i = 0 ; i < NFRAMES ; i++ ) if (ftp[i]!=NULL) printf(FMT,i,iftp[i].host,iftp[i].user,iftp[i].pwd, @@ -739,10 +739,10 @@ Ftp_page(ARGS) { register char *pager; String out={'|',0}; - - if ((pager=(char *)getenv("PAGER"))==NULL) + + if ((pager=(char *)getenv("PAGER"))==NULL) pager="more"; - + strcat(out,pager); FtpGet(LINK,w2,out); } @@ -759,24 +759,24 @@ Ftp_rm(ARGS) sprintf(tmp,"/tmp/uftplist-%s.XXXXXX",getpwuid(getuid())->pw_name); mktemp(tmp); - - if (*w2==0) + + if (*w2==0) { log("Filename specification must present"); return; } - + FtpRetr(LINK,"NLST %s",w2,tmp); - + if ((list=fopen(tmp,"r"))==NULL) return FtpLog(tmp,sys_errlist[errno]); - + while ( fgets(tmp,sizeof tmp,list)!=NULL) { tmp[strlen(tmp)-1]=0; FtpCommand(LINK,"DELE %s",tmp,0,EOF); } - + fclose(list); } @@ -791,7 +791,7 @@ Ftp_move(ARGS) Ftp_help(ARGS) { register int i,ii; - + if ( !*w2 ) { puts("Warrning!!!! \nPlease read general information using command \"help etc\"\n\n"); @@ -806,7 +806,7 @@ Ftp_help(ARGS) putchar ('\n'); } } - + for ( i = 0 ; 1; i++) { @@ -817,13 +817,13 @@ Ftp_help(ARGS) } puts(cmds[i].help); - + } Ftp_quote(ARGS) { String new; - + new[0]=0; if (*w2!=0) strcpy(new,w2); @@ -838,8 +838,8 @@ Ftp_quote(ARGS) Ftp_alias(ARGS) { ALIAS *a=firstalias; - - + + if ( *w2==0 ) { while (a!=NULL) @@ -851,20 +851,20 @@ Ftp_alias(ARGS) } - while (1) + while (1) { if ( a == NULL ) - { + { firstalias = a = (ALIAS *) malloc(sizeof(ALIAS)); memset(a,0,sizeof(ALIAS)); a -> next = NULL; break; } - + if (!strcmp(a->name,w2)) break; - + if ( a->next == NULL) { a -> next = (ALIAS *) malloc(sizeof(ALIAS)); @@ -875,7 +875,7 @@ Ftp_alias(ARGS) } a=a->next; } - + strcpy(a -> name,w2); strcpy(a -> str,makestr(w3,w4,w5,w6,NULL)); } @@ -889,7 +889,7 @@ Ftp_mkalias(ARGS) sprintf(new,"open \"%s\" \"%s\" \"%s\" \"%s\"", iftp[frame].host,iftp[frame].user, iftp[frame].pass,iftp[frame].pwd); - + Ftp_alias("alias",w2,new,"","",""); } @@ -947,31 +947,31 @@ Ftp_acd(ARGS) static int targets=0; static String what={0}; static ARCHIE result[ARCHIE_MAX_TARGETS]; - + int i, selected_target; String tmp; char *p; - + if ( (what[0] == 0 || strcmp(w2,what) != 0) && *w2!=0 ) { - if ((targets=FtpArchie(w2,result,ARCHIE_MAX_TARGETS))<1) + if ((targets=FtpArchie(w2,result,ARCHIE_MAX_TARGETS))<1) return puts("Archie failure or target not found"); strcpy(what,w2); } - + for (i=0;i<targets;i++) printf("%2d %s:%s\n",i,result[i].host,result[i].file); - + if (strcmp(w1,"archie")==0) return; - - + + p = readline("Your selection? "); if (p==NULL) return; - + selected_target = atoi(p); - + if ( result[selected_target].file[strlen(result[selected_target].file)-1] == '/' ) { @@ -989,25 +989,25 @@ Ftp_acd(ARGS) CMDS cmds[]={ - + "connect", Ftp_connect, 0, "connect <hostname> - make new ftp connection", "open", Ftp_open, 0, "open <hostname> <user> <pass> <directory> - login to server", - + "reopen", Ftp_reopen, 1, "Open again connection with existing frame information", - + "ftp", Ftp_ftp, 0, "ftp <hostname> - anonymously login to server", - + "close", Ftp_close, 1, "Close connection", - + "quit", Ftp_quit, 0, "Exit from uftp", - + "set", Ftp_set, 0, "Set variables: (Without args print current settings)\n\ frame <number> - select another session(frame)\n\ @@ -1028,7 +1028,7 @@ CMDS cmds[]={ "prompt", NULL, 0, "\ -prompt is a string, which may be contains %<char> +prompt is a string, which may be contains %<char> or ^<char> combitanion, which have next interprets: %H, %h - full and short remote host names @@ -1038,8 +1038,8 @@ or ^<char> combitanion, which have next interprets: %D - local current directory %f - number of current frame %p - the ftp's port number -%t - timeout -%T - current time +%t - timeout +%T - current time %P - uftp process id %% - character % ^<char>- control character @@ -1114,7 +1114,7 @@ or ^<char> combitanion, which have next interprets: "bput", Ftp_bput, 0, "bput [<localfile>] <libftp_file> - full session procedure (See \"help etc\")", - + "copy", Ftp_copy, 1, "copy [<frame>!]file [<frame>!]file - copy file via client cache", @@ -1123,7 +1123,7 @@ or ^<char> combitanion, which have next interprets: "cat", Ftp_type, 1, "cat <file> - print body of remote file to screen", - + "page", Ftp_page, 1, "page <file> - print body of remote file to screen via pager", diff --git a/lib/libkvm/kvm.c b/lib/libkvm/kvm.c index 8eb0056acb9a..753d06a6017d 100644 --- a/lib/libkvm/kvm.c +++ b/lib/libkvm/kvm.c @@ -232,7 +232,7 @@ _kvm_open(kd, uf, mf, sf, flag, errout) * If the database cannot be opened, open the namelist * argument so we revert to slow nlist() calls. */ - if (kvm_dbopen(kd, uf) < 0 && + if (kvm_dbopen(kd, uf) < 0 && (kd->nlfd = open(uf, O_RDONLY, 0)) < 0) { _kvm_syserr(kd, kd->program, "%s", uf); goto failed; @@ -328,7 +328,7 @@ kvm_close(kd) /* * Set up state necessary to do queries on the kernel namelist - * data base. If the data base is out-of-data/incompatible with + * data base. If the data base is out-of-data/incompatible with * given executable, set up things so we revert to standard nlist call. * Only called for live kernels. Return 0 on success, -1 on failure. */ @@ -376,7 +376,7 @@ kvm_dbopen(kd, uf) if (rec.data == 0 || rec.size != sizeof(struct nlist)) goto close; bcopy((char *)rec.data, (char *)&nitem, sizeof(nitem)); - if (kvm_read(kd, (u_long)nitem.n_value, kversion, dbversionlen) != + if (kvm_read(kd, (u_long)nitem.n_value, kversion, dbversionlen) != dbversionlen) goto close; /* @@ -401,7 +401,7 @@ kvm_nlist(kd, nl) register int nvalid; /* - * If we can't use the data base, revert to the + * If we can't use the data base, revert to the * slow library call. */ if (kd->db == 0) @@ -432,10 +432,10 @@ kvm_nlist(kd, nl) * Avoid alignment issues. */ bcopy((char *)&((struct nlist *)rec.data)->n_type, - (char *)&p->n_type, + (char *)&p->n_type, sizeof(p->n_type)); bcopy((char *)&((struct nlist *)rec.data)->n_value, - (char *)&p->n_value, + (char *)&p->n_value, sizeof(p->n_value)); } /* @@ -475,7 +475,7 @@ kvm_read(kd, kva, buf, len) cp = buf; while (len > 0) { u_long pa; - + cc = _kvm_kvatop(kd, kva, &pa); if (cc == 0) return (0); diff --git a/lib/libkvm/kvm_amd64.c b/lib/libkvm/kvm_amd64.c index e944cedc635b..e8e3cf377baa 100644 --- a/lib/libkvm/kvm_amd64.c +++ b/lib/libkvm/kvm_amd64.c @@ -40,7 +40,7 @@ static char sccsid[] = "@(#)kvm_hp300.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ /* - * i386 machine dependent routines for kvm. Hopefully, the forthcoming + * i386 machine dependent routines for kvm. Hopefully, the forthcoming * vm code will one day obsolete this module. */ diff --git a/lib/libkvm/kvm_file.c b/lib/libkvm/kvm_file.c index 1e1d6bd60a3b..69e0aa30be60 100644 --- a/lib/libkvm/kvm_file.c +++ b/lib/libkvm/kvm_file.c @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)kvm_file.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ /* - * File list interface for kvm. pstat, fstat and netstat are + * File list interface for kvm. pstat, fstat and netstat are * users of this code, so we've factored it out into a separate module. * Thus, we keep this grunge out of the other kvm applications (i.e., * most other applications are interested only in open/close/read/nlist). diff --git a/lib/libkvm/kvm_hp300.c b/lib/libkvm/kvm_hp300.c index 2154a23f3007..c84691ee1b03 100644 --- a/lib/libkvm/kvm_hp300.c +++ b/lib/libkvm/kvm_hp300.c @@ -40,7 +40,7 @@ static char sccsid[] = "@(#)kvm_hp300.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ /* - * Hp300 machine dependent routines for kvm. Hopefully, the forthcoming + * Hp300 machine dependent routines for kvm. Hopefully, the forthcoming * vm code will one day obsolete this module. */ @@ -161,7 +161,7 @@ _kvm_vatop(kd, sta, va, pa) addr = (u_long)&sta[va >> SG4_SHIFT1]; /* * Can't use KREAD to read kernel segment table entries. - * Fortunately it is 1-to-1 mapped so we don't have to. + * Fortunately it is 1-to-1 mapped so we don't have to. */ if (sta == vm->Sysseg) { if (lseek(kd->pmfd, (off_t)addr, 0) == -1 || @@ -180,7 +180,7 @@ _kvm_vatop(kd, sta, va, pa) * Address from level 1 STE is a physical address, * so don't use kvm_read. */ - if (lseek(kd->pmfd, (off_t)(addr - lowram), 0) == -1 || + if (lseek(kd->pmfd, (off_t)(addr - lowram), 0) == -1 || read(kd->pmfd, (char *)&ste, sizeof(ste)) < 0) goto invalid; if ((ste & SG_V) == 0) { @@ -194,7 +194,7 @@ _kvm_vatop(kd, sta, va, pa) addr = (u_long)&sta[va >> SEGSHIFT]; /* * Can't use KREAD to read kernel segment table entries. - * Fortunately it is 1-to-1 mapped so we don't have to. + * Fortunately it is 1-to-1 mapped so we don't have to. */ if (sta == vm->Sysseg) { if (lseek(kd->pmfd, (off_t)addr, 0) == -1 || @@ -212,7 +212,7 @@ _kvm_vatop(kd, sta, va, pa) /* * Address from STE is a physical address so don't use kvm_read. */ - if (lseek(kd->pmfd, (off_t)(addr - lowram), 0) == -1 || + if (lseek(kd->pmfd, (off_t)(addr - lowram), 0) == -1 || read(kd->pmfd, (char *)&pte, sizeof(pte)) < 0) goto invalid; addr = pte & PG_FRAME; @@ -221,7 +221,7 @@ _kvm_vatop(kd, sta, va, pa) return (0); } *pa = addr - lowram + offset; - + return (NBPG - offset); invalid: _kvm_err(kd, 0, "invalid address (%x)", va); diff --git a/lib/libkvm/kvm_i386.c b/lib/libkvm/kvm_i386.c index e944cedc635b..e8e3cf377baa 100644 --- a/lib/libkvm/kvm_i386.c +++ b/lib/libkvm/kvm_i386.c @@ -40,7 +40,7 @@ static char sccsid[] = "@(#)kvm_hp300.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ /* - * i386 machine dependent routines for kvm. Hopefully, the forthcoming + * i386 machine dependent routines for kvm. Hopefully, the forthcoming * vm code will one day obsolete this module. */ diff --git a/lib/libkvm/kvm_mips.c b/lib/libkvm/kvm_mips.c index b0f4cfe31b7a..208798185b40 100644 --- a/lib/libkvm/kvm_mips.c +++ b/lib/libkvm/kvm_mips.c @@ -39,7 +39,7 @@ static char sccsid[] = "@(#)kvm_mips.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ /* - * MIPS machine dependent routines for kvm. Hopefully, the forthcoming + * MIPS machine dependent routines for kvm. Hopefully, the forthcoming * vm code will one day obsolete this module. */ @@ -146,7 +146,7 @@ _kvm_kvatop(kd, va, pa) addr = (u_long)(vm->Sysmap + ((va - VM_MIN_KERNEL_ADDRESS) >> PGSHIFT)); /* * Can't use KREAD to read kernel segment table entries. - * Fortunately it is 1-to-1 mapped so we don't have to. + * Fortunately it is 1-to-1 mapped so we don't have to. */ if (lseek(kd->pmfd, (off_t)addr, 0) < 0 || read(kd->pmfd, (char *)&pte, sizeof(pte)) < 0) diff --git a/lib/libkvm/kvm_proc.c b/lib/libkvm/kvm_proc.c index bc4952e688d2..6b29d4041e51 100644 --- a/lib/libkvm/kvm_proc.c +++ b/lib/libkvm/kvm_proc.c @@ -116,7 +116,7 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt) &eproc.e_ucred); switch(what) { - + case KERN_PROC_PID: if (proc.p_pid != (pid_t)arg) continue; @@ -154,7 +154,7 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt) eproc.e_pgid = pgrp.pg_id; eproc.e_jobc = pgrp.pg_jobc; if (KREAD(kd, (u_long)pgrp.pg_session, &sess)) { - _kvm_err(kd, kd->program, "can't read session at %x", + _kvm_err(kd, kd->program, "can't read session at %x", pgrp.pg_session); return (-1); } @@ -169,7 +169,7 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt) if (tty.t_pgrp != NULL) { if (KREAD(kd, (u_long)tty.t_pgrp, &pgrp)) { _kvm_err(kd, kd->program, - "can't read tpgrp at &x", + "can't read tpgrp at &x", tty.t_pgrp); return (-1); } @@ -182,7 +182,7 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt) if (sess.s_leader == p) eproc.e_flag |= EPROC_SLEADER; if (proc.p_wmesg) - (void)kvm_read(kd, (u_long)proc.p_wmesg, + (void)kvm_read(kd, (u_long)proc.p_wmesg, eproc.e_wmesg, WMESGLEN); #ifdef sparc @@ -207,7 +207,7 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt) break; case KERN_PROC_TTY: - if ((proc.p_flag & P_CONTROLT) == 0 || + if ((proc.p_flag & P_CONTROLT) == 0 || eproc.e_tdev != (dev_t)arg) continue; break; @@ -265,7 +265,7 @@ kvm_getprocs(kd, op, arg, cnt) if (kd->procbase != 0) { free((void *)kd->procbase); - /* + /* * Clear this pointer in case this call fails. Otherwise, * kvm_close() will free it again. */ @@ -361,7 +361,7 @@ _kvm_realloc(kd, p, n) /* * Read in an argument vector from the user address space of process p. - * addr is the user-space base address of narg null-terminated contiguous + * addr is the user-space base address of narg null-terminated contiguous * strings. This is used to read in both the command arguments and * environment strings. Read at most maxcnt characters of strings. */ @@ -389,13 +389,13 @@ kvm_argv(kd, p, addr, narg, maxcnt) * Try to avoid reallocs. */ kd->argc = MAX(narg + 1, 32); - kd->argv = (char **)_kvm_malloc(kd, kd->argc * + kd->argv = (char **)_kvm_malloc(kd, kd->argc * sizeof(*kd->argv)); if (kd->argv == 0) return (0); } else if (narg + 1 > kd->argc) { kd->argc = MAX(2 * kd->argc, narg + 1); - kd->argv = (char **)_kvm_realloc(kd, kd->argv, kd->argc * + kd->argv = (char **)_kvm_realloc(kd, kd->argv, kd->argc * sizeof(*kd->argv)); if (kd->argv == 0) return (0); @@ -505,7 +505,7 @@ proc_verify(kd, kernp, p) * Just read in the whole proc. It's not that big relative * to the cost of the read system call. */ - if (kvm_read(kd, kernp, (char *)&kernproc, sizeof(kernproc)) != + if (kvm_read(kd, kernp, (char *)&kernproc, sizeof(kernproc)) != sizeof(kernproc)) return (0); return (p->p_pid == kernproc.p_pid && @@ -528,7 +528,7 @@ kvm_doargv(kd, kp, nchr, info) /* * Pointers are stored at the top of the user stack. */ - if (p->p_stat == SZOMB || + if (p->p_stat == SZOMB || kvm_uread(kd, p, USRSTACK - sizeof(arginfo) - SPARE_USRSPACE, (char *)&arginfo, sizeof(arginfo)) != sizeof(arginfo)) return (0); @@ -592,7 +592,7 @@ kvm_uread(kd, p, uva, buf, len) return (0); } - + while (len > 0) { if (lseek(fd, (off_t)uva, 0) == -1 && errno != 0) { _kvm_err(kd, kd->program, "invalid address (%x) in %s", uva, procfile); diff --git a/lib/libkvm/kvm_sparc.c b/lib/libkvm/kvm_sparc.c index 5275068b6ea3..a7b9594841b6 100644 --- a/lib/libkvm/kvm_sparc.c +++ b/lib/libkvm/kvm_sparc.c @@ -40,7 +40,7 @@ static char sccsid[] = "@(#)kvm_sparc.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ /* - * Sparc machine dependent routines for kvm. Hopefully, the forthcoming + * Sparc machine dependent routines for kvm. Hopefully, the forthcoming * vm code will one day obsolete this module. */ @@ -107,7 +107,7 @@ _kvm_initvtop(kd) */ off = st.st_size - ctob(btoc(sizeof(vm->segmap))); errno = 0; - if (lseek(kd->pmfd, (off_t)off, 0) == -1 && errno != 0 || + if (lseek(kd->pmfd, (off_t)off, 0) == -1 && errno != 0 || read(kd->pmfd, (char *)vm->segmap, sizeof(vm->segmap)) < 0) { _kvm_err(kd, kd->program, "cannot read segment map"); return (-1); @@ -118,7 +118,7 @@ _kvm_initvtop(kd) off = st.st_size - ctob(btoc(sizeof(vm->pmeg)) + btoc(sizeof(vm->segmap))); errno = 0; - if (lseek(kd->pmfd, (off_t)off, 0) == -1 && errno != 0 || + if (lseek(kd->pmfd, (off_t)off, 0) == -1 && errno != 0 || read(kd->pmfd, (char *)vm->pmeg, sizeof(vm->pmeg)) < 0) { _kvm_err(kd, kd->program, "cannot read PMEG table"); return (-1); @@ -127,7 +127,7 @@ _kvm_initvtop(kd) * Make pmap_stod be an identity map so we can bootstrap it in. * We assume it's in the first contiguous chunk of physical memory. */ - for (i = 0; i < BTSIZE; ++i) + for (i = 0; i < BTSIZE; ++i) vm->pmap_stod[i] = i << 4; /* @@ -142,7 +142,7 @@ _kvm_initvtop(kd) _kvm_err(kd, kd->program, "pmap_stod: no such symbol"); return (-1); } - if (kvm_read(kd, (u_long)nlist[0].n_value, + if (kvm_read(kd, (u_long)nlist[0].n_value, (char *)vm->pmap_stod, sizeof(vm->pmap_stod)) != sizeof(vm->pmap_stod)) { _kvm_err(kd, kd->program, "cannot read pmap_stod"); @@ -194,7 +194,7 @@ _kvm_uvatop(kd, p, va, pa) frame = pte & PG_PFNUM; else frame = HWTOSW(kd->vmst->pmap_stod, pte & PG_PFNUM); - *pa = (frame << PGSHIFT) | off; + *pa = (frame << PGSHIFT) | off; return (NBPG - off); } invalid: @@ -205,7 +205,7 @@ invalid: /* * Translate a kernel virtual address to a physical address using the * mapping information in kd->vm. Returns the result in pa, and returns - * the number of bytes that are contiguously available from this + * the number of bytes that are contiguously available from this * physical address. This routine is used only for crashdumps. */ int diff --git a/lib/libm/common/atan2.c b/lib/libm/common/atan2.c index 958a15472603..b847a1d36623 100644 --- a/lib/libm/common/atan2.c +++ b/lib/libm/common/atan2.c @@ -38,21 +38,21 @@ static char sccsid[] = "@(#)atan2.c 8.1 (Berkeley) 6/4/93"; /* ATAN2(Y,X) * RETURN ARG (X+iY) * DOUBLE PRECISION (VAX D format 56 bits, IEEE DOUBLE 53 BITS) - * CODED IN C BY K.C. NG, 1/8/85; + * CODED IN C BY K.C. NG, 1/8/85; * REVISED BY K.C. NG on 2/7/85, 2/13/85, 3/7/85, 3/30/85, 6/29/85. * * Required system supported functions : * copysign(x,y) * scalb(x,y) * logb(x) - * + * * Method : * 1. Reduce y to positive by atan2(y,x)=-atan2(-y,x). - * 2. Reduce x to positive by (if x and y are unexceptional): + * 2. Reduce x to positive by (if x and y are unexceptional): * ARG (x+iy) = arctan(y/x) ... if x > 0, * ARG (x+iy) = pi - arctan[y/(-x)] ... if x < 0, - * 3. According to the integer k=4t+0.25 truncated , t=y/x, the argument - * is further reduced to one of the following intervals and the + * 3. According to the integer k=4t+0.25 truncated , t=y/x, the argument + * is further reduced to one of the following intervals and the * arctangent of y/x is evaluated by the corresponding formula: * * [0,7/16] atan(y/x) = t - t^3*(a1+t^2*(a2+...(a10+t^2*a11)...) @@ -76,32 +76,32 @@ static char sccsid[] = "@(#)atan2.c 8.1 (Berkeley) 6/4/93"; * ARG( (anything but,0,NaN, and INF),+-INF ) is +-PI/2; * * Accuracy: - * atan2(y,x) returns (PI/pi) * the exact ARG (x+iy) nearly rounded, + * atan2(y,x) returns (PI/pi) * the exact ARG (x+iy) nearly rounded, * where * * in decimal: - * pi = 3.141592653589793 23846264338327 ..... + * pi = 3.141592653589793 23846264338327 ..... * 53 bits PI = 3.141592653589793 115997963 ..... , - * 56 bits PI = 3.141592653589793 227020265 ..... , + * 56 bits PI = 3.141592653589793 227020265 ..... , * * in hexadecimal: * pi = 3.243F6A8885A308D313198A2E.... * 53 bits PI = 3.243F6A8885A30 = 2 * 1.921FB54442D18 error=.276ulps * 56 bits PI = 3.243F6A8885A308 = 4 * .C90FDAA22168C2 error=.206ulps - * + * * In a test run with 356,000 random argument on [-1,1] * [-1,1] on a * VAX, the maximum observed error was 1.41 ulps (units of the last place) * compared with (PI/pi)*(the exact ARG(x+iy)). * * Note: * We use machine PI (the true pi rounded) in place of the actual - * value of pi for all the trig and inverse trig functions. In general, - * if trig is one of sin, cos, tan, then computed trig(y) returns the - * exact trig(y*pi/PI) nearly rounded; correspondingly, computed arctrig - * returns the exact arctrig(y)*PI/pi nearly rounded. These guarantee the + * value of pi for all the trig and inver |