1: /*
   2:  * Copyright (c) 1983 Regents of the University of California.
   3:  * All rights reserved.  The Berkeley software License Agreement
   4:  * specifies the terms and conditions for redistribution.
   5:  */
   6: 
   7: #ifndef lint
   8: char copyright[] =
   9: "@(#) Copyright (c) 1983 Regents of the University of California.\n\
  10:  All rights reserved.\n";
  11: #endif not lint
  12: 
  13: #ifndef lint
  14: static char sccsid[] = "@(#)lptest.c	5.1 (Berkeley) 6/6/85";
  15: #endif not lint
  16: 
  17: /*
  18:  * lptest -- line printer test program (and other devices).
  19:  */
  20: 
  21: #include <stdio.h>
  22: 
  23: main(argc, argv)
  24:     int argc;
  25:     char **argv;
  26: {
  27:     int len, count;
  28:     register i, j, fc, nc;
  29:     char outbuf[BUFSIZ];
  30: 
  31:     setbuf(stdout, outbuf);
  32:     if (argc >= 2)
  33:         len = atoi(argv[1]);
  34:     else
  35:         len = 79;
  36:     if (argc >= 3)
  37:         count = atoi(argv[2]);
  38:     else
  39:         count = 200;
  40:     fc = ' ';
  41:     for (i = 0; i < count; i++) {
  42:         if (++fc == 0177)
  43:             fc = ' ';
  44:         nc = fc;
  45:         for (j = 0; j < len; j++) {
  46:             putchar(nc);
  47:             if (++nc == 0177)
  48:                 nc = ' ';
  49:         }
  50:         putchar('\n');
  51:     }
  52:     (void) fflush(stdout);
  53: }

Defined functions

main defined in line 23; never used

Defined variables

copyright defined in line 8; never used
sccsid defined in line 14; never used
Last modified: 1987-02-18
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 2389
Valid CSS Valid XHTML 1.0 Strict