lint (calloc declaration is provided elsewhere)
[unix-history] / usr / src / sbin / dump / dump.h
index 389b3a2..83cc74f 100644 (file)
@@ -1,12 +1,12 @@
-/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.  The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
+/*-
+ * Copyright (c) 1980 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * %sccs.include.redist.c%
  *
  *
- *     @(#)dump.h      5.13 (Berkeley) %G%
+ *     @(#)dump.h      5.22 (Berkeley) %G%
  */
 
  */
 
-#define        NI              16
 #define MAXINOPB       (MAXBSIZE / sizeof(struct dinode))
 #define MAXNINDIR      (MAXBSIZE / sizeof(daddr_t))
 
 #define MAXINOPB       (MAXBSIZE / sizeof(struct dinode))
 #define MAXNINDIR      (MAXBSIZE / sizeof(daddr_t))
 
@@ -52,71 +52,83 @@ int notify;         /* notify operator flag */
 int    blockswritten;  /* number of blocks written on current tape */
 int    tapeno;         /* current tape number */
 time_t tstart_writing; /* when started writing the first tape block */
 int    blockswritten;  /* number of blocks written on current tape */
 int    tapeno;         /* current tape number */
 time_t tstart_writing; /* when started writing the first tape block */
-char   *processname;
 struct fs *sblock;     /* the file system super block */
 struct fs *sblock;     /* the file system super block */
-char   buf[MAXBSIZE];
+char   sblock_buf[MAXBSIZE];
 long   dev_bsize;      /* block size of underlying disk device */
 int    dev_bshift;     /* log2(dev_bsize) */
 int    tp_bshift;      /* log2(TP_BSIZE) */
 
 /* operator interface functions */
 long   dev_bsize;      /* block size of underlying disk device */
 int    dev_bshift;     /* log2(dev_bsize) */
 int    tp_bshift;      /* log2(TP_BSIZE) */
 
 /* operator interface functions */
-void   broadcast();
-void   lastdump();
-void   msg();
-void   msgtail();
-int    query();
-void   set_operators();
-void   timeest();
+void   broadcast __P((char *message));
+void   lastdump __P((int arg));        /* int should be char */
+void   msg __P((const char *fmt, ...));
+void   msgtail __P((const char *fmt, ...));
+int    query __P((char *question));
+void   quit __P((const char *fmt, ...));
+void   set_operators __P((void));
+void   timeest __P((void));
+time_t unctime __P((char *str));
 
 /* mapping rouintes */
 
 /* mapping rouintes */
-long   blockest();
-int    mapfiles();
-int    mapdirs();
+struct dinode;
+long   blockest __P((struct dinode *dp));
+int    mapfiles __P((ino_t maxino, long *tapesize));
+int    mapdirs __P((ino_t maxino, long *tapesize));
 
 /* file dumping routines */
 
 /* file dumping routines */
-void   dirdump();
-void   blksout();
-void   dumpmap();
-void   writeheader();
-void   bread();
+void   blksout __P((daddr_t *blkp, int frags, ino_t ino));
+void   bread __P((daddr_t blkno, char *buf, int size));        
+void   dumpino __P((struct dinode *dp, ino_t ino));
+void   dumpmap __P((char *map, int type, ino_t ino));
+void   writeheader __P((ino_t ino));
 
 /* tape writing routines */
 
 /* tape writing routines */
-int    alloctape();
-void   writerec();
-void   dumpblock();
-void   flushtape();
-void   trewind();
-void   close_rewind();
-void   startnewtape();
-
-void   dumpabort();
-void   Exit();
-void   getfstab();
-void   quit();
-
-char   *rawname();
-struct dinode *getino();
-
-void   interrupt();            /* in case operator bangs on console */
+int    alloctape __P((void));
+void   close_rewind __P((void));
+void   dumpblock __P((daddr_t blkno, int size));
+void   startnewtape __P((int top));
+void   trewind __P((void));
+void   writerec __P((char *dp, int isspcl));
+
+void   Exit __P((int status));
+void   dumpabort __P((int signo));
+void   getfstab __P((void));
+
+char   *rawname __P((char *cp));
+struct dinode *getino __P((ino_t inum));
+
+/* rdump routines */
+#ifdef RDUMP
+void   rmtclose __P((void));
+int    rmthost __P((char *host));
+int    rmtopen __P((char *tape, int mode));
+int    rmtwrite __P((char *buf, int count));
+#endif /* RDUMP */
+
+void   interrupt __P((int signo));     /* in case operator bangs on console */
 
 /*
  *     Exit status codes
  */
 #define        X_FINOK         0       /* normal exit */
 #define        X_REWRITE       2       /* restart writing from the check point */
 
 /*
  *     Exit status codes
  */
 #define        X_FINOK         0       /* normal exit */
 #define        X_REWRITE       2       /* restart writing from the check point */
