BSD 4_4 release
[unix-history] / usr / src / sbin / dump / itime.c
index f3e6a03..94656ac 100644 (file)
@@ -1,35 +1,63 @@
 /*-
 /*-
- * Copyright (c) 1980 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ *     The Regents of the University of California.  All rights reserved.
  *
  *
- * %sccs.include.redist.c%
+ * Redistribution and use in source and binary forms, with or without
+ * 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.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the University of
+ *     California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 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.
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)itime.c    5.14 (Berkeley) %G%";
+static char sccsid[] = "@(#)itime.c    8.1 (Berkeley) 6/5/93";
 #endif /* not lint */
 
 #endif /* not lint */
 
-#ifdef sunos
-#include <stdio.h>
-#include <ctype.h>
 #include <sys/param.h>
 #include <sys/param.h>
-#include <sys/stat.h>
+#include <sys/time.h>
+#ifdef sunos
+#include <sys/vnode.h>
+
+#include <ufs/fsdir.h>
+#include <ufs/inode.h>
 #include <ufs/fs.h>
 #else
 #include <ufs/fs.h>
 #else
-#include <sys/param.h>
-#include <sys/time.h>
-#endif
 #include <ufs/ufs/dinode.h>
 #include <ufs/ufs/dinode.h>
-#include <fcntl.h>
+#endif
+
 #include <protocols/dumprestore.h>
 #include <protocols/dumprestore.h>
+
 #include <errno.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <stdio.h>
 #ifdef __STDC__
 #include <stdio.h>
 #ifdef __STDC__
-#include <time.h>
-#include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
 #include <stdlib.h>
 #include <string.h>
+#include <unistd.h>
 #endif
 #endif
+
 #include "dump.h"
 
 struct dumpdates **ddatev = 0;
 #include "dump.h"
 
 struct dumpdates **ddatev = 0;
@@ -37,11 +65,10 @@ int nddates = 0;
 int    ddates_in = 0;
 struct dumptime *dthead = 0;
 
 int    ddates_in = 0;
 struct dumptime *dthead = 0;
 
-void   readdumptimes();
-int    getrecord();
-int    makedumpdate();
-
-static void dumprecout();
+static void dumprecout __P((FILE *, struct dumpdates *));
+static int getrecord __P((FILE *, struct dumpdates *));
+static int makedumpdate __P((struct dumpdates *, char *));
+static void readdumptimes __P((FILE *));
 
 void
 initdumptimes()
 
 void
 initdumptimes()
@@ -75,7 +102,7 @@ initdumptimes()
        (void) fclose(df);
 }
 
        (void) fclose(df);
 }
 
-void
+static void
 readdumptimes(df)
        FILE *df;
 {
 readdumptimes(df)
        FILE *df;
 {
@@ -206,7 +233,8 @@ dumprecout(file, what)
 }
 
 int    recno;
 }
 
 int    recno;
-int
+
+static int
 getrecord(df, ddatep)
        FILE *df;
        struct dumpdates *ddatep;
 getrecord(df, ddatep)
        FILE *df;
        struct dumpdates *ddatep;
@@ -228,9 +256,7 @@ getrecord(df, ddatep)
        return(0);
 }
 
        return(0);
 }
 
-time_t unctime();
-
-int
+static int
 makedumpdate(ddp, tbuf)
        struct dumpdates *ddp;
        char *tbuf;
 makedumpdate(ddp, tbuf)
        struct dumpdates *ddp;
        char *tbuf;