#ifndef lint
static const char rcsid[] =
- "$Id: dumprmt.c,v 1.19 2002/01/16 09:32:14 stelian Exp $";
+ "$Id: dumprmt.c,v 1.20 2002/01/25 15:08:59 stelian Exp $";
#endif /* not lint */
#include <config.h>
static int
rmtgetconn(void)
{
- register char *cp;
- register const char *rmt;
+ char *cp;
+ const char *rmt;
static struct servent *sp = NULL;
static struct passwd *pwd = NULL;
const char *tuser;
static int
okname(const char *cp0)
{
- register const char *cp;
- register int c;
+ const char *cp;
+ int c;
for (cp = cp0; *cp; cp++) {
c = *cp;
struct mtget *
rmtstatus(void)
{
- register int i;
- register char *cp;
+ int i;
+ char *cp;
if (rmtstate != TS_OPEN)
return (NULL);
static int
rmtreply(const char *cmd)
{
- register char *cp;
+ char *cp;
char code[30], emsg[BUFSIZ];
rmtgets(code, sizeof (code));
static void
rmtgets(char *line, size_t len)
{
- register char *cp = line;
+ char *cp = line;
while (len > 1) {
*cp = rmtgetb();
#ifndef lint
static const char rcsid[] =
- "$Id: compatglob.c,v 1.7 2002/01/16 09:32:14 stelian Exp $";
+ "$Id: compatglob.c,v 1.8 2002/01/25 15:08:59 stelian Exp $";
#endif /* not lint */
#include <config.h>
static int
glob3(Char *pathbuf, Char *pathend, Char *pattern, Char *restpattern, glob_t *pglob)
{
- register struct dirent *dp;
+ struct dirent *dp;
DIR *dirp;
int err;
char buf[MAXPATHLEN];
else
readdirfunc = readdir;
while ((dp = (*readdirfunc)(dirp))) {
- register u_char *sc;
- register Char *dc;
+ u_char *sc;
+ Char *dc;
/* Initial DOT must be matched literally. */
if (dp->d_name[0] == DOT && *pattern != DOT)
static int
globextend(const Char *path, glob_t *pglob)
{
- register char **pathv;
- register int i;
+ char **pathv;
+ int i;
u_int newsize;
char *copy;
const Char *p;
void
globfree(glob_t *pglob)
{
- register int i;
- register char **pp;
+ int i;
+ char **pp;
if (pglob->gl_pathv != NULL) {
pp = pglob->gl_pathv + pglob->gl_offs;
static void
g_Ctoc(const Char *str, char *buf)
{
- register char *dc;
+ char *dc;
for (dc = buf; (*dc++ = *str++) != EOS;)
continue;
static void
qprintf(const char *str, Char *s)
{
- register Char *p;
+ Char *p;
(void)printf("%s:\n", str);
for (p = s; *p; p++)
#ifndef lint
static const char rcsid[] =
- "$Id: fstab.c,v 1.12 2002/01/16 09:32:14 stelian Exp $";
+ "$Id: fstab.c,v 1.13 2002/01/25 15:08:59 stelian Exp $";
#endif /* not lint */
#include <config.h>
int fstabscan(void)
{
struct mntent *mnt;
- register char *cp;
+ char *cp;
int typexx;
#define MAXLINELENGTH 1024
char subline[MAXLINELENGTH];
#ifndef lint
static const char rcsid[] =
- "$Id: itime.c,v 1.21 2002/01/16 09:32:14 stelian Exp $";
+ "$Id: itime.c,v 1.22 2002/01/25 15:08:59 stelian Exp $";
#endif /* not lint */
#include <config.h>
static void
readdumptimes(FILE *df)
{
- register int i;
- register struct dumptime *dtwalk;
+ int i;
+ struct dumptime *dtwalk;
for (;;) {
dtwalk = (struct dumptime *)calloc(1, sizeof (struct dumptime));
void
getdumptime(int createdumpdates)
{
- register struct dumpdates *ddp;
- register int i;
+ struct dumpdates *ddp;
+ int i;
#ifdef FDEBUG
msg("Looking for name %s in dumpdates = %s for level = %c\n",
putdumptime(void)
{
FILE *df;
- register struct dumpdates *dtwalk;
- register int i;
+ struct dumpdates *dtwalk;
+ int i;
int fd;
if(uflag == 0)
#ifndef lint
static const char rcsid[] =
- "$Id: main.c,v 1.67 2002/01/25 14:59:53 stelian Exp $";
+ "$Id: main.c,v 1.68 2002/01/25 15:08:59 stelian Exp $";
#endif /* not lint */
#include <config.h>
int
main(int argc, char *argv[])
{
- register dump_ino_t ino;
- register int dirty;
- register struct dinode *dp;
- register struct fstab *dt;
- register char *map;
- register int ch;
+ dump_ino_t ino;
+ int dirty;
+ struct dinode *dp;
+ struct fstab *dt;
+ char *map;
+ int ch;
int i, anydirskipped;
int aflag = 0, bflag = 0, Tflag = 0, honorlevel = 1;
dump_ino_t maxino;
#endif
time_t tnow;
char *diskparam;
- char *Apath;
+ char *Apath = NULL;
spcl.c_label[0] = '\0';
spcl.c_date = time(NULL);
#ifndef lint
static const char rcsid[] =
- "$Id: optr.c,v 1.29 2002/01/16 09:32:14 stelian Exp $";
+ "$Id: optr.c,v 1.30 2002/01/25 15:08:59 stelian Exp $";
#endif /* not lint */
#include <config.h>
sendmes(const char *tty, const char *message)
{
char t[MAXPATHLEN], buf[BUFSIZ];
- register const char *cp;
+ const char *cp;
int lmsg = 1;
FILE *f_tty;
static struct fstab *
allocfsent(struct fstab *fs)
{
- register struct fstab *new;
+ struct fstab *new;
new = (struct fstab *)malloc(sizeof (*fs));
if (new == NULL)
struct fstab *
fstabsearch(const char *key)
{
- register struct pfstab *pf;
- register struct fstab *fs;
+ struct pfstab *pf;
+ struct fstab *fs;
const char *rn;
for (pf = table; pf != NULL; pf = pf->pf_next) {
struct fstab *
fstabsearchdir(const char *key, char *directory)
{
- register struct pfstab *pf;
- register struct fstab *fs;
- register struct fstab *found_fs = NULL;
+ struct pfstab *pf;
+ struct fstab *fs;
+ struct fstab *found_fs = NULL;
unsigned int size = 0;
struct stat buf;
#ifndef lint
static const char rcsid[] =
- "$Id: tape.c,v 1.61 2002/01/25 14:59:53 stelian Exp $";
+ "$Id: tape.c,v 1.62 2002/01/25 15:08:59 stelian Exp $";
#endif /* not lint */
#include <config.h>
void
rollforward(void)
{
- register struct req *p, *q = NULL, *prev;
- register struct slave *tslp;
+ struct req *p, *q = NULL, *prev;
+ struct slave *tslp;
int i, size, savedtapea, got;
union u_spcl *ntb, *otb;
struct slave_results returned;
#ifdef LINUX_FORK_BUG
int i, j;
#else
- register int i, j;
+ int i, j;
#endif
master = getpid();
void
killall(void)
{
- register int i;
+ int i;
for (i = 0; i < SLAVES; i++)
if (slaves[i].pid > 0) {
static void
doslave(int cmd, int slave_number, int first)
{
- register int nread;
+ int nread;
int nextslave, size, eot_count, bufsize;
volatile int wrote = 0;
char *buffer;
* Get list of blocks to dump, read the blocks into tape buffer
*/
while ((nread = atomic_read( cmd, (char *)slp->req, reqsiz)) == reqsiz) {
- register struct req *p = slp->req;
+ struct req *p = slp->req;
for (trecno = 0; trecno < ntrec;
trecno += p->count, p += p->count) {
#ifndef lint
static const char rcsid[] =
- "$Id: traverse.c,v 1.41 2002/01/25 14:59:53 stelian Exp $";
+ "$Id: traverse.c,v 1.42 2002/01/25 15:08:59 stelian Exp $";
#endif /* not lint */
#include <config.h>
static void
mapfileino(dump_ino_t ino, struct dinode const *dp, long *tapesize, int *dirskipped)
{
- register int mode;
+ int mode;
/*
* Skip inode if we've already marked it for dumping
int
mapfiles(dump_ino_t maxino, long *tapesize)
{
- register dump_ino_t ino;
+ dump_ino_t ino;
int anydirskipped = 0;
for (ino = ROOTINO; ino < maxino; ino++)
static int
mapfilesindir(struct ext2_dir_entry *dirent, int offset, int blocksize, char *buf, void *private)
{
- register struct dinode const *dp;
- register int mode;
+ struct dinode const *dp;
+ int mode;
errcode_t retval;
struct mapfile_context *mfc;
ext2_ino_t ino;
int
mapdirs(dump_ino_t maxino, long *tapesize)
{
- register struct dinode *dp;
- register int isdir;
- register char *map;
- register dump_ino_t ino;
+ struct dinode *dp;
+ int isdir;
+ char *map;
+ dump_ino_t ino;
#ifndef __linux__
- register int i;
+ int i;
long filesize;
#else
struct mapdirs_context mdc;
dirindir(dump_ino_t ino, daddr_t blkno, int ind_level, long *filesize)
{
int ret = 0;
- register int i;
+ int i;
daddr_t idblk[MAXNINDIR];
bread(fsbtodb(sblock, blkno), (char *)idblk, (int)sblock->fs_bsize);
static int
searchdir(dump_ino_t ino, daddr_t blkno, long size, long filesize)
{
- register struct direct *dp;
- register long loc, ret = 0;
+ struct direct *dp;
+ long loc, ret = 0;
char dblk[MAXBSIZE];
bread(fsbtodb(sblock, blkno), dblk, (int)size);
void
blksout(daddr_t *blkp, int frags, dump_ino_t ino)
{
- register daddr_t *bp;
+ daddr_t *bp;
int i, j, count, blks, tbperdb;
blks = howmany(frags * sblock->fs_fsize, TP_BSIZE);
void
dumpmap(char *map, int type, dump_ino_t ino)
{
- register int i;
+ int i;
char *cp;
spcl.c_type = type;
#ifndef lint
static const char rcsid[] =
- "$Id: unctime.c,v 1.13 2002/01/16 09:32:14 stelian Exp $";
+ "$Id: unctime.c,v 1.14 2002/01/25 15:08:59 stelian Exp $";
#endif /* not lint */
#include <config.h>
static int
lookup(const char *str)
{
- register const char *cp, *cp2;
+ const char *cp, *cp2;
for (cp = months, cp2 = str; *cp != '\0'; cp += 3)
if (strncmp(cp, cp2, 3) == 0)
#ifndef lint
static const char rcsid[] =
- "$Id: dirs.c,v 1.16 2002/01/16 09:32:14 stelian Exp $";
+ "$Id: dirs.c,v 1.17 2002/01/25 15:08:59 stelian Exp $";
#endif /* not lint */
#include <config.h>
void
extractdirs(int genmode)
{
- register int i;
+ int i;
#ifdef __linux__
- register struct new_bsd_inode *ip;
+ struct new_bsd_inode *ip;
#else
- register struct dinode *ip;
+ struct dinode *ip;
#endif
struct inotab *itp;
struct direct nulldir;
void
treescan(char *pname, dump_ino_t ino, long (*todo) __P((char *, dump_ino_t, int)))
{
- register struct inotab *itp;
- register struct direct *dp;
+ struct inotab *itp;
+ struct direct *dp;
int namelen;
long bpt;
char locname[MAXPATHLEN + 1];
static struct direct *
searchdir(dump_ino_t inum, char *name)
{
- register struct direct *dp;
- register struct inotab *itp;
+ struct direct *dp;
+ struct inotab *itp;
int len;
itp = inotablookup(inum);
putdir(char *buf, size_t size)
{
struct direct cvtbuf;
- register struct odirect *odp;
+ struct odirect *odp;
struct odirect *eodp;
- register struct direct *dp;
+ struct direct *dp;
long loc, i;
if (cvtflag) {
struct direct *
rst_readdir(RST_DIR *dirp)
{
- register struct direct *dp;
+ struct direct *dp;
for (;;) {
if (dirp->dd_loc == 0) {
static RST_DIR *
opendirfile(const char *name)
{
- register RST_DIR *dirp;
- register int fd;
+ RST_DIR *dirp;
+ int fd;
if ((fd = open(name, O_RDONLY)) == -1)
return (NULL);
int
genliteraldir(char *name, dump_ino_t ino)
{
- register struct inotab *itp;
+ struct inotab *itp;
int ofile, dp, i, size;
char buf[BUFSIZ];
allocinotab(dump_ino_t ino, struct dinode *dip, long seekpt)
#endif
{
- register struct inotab *itp;
+ struct inotab *itp;
struct modeinfo node;
itp = calloc(1, sizeof(struct inotab));
static struct inotab *
inotablookup(dump_ino_t ino)
{
- register struct inotab *itp;
+ struct inotab *itp;
for (itp = inotab[INOHASH(ino)]; itp != NULL; itp = itp->t_next)
if (itp->t_ino == ino)
#ifndef lint
static const char rcsid[] =
- "$Id: interactive.c,v 1.20 2002/01/25 14:59:53 stelian Exp $";
+ "$Id: interactive.c,v 1.21 2002/01/25 15:08:59 stelian Exp $";
#endif /* not lint */
#include <config.h>
void
runcmdshell(void)
{
- register struct entry *np;
+ struct entry *np;
dump_ino_t ino;
struct arglist arglist;
char curdir[MAXPATHLEN];
static void
getcmd(char *curdir, char *cmd, char *name, int size, struct arglist *ap)
{
- register char *cp;
+ char *cp;
static char input[BUFSIZ];
char output[BUFSIZ];
# define rawname input /* save space by reusing input buffer */
static char *
copynext(char *input, char *output)
{
- register char *cp, *bp;
+ char *cp, *bp;
char quote;
for (cp = input; *cp == ' ' || *cp == '\t'; cp++)
void
canon(char *rawname, char *canonname, int len)
{
- register char *cp, *np;
+ char *cp, *np;
if (strcmp(rawname, ".") == 0 || strncmp(rawname, "./", 2) == 0)
(void) strcpy(canonname, "");
static void
printlist(char *name, char *basename)
{
- register struct afile *fp, *list, *listp = NULL;
- register struct direct *dp;
+ struct afile *fp, *list, *listp = NULL;
+ struct direct *dp;
struct afile single;
RST_DIR *dirp;
int entries, len, namelen;
static void
formatf(struct afile *list, int nentry)
{
- register struct afile *fp, *endlist;
+ struct afile *fp, *endlist;
int width, bigino, haveprefix, havepostfix;
int i, j, w, precision = 0, columns, lines;
static int
glob_stat(const char *name, struct stat *stp)
{
- register struct direct *dp;
+ struct direct *dp;
dp = pathsearch(name);
if (dp == NULL || (!dflag && TSTINO(dp->d_ino, dumpmap) == 0) ||
(!vflag && dp->d_ino == WINO))
#ifndef lint
static const char rcsid[] =
- "$Id: restore.c,v 1.25 2002/01/25 14:59:53 stelian Exp $";
+ "$Id: restore.c,v 1.26 2002/01/25 15:08:59 stelian Exp $";
#endif /* not lint */
#include <config.h>
long
addfile(char *name, dump_ino_t ino, int type)
{
- register struct entry *ep, *np;
+ struct entry *ep, *np;
long descend = hflag ? GOOD : FAIL;
char buf[100];
void
removeoldleaves(void)
{
- register struct entry *ep, *nextep;
- register dump_ino_t i, mydirino;
+ struct entry *ep, *nextep;
+ dump_ino_t i, mydirino;
Vprintf(stdout, "Mark entries to be removed.\n");
if ((ep = lookupino(WINO))) {
long
nodeupdates(char *name, dump_ino_t ino, int type)
{
- register struct entry *ep, *np, *ip;
+ struct entry *ep, *np, *ip;
long descend = GOOD;
int lookuptype = 0;
int key = 0;
void
findunreflinks(void)
{
- register struct entry *ep, *np;
- register dump_ino_t i;
+ struct entry *ep, *np;
+ dump_ino_t i;
Vprintf(stdout, "Find unreferenced names.\n");
for (i = ROOTINO; i < maxino; i++) {
void
removeoldnodes(void)
{
- register struct entry *ep, **prev;
+ struct entry *ep, **prev;
long change;
Vprintf(stdout, "Remove old nodes (directories).\n");
void
compareleaves(void)
{
- register struct entry *ep;
+ struct entry *ep;
dump_ino_t first;
long curvol;
void
createleaves(char *symtabfile)
{
- register struct entry *ep;
+ struct entry *ep;
dump_ino_t first;
long curvol;
void
createfiles(void)
{
- register dump_ino_t first, next, last;
- register struct entry *ep;
+ dump_ino_t first, next, last;
+ struct entry *ep;
long curvol;
#ifdef USE_QFA
long tnum, tmpcnt;
void
createlinks(void)
{
- register struct entry *np, *ep;
- register dump_ino_t i;
+ struct entry *np, *ep;
+ dump_ino_t i;
char name[BUFSIZ];
if ((ep = lookupino(WINO))) {
void
checkrestore(void)
{
- register struct entry *ep;
- register dump_ino_t i;
+ struct entry *ep;
+ dump_ino_t i;
Vprintf(stdout, "Check the symbol table.\n");
for (i = WINO; i < maxino; i++) {
#ifndef lint
static const char rcsid[] =
- "$Id: symtab.c,v 1.17 2002/01/16 09:32:14 stelian Exp $";
+ "$Id: symtab.c,v 1.18 2002/01/25 15:09:00 stelian Exp $";
#endif /* not lint */
/*
struct entry *
lookupino(dump_ino_t inum)
{
- register struct entry *ep;
+ struct entry *ep;
if (inum < WINO || inum >= maxino)
return (NULL);
void
deleteino(dump_ino_t inum)
{
- register struct entry *next;
+ struct entry *next;
struct entry **prev;
if (inum < WINO || inum >= maxino)
struct entry *
lookupname(char *name)
{
- register struct entry *ep;
- register char *np, *cp;
+ struct entry *ep;
+ char *np, *cp;
char buf[MAXPATHLEN];
cp = name;
char *
myname(struct entry *ep)
{
- register char *cp;
+ char *cp;
static char namebuf[MAXPATHLEN];
for (cp = &namebuf[MAXPATHLEN - 2]; cp > &namebuf[ep->e_namlen]; ) {
struct entry *
addentry(char *name, dump_ino_t inum, int type)
{
- register struct entry *np, *ep;
+ struct entry *np, *ep;
if (freelist != NULL) {
np = freelist;
void
freeentry(struct entry *ep)
{
- register struct entry *np;
+ struct entry *np;
dump_ino_t inum;
if (ep->e_flags != REMOVED)
static void
removeentry(struct entry *ep)
{
- register struct entry *np;
+ struct entry *np;
np = ep->e_parent;
if (np->e_entries == ep) {
void
dumpsymtable(char *filename, long checkpt)
{
- register struct entry *ep, *tep;
- register dump_ino_t i;
+ struct entry *ep, *tep;
+ dump_ino_t i;
struct entry temp, *tentry;
long mynum = 1, stroff = 0;
FILE *fd;
{
char *base;
long tblsize;
- register struct entry *ep;
+ struct entry *ep;
struct entry *baseep, *lep;
struct symtableheader hdr;
struct stat stbuf;
- register long i;
+ long i;
int fd;
Vprintf(stdout, "Initialize symbol table.\n");
#ifndef lint
static const char rcsid[] =
- "$Id: tape.c,v 1.55 2002/01/25 14:59:53 stelian Exp $";
+ "$Id: tape.c,v 1.56 2002/01/25 15:09:00 stelian Exp $";
#endif /* not lint */
#include <config.h>
void
getfile(void (*fill) __P((char *, size_t)), void (*skip) __P((char *, size_t)))
{
- register int i;
+ int i;
volatile int curblk = 0;
volatile quad_t size = spcl.c_dinode.di_size;
volatile int last_write_was_hole = 0;
static int
checksum(int *buf)
{
- register int i, j;
+ int i, j;
j = sizeof(union u_spcl) / sizeof(int);
i = 0;
#ifndef lint
static const char rcsid[] =
- "$Id: utilities.c,v 1.18 2002/01/25 14:59:53 stelian Exp $";
+ "$Id: utilities.c,v 1.19 2002/01/25 15:09:00 stelian Exp $";
#endif /* not lint */
#include <config.h>
void
pathcheck(char *name)
{
- register char *cp;
+ char *cp;
struct entry *ep;
char *start;
dump_ino_t
lowerbnd(dump_ino_t start)
{
- register struct entry *ep;
+ struct entry *ep;
for ( ; start < maxino; start++) {
ep = lookupino(start);
dump_ino_t
upperbnd(dump_ino_t start)
{
- register struct entry *ep;
+ struct entry *ep;
for ( ; start > ROOTINO; start--) {
ep = lookupino(start);