-#define        X_ABORT         3       /* abort all of dump; don't attempt checkpointing*/
+#define        X_ABORT         3       /* abort dump; don't attempt checkpointing */
 
 #define        OPGRENT "operator"              /* group entry to notify */
 #define DIALUP "ttyd"                  /* prefix for dialups */
 
 
 #define        OPGRENT "operator"              /* group entry to notify */
 #define DIALUP "ttyd"                  /* prefix for dialups */
 
-struct fstab   *fstabsearch(); /* search in fs_file and fs_spec */
+struct fstab *fstabsearch __P((char *key));    /* search fs_file and fs_spec */
+
+#ifndef NAME_MAX
+#define NAME_MAX 255
+#endif
 
 /*
  *     The contents of the file _PATH_DUMPDATES is maintained both on
  *     a linked list, and then (eventually) arrayified.
  */
 struct dumpdates {
 
 /*
  *     The contents of the file _PATH_DUMPDATES is maintained both on
  *     a linked list, and then (eventually) arrayified.
  */
 struct dumpdates {
-       char    dd_name[MAXNAMLEN+3];
+       char    dd_name[NAME_MAX+3];
        char    dd_level;
        time_t  dd_ddate;
 };
        char    dd_level;
        time_t  dd_ddate;
 };
@@ -128,26 +140,13 @@ struct    dumptime *dthead;       /* head of the list version */
 int    nddates;                /* number of records (might be zero) */
 int    ddates_in;              /* we have read the increment file */
 struct dumpdates **ddatev;     /* the arrayfied version */
 int    nddates;                /* number of records (might be zero) */
 int    ddates_in;              /* we have read the increment file */
 struct dumpdates **ddatev;     /* the arrayfied version */
-void   initdumptimes();
-void   getdumptime();
-void   putdumptime();
+void   initdumptimes __P((void));
+void   getdumptime __P((void));
+void   putdumptime __P((void));
 #define        ITITERATE(i, ddp) \
        for (ddp = ddatev[i = 0]; i < nddates; ddp = ddatev[++i])
 
 #define        ITITERATE(i, ddp) \
        for (ddp = ddatev[i = 0]; i < nddates; ddp = ddatev[++i])
 
-/*
- *     We catch these interrupts
- */
-void   sighup();
-void   sigquit();
-void   sigill();
-void   sigtrap();
-void   sigfpe();
-void   sigkill();
-void   sigbus();
-void   sigsegv();
-void   sigsys();
-void   sigalrm();
-void   sigterm();
+void   sig __P((int signo));
 
 /*
  * Compatibility with old systems.
 
 /*
  * Compatibility with old systems.
@@ -155,8 +154,21 @@ void       sigterm();
 #ifndef __STDC__
 #include <sys/file.h>
 #define _PATH_FSTAB    "/etc/fstab"
 #ifndef __STDC__
 #include <sys/file.h>
 #define _PATH_FSTAB    "/etc/fstab"
-typedef int (*sig_t)();
-extern char *strdup();
+extern char *index(), *strdup();
 extern char *ctime();
 extern int errno;
 #endif
 extern char *ctime();
 extern int errno;
 #endif
+
+#ifdef sunos
+extern char *calloc();
+extern char *malloc();
+extern long atol();
+extern char *strcpy();
+extern char *strncpy();
+extern char *strcat();
+extern time_t time();
+extern void endgrent();
+extern __dead void exit();
+extern off_t lseek();
+extern char *strerror();
+#endif