X-Git-Url: https://git.wh0rd.org/?p=dump.git;a=blobdiff_plain;f=restore%2Fsymtab.c;h=99312acaeb83a3172d4ebabd41933bab690a78a1;hp=abf8d7ae6fca904e02cf3c55e96cdd0ad20a92e2;hb=5d2a3d246d400d45dfd4c49ddb588c69fb60873d;hpb=a1b67fc50f87e9febfd56bd2a7089eb569b852f6 diff --git a/restore/symtab.c b/restore/symtab.c index abf8d7a..99312ac 100644 --- a/restore/symtab.c +++ b/restore/symtab.c @@ -2,8 +2,8 @@ * Ported to Linux's Second Extended File System as part of the * dump and restore backup suit * Remy Card , 1994-1997 - * Stelian Pop , 1999-2000 - * Stelian Pop - Alcôve , 2000 + * Stelian Pop , 1999-2000 + * Stelian Pop - Alcôve , 2000-2002 */ /* @@ -41,7 +41,7 @@ #ifndef lint static const char rcsid[] = - "$Id: symtab.c,v 1.13 2001/03/20 10:02:48 stelian Exp $"; + "$Id: symtab.c,v 1.18 2002/01/25 15:09:00 stelian Exp $"; #endif /* not lint */ /* @@ -59,7 +59,12 @@ static const char rcsid[] = #ifdef __linux__ #include +#include +#ifdef HAVE_EXT2FS_EXT2_FS_H +#include +#else #include +#endif #include #else /* __linux__ */ #include @@ -101,7 +106,7 @@ static void removeentry __P((struct entry *)); struct entry * lookupino(dump_ino_t inum) { - register struct entry *ep; + struct entry *ep; if (inum < WINO || inum >= maxino) return (NULL); @@ -137,7 +142,7 @@ addino(dump_ino_t inum, struct entry *np) void deleteino(dump_ino_t inum) { - register struct entry *next; + struct entry *next; struct entry **prev; if (inum < WINO || inum >= maxino) @@ -160,8 +165,8 @@ deleteino(dump_ino_t inum) struct entry * lookupname(char *name) { - register struct entry *ep; - register char *np, *cp; + struct entry *ep; + char *np, *cp; char buf[MAXPATHLEN]; cp = name; @@ -211,7 +216,7 @@ lookupparent(char *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]; ) { @@ -238,7 +243,7 @@ static struct entry *freelist = NULL; 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; @@ -286,7 +291,7 @@ addentry(char *name, dump_ino_t inum, int type) void freeentry(struct entry *ep) { - register struct entry *np; + struct entry *np; dump_ino_t inum; if (ep->e_flags != REMOVED) @@ -357,7 +362,7 @@ moveentry(struct entry *ep, char *newname) static void removeentry(struct entry *ep) { - register struct entry *np; + struct entry *np; np = ep->e_parent; if (np->e_entries == ep) { @@ -448,6 +453,7 @@ struct symtableheader { time_t dumpdate; dump_ino_t maxino; int32_t ntrec; + int32_t zflag; }; /* @@ -456,8 +462,8 @@ struct symtableheader { 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; @@ -526,6 +532,7 @@ dumpsymtable(char *filename, long checkpt) hdr.dumptime = dumptime; hdr.dumpdate = dumpdate; hdr.ntrec = ntrec; + hdr.zflag = zflag; (void) fwrite((char *)&hdr, sizeof(struct symtableheader), 1, fd); if (ferror(fd)) { warn("fwrite"); @@ -543,11 +550,11 @@ initsymtable(char *filename) { 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"); @@ -595,6 +602,7 @@ initsymtable(char *filename) curfile.action = SKIP; dumptime = hdr.dumptime; dumpdate = hdr.dumpdate; + zflag = hdr.zflag; if (!bflag) newtapebuf(hdr.ntrec); getvol(hdr.volno);