add Berkeley specific header
[unix-history] / usr / src / old / vfilters / vpf / vpf.c
index 97ef45a..657afa8 100644 (file)
@@ -1,6 +1,24 @@
+/*
+ * Copyright (c) 1983 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that this notice is preserved and that due credit is given
+ * to the University of California at 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'' without express or implied warranty.
+ */
+
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)vpf.c      4.7 (Berkeley) %G%";
-#endif
+char copyright[] =
+"@(#) Copyright (c) 1983 Regents of the University of California.\n\
+ All rights reserved.\n";
+#endif /* not lint */
+
+#ifndef lint
+static char sccsid[] = "@(#)vpf.c      5.2 (Berkeley) %G%";
+#endif /* not lint */
 
 /*
  * Varian/Versatec printer filter
 
 /*
  * Varian/Versatec printer filter
@@ -20,6 +38,7 @@ int   ov;
 int    lineno;
 int    varian = 1;     /* default is the varian */
 int    width = 132;    /* default line length */
 int    lineno;
 int    varian = 1;     /* default is the varian */
 int    width = 132;    /* default line length */
+int    indent = 0;     /* default indent length */
 int    length = 58;    /* 80 for 11" long paper */
 int    npages = 1;
 int    literal;
 int    length = 58;    /* 80 for 11" long paper */
 int    npages = 1;
 int    literal;
@@ -27,7 +46,7 @@ char  *name;          /* user's login name */
 char   *host;          /* user's machine name */
 char   *acctfile;      /* accounting information file */
 
 char   *host;          /* user's machine name */
 char   *acctfile;      /* accounting information file */
 
-main(argc, argv) 
+main(argc, argv)
        int argc;
        char *argv[];
 {
        int argc;
        char *argv[];
 {
@@ -61,6 +80,12 @@ main(argc, argv)
                                length = atoi(&argv[0][2]);
                                break;
 
                                length = atoi(&argv[0][2]);
                                break;
 
+                       case 'i':
+                               if ((i = atoi(&argv[0][2])) >= 0 &&
+                                   i < LINELN - 1)
+                                       indent = i;
+                               break;
+
                        case 'c':       /* Print input without throwing away
                                           control chars and without putting
                                           in page breaks. */
                        case 'c':       /* Print input without throwing away
                                           control chars and without putting
                                           in page breaks. */
@@ -112,7 +137,7 @@ getline()
                linebuf[col] = ' ';
                ovbuf[col] = 0;
        }
                linebuf[col] = ' ';
                ovbuf[col] = 0;
        }
-       col = 0;
+       col = indent;
        maxcol = 0;
        for (;;) switch (c = getchar()) {
 
        maxcol = 0;
        for (;;) switch (c = getchar()) {