install correct aliases file
[unix-history] / usr / src / sbin / restore / restore.h
index 3d34175..34b3fa7 100644 (file)
@@ -1,19 +1,37 @@
-/* Copyright (c) 1983 Regents of the University of California */
-
-/*     @(#)restore.h   3.2     (Berkeley)      83/02/26        */
+/*
+ * Copyright (c) 1983 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley.  The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ *     @(#)restore.h   5.3 (Berkeley) %G%
+ */
 
 #include <stdio.h>
 #include <sys/param.h>
 #include <sys/inode.h>
 #include <sys/fs.h>
 
 #include <stdio.h>
 #include <sys/param.h>
 #include <sys/inode.h>
 #include <sys/fs.h>
+#include <sys/dir.h>
 
 /*
  * Flags
  */
 extern int     cvtflag;        /* convert from old to new tape format */
 
 /*
  * Flags
  */
 extern int     cvtflag;        /* convert from old to new tape format */
+extern int     bflag;          /* set input block size */
 extern int     dflag;          /* print out debugging info */
 extern int     hflag;          /* restore heirarchies */
 extern int     mflag;          /* restore by name instead of inode number */
 extern int     dflag;          /* print out debugging info */
 extern int     hflag;          /* restore heirarchies */
 extern int     mflag;          /* restore by name instead of inode number */
+extern int     Nflag;          /* do not write the disk */
 extern int     vflag;          /* print out actions taken */
 extern int     yflag;          /* always try to recover from tape errors */
 /*
 extern int     vflag;          /* print out actions taken */
 extern int     yflag;          /* always try to recover from tape errors */
 /*
@@ -24,9 +42,11 @@ extern char  *clrimap;       /* map of inodes to be deleted */
 extern ino_t   maxino;         /* highest numbered inode in this file system */
 extern long    dumpnum;        /* location of the dump on this tape */
 extern long    volno;          /* current volume being read */
 extern ino_t   maxino;         /* highest numbered inode in this file system */
 extern long    dumpnum;        /* location of the dump on this tape */
 extern long    volno;          /* current volume being read */
+extern long    ntrec;          /* number of TP_BSIZE records per tape block */
 extern time_t  dumptime;       /* time that this dump begins */
 extern time_t  dumpdate;       /* time that this dump was made */
 extern char    command;        /* opration being performed */
 extern time_t  dumptime;       /* time that this dump begins */
 extern time_t  dumpdate;       /* time that this dump was made */
 extern char    command;        /* opration being performed */
+extern FILE    *terminal;      /* file descriptor for the terminal input */
 
 /*
  * Each file in the file system is described by one of these entries
 
 /*
  * Each file in the file system is described by one of these entries
@@ -37,50 +57,46 @@ struct entry {
        char    e_type;                 /* type of this entry, see below */
        short   e_flags;                /* status flags, see below */
        ino_t   e_ino;                  /* inode number in previous file sys */
        char    e_type;                 /* type of this entry, see below */
        short   e_flags;                /* status flags, see below */
        ino_t   e_ino;                  /* inode number in previous file sys */
-       char    *e_newname;             /* full pathname of rename in new fs */
+       long    e_index;                /* unique index (for dumpped table) */
        struct  entry *e_parent;        /* pointer to parent directory (..) */
        struct  entry *e_sibling;       /* next element in this directory (.) */
        struct  entry *e_links;         /* hard links to this inode */
        struct  entry *e_entries;       /* for directories, their entries */
        struct  entry *e_parent;        /* pointer to parent directory (..) */
        struct  entry *e_sibling;       /* next element in this directory (.) */
        struct  entry *e_links;         /* hard links to this inode */
        struct  entry *e_entries;       /* for directories, their entries */
+       struct  entry *e_next;          /* hash chain list */
 };
 /* types */
 #define        LEAF 1                  /* non-directory entry */
 #define NODE 2                 /* directory entry */
 #define LINK 4                 /* synthesized type, stripped by addentry */
 /* flags */
 };
 /* types */
 #define        LEAF 1                  /* non-directory entry */
 #define NODE 2                 /* directory entry */
 #define LINK 4                 /* synthesized type, stripped by addentry */
 /* flags */
-#define REMOVE         0x0001  /* entry to be removed */
-#define REMOVED                0x0002  /* entry has been removed */
-#define RENAME         0x0004  /* entry to be renamed */
-#define TMPNAME                0x0008  /* entry has been given a temporary name */
-#define TMPNODE                0x0010  /* entry is a temporary, to be replaced */
-#define EXTRACT                0x0020  /* entry is to be extracted from the tape */
-#define RENUMBER       0x0040  /* entry is to be assigned a new inode number */
-#define CHANGE         0x0080  /* entry is to be deleted and extracted */
-#define NEW            0x0100  /* a new entry to be extracted */
-#define KEEP           0x0200  /* entry is not to change */
+#define EXTRACT                0x0001  /* entry is to be replaced from the tape */
+#define NEW            0x0002  /* a new entry to be extracted */
+#define KEEP           0x0004  /* entry is not to change */
+#define REMOVED                0x0010  /* entry has been removed */
+#define TMPNAME                0x0020  /* entry has been given a temporary name */
+#define EXISTED                0x0040  /* directory already existed during extract */
 /*
  * functions defined on entry structs
  */
 /*
  * functions defined on entry structs
  */
-extern struct entry **entry;
 extern struct entry *lookupino();
 extern struct entry *lookupname();
 extern struct entry *lookupparent();
 extern struct entry *lookupino();
 extern struct entry *lookupname();
 extern struct entry *lookupparent();
-extern struct entry *pathcheck();
 extern struct entry *addentry();
 extern char *myname();
 extern char *savename();
 extern struct entry *addentry();
 extern char *myname();
 extern char *savename();
+extern char *gentempname();
+extern char *flagvalues();
 extern ino_t lowerbnd();
 extern ino_t upperbnd();
 extern ino_t lowerbnd();
 extern ino_t upperbnd();
+extern DIR *rst_opendir();
+extern struct direct *rst_readdir();
 #define NIL ((struct entry *)(0))
 #define NIL ((struct entry *)(0))
-#define lookupino(inum)                (entry[(inum)])
-#define addino(inum, np)       (entry[(inum)] = (np))
-#define deleteino(inum)                (entry[(inum)] = (struct entry *)NIL)
 /*
  * Constants associated with entry structs
  */
 /*
  * Constants associated with entry structs
  */
-#define HARDLINK 1
-#define SYMLINK  2
-#define TMPCHAR (0x01)
+#define HARDLINK       1
+#define SYMLINK                2
+#define TMPHDR         "RSTTMP"
 
 /*
  * The entry describes the next file available on the tape
 
 /*
  * The entry describes the next file available on the tape
@@ -100,15 +116,24 @@ struct context {
  * Other exported routines
  */
 extern ino_t psearch();
  * Other exported routines
  */
 extern ino_t psearch();
-extern void listfile();
-extern void addfile();
-extern void markfile();
-extern void verifyfile();
+extern ino_t dirlookup();
+extern long listfile();
+extern long deletefile();
+extern long addfile();
+extern long nodeupdates();
+extern long verifyfile();
 extern char *rindex();
 extern char *index();
 extern char *rindex();
 extern char *index();
-extern void strcat();
-extern void strcpy();
-extern void mktemp();
+extern char *strcat();
+extern char *strncat();
+extern char *strcpy();
+extern char *strncpy();
+extern char *fgets();
+extern char *mktemp();
+extern char *malloc();
+extern char *calloc();
+extern char *realloc();
+extern long lseek();
 
 /*
  * Useful macros
 
 /*
  * Useful macros